Пример #1
0
        internal static IntPtr CreateWindowEx(WindowsStyleEx dwExStyle, string lpszClassName, string lpszWindowName,
                                              WindowsStyle style, int x, int y, int width, int height,
                                              IntPtr hWndParent, IntPtr hMenu, IntPtr hInst,
                                              [MarshalAs(UnmanagedType.AsAny)] object pvParam)
        {
            IntPtr ptr = IntCreateWindowEx(dwExStyle, lpszClassName, lpszWindowName, style, x, y, width, height, hWndParent,
                                           hMenu, hInst, pvParam);

            if (ptr == IntPtr.Zero)
            {
                throw new Win32Exception();
            }
            return(ptr);
        }
Пример #2
0
            public Window(WindowsStyle pStyle, WindowsStyleEx pExStyle, string pClassName,
                          string pWindowName, int pLeft, int pTop, int pWidth, int pHeight)
            {
                PreInitialize();

                IntPtr xHandle =
                    CreateWindowEx(pExStyle, pClassName, pWindowName, pStyle, pLeft, pTop, pWidth, pHeight,
                                   IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);

                if (xHandle == IntPtr.Zero)
                {
                    throw new Win32Exception(Marshal.GetLastWin32Error());
                }
                wndHandle     = xHandle;
                destroyWindow = true;
                Subclass();
            }
Пример #3
0
 internal static extern IntPtr IntCreateWindowEx(WindowsStyleEx dwExStyle, string lpszClassName, string lpszWindowName,
                                                 WindowsStyle style, int x, int y, int width, int height,
                                                 IntPtr hWndParent, IntPtr hMenu, IntPtr hInst,
                                                 [MarshalAs(UnmanagedType.AsAny)] object pvParam);