Esempio n. 1
0
        public static void ShowDialog()
        {
            var wnd = Instance = new DlgLicense();

            wnd.CreateMainWindow(740, 520,
                                 SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_MAIN |
                                 SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_ENABLE_DEBUG |
                                 SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_POPUP |
                                 SciterXDef.SCITER_CREATE_WINDOW_FLAGS.SW_TITLEBAR
                                 );
            wnd.CenterTopLevelWindow();
            wnd.Title = Consts.AppName;
#if WINDOWS
            wnd.Icon = Properties.Resources.IconMain;
            new Win32Hwnd(wnd._hwnd).ModifyStyle(0, PInvoke.User32.SetWindowLongFlags.WS_SYSMENU);
#endif

            Host = new DlgLicenseHost(wnd);

            // For testing to work
            wnd.Show();

#if false
            PInvokeWindows.MSG msg;
            while (PInvokeWindows.GetMessage(out msg, IntPtr.Zero, 0, 0) != 0)
            {
                PInvokeWindows.TranslateMessage(ref msg);
                PInvokeWindows.DispatchMessage(ref msg);
            }
#else
            wnd.ShowModal();
#endif
        }
Esempio n. 2
0
        public void TestODH()
        {
            TestableDOH odh = new TestableDOH();

            SciterWindow wnd = new SciterWindow();

            wnd.CreateMainWindow(1500, 800);
            wnd.Title = "Wtf";
            bool res = wnd.LoadHtml(@"
<html>
<style>
	body { wtf: 123; }
</style>

<script type='text/tiscript'>
</script>
</html>
");

            Assert.IsTrue(res);

            PInvokeWindows.MSG msg;
            while (PInvokeWindows.GetMessage(out msg, IntPtr.Zero, 0, 0) != 0)
            {
                wnd.Show();
                PInvokeWindows.TranslateMessage(ref msg);
                PInvokeWindows.DispatchMessage(ref msg);
            }

            Assert.IsTrue(odh.msgs.Count == 1);
        }
Esempio n. 3
0
 private void TranslateAndDispatch(CancellationToken token)
 {
     while (!token.IsCancellationRequested && PInvokeWindows.GetMessage(lpMsg: out var msg, hWnd: IntPtr.Zero, wMsgFilterMin: 0, wMsgFilterMax: 0) != 0)
     {
         PInvokeWindows.TranslateMessage(ref msg);
         PInvokeWindows.DispatchMessage(ref msg);
     }
 }