コード例 #1
0
ファイル: ImageDlgBase.cs プロジェクト: scaperow/-V2.0
        protected void CreateFakeWnd()
        {
            WNDCLASSEX wndClsEx = new WNDCLASSEX();

            wndClsEx.Init();
            wndClsEx.style         = WndClassType.CS_VREDRAW | WndClassType.CS_HREDRAW;
            wndClsEx.lpfnWndProc   = m_DefWndProcDelegate;
            wndClsEx.cbClsExtra    = 0;
            wndClsEx.cbWndExtra    = 0;
            wndClsEx.hInstance     = Kernal32Dll.GetModuleHandle(null);
            wndClsEx.hIcon         = IntPtr.Zero;
            wndClsEx.hIconSm       = IntPtr.Zero;
            wndClsEx.hCursor       = IntPtr.Zero;
            wndClsEx.hbrBackground = IntPtr.Zero;
            wndClsEx.lpszClassName = m_WndClsName;
            wndClsEx.lpszMenuName  = null;

            bool success = User32Dll.RegisterClassEx(ref wndClsEx) != 0;

            Debug.Assert(success, "RegisterWndClass failed.");
            UInt32 dwExStyle = ExtendedWndStyle.WS_EX_LAYERED |
                               ExtendedWndStyle.WS_EX_TRANSPARENT |
                               ExtendedWndStyle.WS_EX_NOACTIVATE |
                               ExtendedWndStyle.WS_EX_LEFT;
            UInt32 dwStyle = WndStyle.WS_VISIBLE | WndStyle.WS_OVERLAPPED;

            m_FakeWndHandle = User32Dll.CreateWindowEx(dwExStyle
                                                       , m_WndClsName
                                                       , null
                                                       , dwStyle
                                                       , this.Left
                                                       , this.Top
                                                       , m_BgImg.Width
                                                       , m_BgImg.Height
                                                       , this.Handle
                                                       , IntPtr.Zero
                                                       , Kernal32Dll.GetModuleHandle(null)
                                                       , IntPtr.Zero
                                                       );
            Debug.Assert(User32Dll.IsWindow(m_FakeWndHandle), "CreateWindowEx failed.");
        }
コード例 #2
0
ファイル: User32Dll.cs プロジェクト: scaperow/-V2.0
 public static extern short RegisterClassEx([In] ref WNDCLASSEX lpwcx);