コード例 #1
0
        public void CreateChildWindow(IntPtr hwnd_parent)
        {
            if (PInvokeWindows.IsWindow(hwnd_parent) == false)
            {
                throw new ArgumentException("Invalid parent window");
            }

            PInvokeUtils.RECT rc;
            PInvokeWindows.GetClientRect(hwnd_parent, out rc);

            string wndclass = Marshal.PtrToStringUni(_api.SciterClassName());

            _hwnd = PInvokeWindows.CreateWindowEx(0, wndclass, null, PInvokeWindows.WS_CHILD, 0, 0, rc.right, rc.bottom, hwnd_parent, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);

            /*PInvokeUtils.RECT frame = new PInvokeUtils.RECT();
            *  _hwnd = _api.SciterCreateWindow(SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_CHILD, ref frame, _proc, IntPtr.Zero, hwnd_parent);
            *  if(_hwnd == IntPtr.Zero)
            *       throw new Exception("CreateChildWindow() failed");*/
        }
コード例 #2
0
        /*
         * /// <summary>
         * /// Create an owned top-level Sciter window
         * /// </summary>
         * /// <param name="width"></param>
         * /// <param name="height"></param>
         * /// <param name="owner_hwnd"></param>
         * public void CreatePopupAlphaWindow(int width, int height, IntPtr owner_hwnd)
         * {
         *      PInvokeUtils.RECT frame = new PInvokeUtils.RECT();
         *      frame.right = width;
         *      frame.bottom = height;
         *      CreateWindow(frame, SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_ALPHA | SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_TOOL, owner_hwnd);
         *      // Sciter BUG: window comes with WM_EX_APPWINDOW style
         * }*/

#if WINDOWS
        public void CreateChildWindow(IntPtr hwnd_parent, SciterXDef.SCITER_CREATE_WINDOW_FLAGS flags = SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_CHILD)
        {
            if (PInvokeWindows.IsWindow(hwnd_parent) == false)
            {
                throw new ArgumentException("Invalid parent window");
            }

            PInvokeUtils.RECT frame;
            PInvokeWindows.GetClientRect(hwnd_parent, out frame);

#if true
            string wndclass = Marshal.PtrToStringUni(_api.SciterClassName());
            _hwnd = PInvokeWindows.CreateWindowEx(0, wndclass, null, PInvokeWindows.WS_CHILD, 0, 0, frame.right, frame.bottom, hwnd_parent, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
            //SetSciterOption(SciterXDef.SCITER_RT_OPTIONS.SCITER_SET_DEBUG_MODE, new IntPtr(1));// NO, user should opt for it
#else
            _hwnd = _api.SciterCreateWindow(flags, ref frame, _proc, IntPtr.Zero, hwnd_parent);
#endif

            if (_hwnd == IntPtr.Zero)
            {
                throw new Exception("CreateChildWindow() failed");
            }
        }