none
获取页面句柄的问题 RRS feed

  • 问题

  •  public delegate bool CallBack(int hwnd,int IParam);

        public class EnumWindowsApp
        {

            [DllImport("user32")]

    ---------------------------------------------------------------------------------------------------------------------

            public static extern int EnumWindows(CallBack x,int y);

            public static void Main()
            {
                CallBack myCallBack = new CallBack(EnumWindowsApp.report);
                EnumWindows(myCallBack,0);
            }

    各位大神,我想知道我框起来的这段代码是有什么作用的?能给个解释吗?谢谢了~~~~

    ---------------------------------------------------------------------------------------------------------------------

            public static bool Report(int hwnd, int IParam)
            {
                Console.Write("Window handle is :");
                Console.WriteLine(hwnd);
                return true;
            }
        }

    2012年2月17日 8:38

答案

全部回复