Ejemplo n.º 1
0
        /// <summary>
        /// Set the indentation using the level of this item
        /// </summary>
        /// <returns>True if successfull, false otherwise</returns>
        public bool SetIndentation()
        {
            if (!IsInATreeListView)
            {
                return(false);
            }
            bool res = true;

            APIsStructs.LV_ITEM lvi = new APIsStructs.LV_ITEM();
            lvi.iItem   = Index;
            lvi.iIndent = Level;
            if (TreeListView.ShowPlusMinus)
            {
                lvi.iIndent++;
            }
            lvi.mask = APIsEnums.ListViewItemFlags.INDENT;
            try
            {
                APIsUser32.SendMessage(
                    ListView.Handle,
                    APIsEnums.ListViewMessages.SETITEM,
                    0,
                    ref lvi);
            }
            catch
            {
                res = false;
            }
            return(res);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Asks the associated TreeListView control to redraw this item
 /// </summary>
 public void Redraw()
 {
     if (ListView == null || !Visible)
     {
         return;
     }
     try
     {
         APIsUser32.SendMessage(
             new HandleRef(this, ListView.Handle),
             (int)APIsEnums.ListViewMessages.REDRAWITEMS,
             (IntPtr)Index, (IntPtr)Index);
     }
     catch {}
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Asks the associated TreeListView control to redraw this item
 /// </summary>
 public void Redraw()
 {
     if (ListView == null || !Visible)
     {
         return;
     }
     try
     {
         APIsUser32.SendMessage(
             ListView.Handle,
             (int)APIsEnums.ListViewMessages.REDRAWITEMS,
             Index, Index);
     }
     catch { }
 }
Ejemplo n.º 4
0
 static private void KillMxDrawProc()
 {
     while (true)
     {
         Thread.Sleep(10);
         foreach (string key in _KilledWindowCollection.Keys)
         {
             string winText = _KilledWindowCollection[key];
             IntPtr p       = APIsWndProc.FindWindow(key, winText);
             if (p.ToInt32() > 0)
             {
                 APIsUser32.SendMessage(p, 16, 0, 0);
             }
         }
         if (_StopKillWindowThread)
         {
             _KillWindowThreadIsRun = false;
             break;
         }
     }
 }