2010-01-07 4 views

Répondre

0

Je pense qu'il essaie d'obtenir les poignées d'une autre fenêtre, pas sa fenêtre

2
public Form1() 
    { 
    InitializeComponent(); 
    List<IntPtr> handles = GetHandles(this.Controls); 
    } 

    public List<IntPtr> GetHandles(Control.ControlCollection inControls) 
    { 
    List<IntPtr> list_of_handles = new List<IntPtr>(); 
    if(inControls != null) 
    { 
     foreach (Control c in inControls) 
     { 
      list_of_handles.Add(c.Handle); 
      list_of_handles.AddRange(GetHandles(c.Controls)); 
     } 
    } 
    return list_of_handles; 
    } 
Questions connexes