private void HideWindowFromTaskbar(IntPtr pMainWindow)
 {
     //SLLaserDeskUtility.SetWindowLong(pMainWindow, SLLaserDeskUtility.GWL_EXSTYLE,~SLLaserDeskUtility.WS_EX_APPWINDOW);
     SLLaserDeskUtility.ShowWindow(pMainWindow, SLLaserDeskUtility.WindowShowStyle.Hide);
     //SLLaserDeskUtility.SetWindowLong(pMainWindow, SLLaserDeskUtility.GWL_EXSTYLE, SLLaserDeskUtility.GetWindowLong(pMainWindow, SLLaserDeskUtility.GWL_EXSTYLE) | SLLaserDeskUtility.WS_EX_TOOLWINDOW);
     // SLLaserDeskUtility.ShowWindow(pMainWindow, SLLaserDeskUtility.WindowShowStyle.Show);
 }
        public void AutoConfirmRemoteGUI()
        {
            System.Threading.Thread.Sleep(1000);
            //Auto Confirm Remote Dialog
            IntPtr hwndRemote = SLLaserDeskUtility.FindWindow(null, "Remote Control");

            SLLaserDeskUtility.PostMessage(hwndRemote, SLLaserDeskUtility.WM_KEYDOWN, SLLaserDeskUtility.VK_RETURN, 1);

            System.Threading.Thread.Sleep(1000);
            IntPtr hwndLogIn = SLLaserDeskUtility.FindWindow(null, "SCANLAB laserDESK");

            SLLaserDeskUtility.PostMessage(hwndLogIn, SLLaserDeskUtility.WM_KEYDOWN, SLLaserDeskUtility.VK_RETURN, 1);
        }
Beispiel #3
0
        //private void btnTCPDisConn_Click(object sender, EventArgs e)
        //{
        //    _laserDesk.DisconnectLaserDesk();
        //    btnLaserDeskConnect.BackColor = SystemColors.Control;
        //}


        private void btnReOpenLaserDesk_Click(object sender, EventArgs e)
        {
            _laserDesk.DisconnectLaserDesk();

            _laserDesk.OpenLaserDesk();
            SLLaserDeskUtility.ShowWindow(_laserDesk.SLLaserDeskProcesss.MainWindowHandle, SLLaserDeskUtility.WindowShowStyle.Hide);
            SLLaserDeskUtility.SetParent(_laserDesk.SLLaserDeskProcesss.MainWindowHandle, apiPanel.Handle);
            SLLaserDeskUtility.SendMessage(_laserDesk.SLLaserDeskProcesss.MainWindowHandle, SLLaserDeskUtility.WM_SYSCOMMAND, SLLaserDeskUtility.SC_MAXIMIZE, 0);

            System.Threading.Thread.Sleep(5000);
            _laserDesk.InitialLaserDesk();
            //_laserDesk.AutoConfirmRemoteGUI();
        }
Beispiel #4
0
        private void BuildIntimer_Tick(object sender, EventArgs e)
        {
            try
            {
                int    GWL_STYLE = -16;
                UInt32 WS_POPUP  = 0x80000000;
                UInt32 WS_CHILD  = 0x40000000;

                IntPtr pMainWindow = Process.GetProcessesByName("SLLaserDesk")[0].MainWindowHandle;

                UInt32 style = SLLaserDeskUtility.GetWindowLong(pMainWindow, GWL_STYLE);
                style = (style | WS_CHILD) & (~WS_POPUP);
                SLLaserDeskUtility.SetWindowLong(pMainWindow, GWL_STYLE, style);
                SLLaserDeskUtility.SetParent(pMainWindow, apiPanel.Handle);


                //Auto Confirm Remote Dialog

                if (_firstTimeTrigger)
                {
                    _laserDesk.InitialLaserDesk();
                    System.Threading.Thread.Sleep(1000);
                    IntPtr hwndRemote = SLLaserDeskUtility.FindWindow(null, "Remote Control");
                    //UInt32 style2 = SLLaserDeskUtility.GetWindowLong(hwndRemote, GWL_STYLE);
                    //style2 = (style2 | WS_CHILD) & (~WS_POPUP);

                    //SLLaserDeskUtility.SetWindowLong(hwndRemote, GWL_STYLE, style2);
                    SLLaserDeskUtility.ShowWindow(hwndRemote, SLLaserDeskUtility.WindowShowStyle.Show);
                    SLLaserDeskUtility.SetParent(hwndRemote, apiPanel.Handle);
                    SLLaserDeskUtility.SendMessage(hwndRemote, SLLaserDeskUtility.WM_SYSCOMMAND, SLLaserDeskUtility.SC_MAXIMIZE, 0);
                    _firstTimeTrigger = false;
                }
            }
            catch
            {
            }
        }