EnumChildWindows
VB声明
Declare Function EnumChildWindows Lib "user32" Alias "EnumChildWindows" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
lParam Long,在枚举期间,传递给dwcbkd32.ocx定制控件之EnumWindows事件的值。这个值的含义是由程序员规定的。
我不太懂其中lParam的调用问题,请高手指教.
看这个例子
http://www.c-sharpcorner.com/Code/2002/Nov/winghost.asp
建议先看一下EnumWindows的调用方法,微软网站上有搜索一下。
[DllImport("user32.Dll")]
public static extern int EnumWindows(CallBack x, int y);
public delegate bool IECallBack(int hwnd, int lParam);
调用
private void GetIE_Click(object sender, System.EventArgs e)
{
listBoxHandle = listBox1.Handle; //store a listbox handle here.
EnumWindows (new CallBack (IEInstance.EnumWindowCallBack),
(int)listBoxHandle) ;
label1.Text = "Total Instances of Internet Explorer : "+i;
}