Example #1
0
        void createWindow(uint wStyle)
        {
            this.wHandle = USER32.CreateWindowEx(
                0,
                WND_CLASSNAME,
                this.wTitle,
                USER32.WS_OVERLAPPED | USER32.WS_CAPTION | USER32.WS_VISIBLE | wStyle,
                (this.sWidth / 2 - this.wWidth / 2),
                (this.sHeight / 2 - this.wHeight / 2),
                this.wWidth,
                this.wHeight,
                IntPtr.Zero,
                IntPtr.Zero,
                this.hInstance,
                IntPtr.Zero);

            if (this.wHandle == IntPtr.Zero)
            {
                throw new InvalidOperationException("[USER32.CreateWindowEx] Can't create window handle.");
            }
        }