C# Win32API类

来源:互联网 发布:方维拼团系统 源码 编辑:程序博客网 时间:2024/04/30 07:03

  class Win32API
        {
            [DllImport("User32.dll")] //User32.dll是Windows操作系统的核心动态库之一
            public static extern int FindWindow(string lpClassName, string lpWindowName);


            [DllImport("user32", EntryPoint = "RegisterWindowMessage")]
            public static extern int RegisterWindowMessage(
                    string lpString
            );

            [DllImport("user32", EntryPoint = "SendMessage")]
            public static extern int SendMessage(
                    int hwnd,
                    int wMsg,
                    int wParam,
                    ref int lParam
            );

            [DllImport("OLEACC.DLL", EntryPoint = "ObjectFromLresult")]
            public static extern int ObjectFromLresult(
            int lResult,
            ref System.Guid riid,
            int wParam,
            [System.Runtime.InteropServices.MarshalAs(UnmanagedType.Interface), System.Runtime.InteropServices.In, System.Runtime.InteropServices.Out]ref System.Object ppvObject
                //注意这个函数ObjectFromLresult的声明.
            );
        }

原创粉丝点击