/// <summary> /// Launshes the given process /// given means, the handle of which is provided to it. /// </summary> /// <param name="winHandle"></param> public void LaunchProcess(int winHandle) { try { if(winHandle != -1) { //System.Diagnostics.Process pProcess = System.Diagnostics.Process.GetProcessById(nProcessId); //pSharedProcess = System.Diagnostics.Process.GetProcessById(nProcessId); pSharedHandle = winHandle; bIsAppSharingStarted=true; try { if(!RegisterKeys()) { UnRegisterKeys(); RegisterKeys(); //System.Windows.Forms.MessageBox.Show("Hot Keys not Registered Succcessfully"); } } catch(Exception ) { } if(winHandle!= 0) { DrawingClearMessage msg = new DrawingClearMessage(0); msg.m_ControlType = ControlType.ApplicationSharing; msg.SenderID = NetworkManager.thisInstance.profile.ClientId; msg.senderProfile = NetworkManager.thisInstance.profile; // The blue parent window , whos child is App share window. //Commented By zaeem frmHostWindow=new Client.AppSharing.SharedWindowHostFrm(); frmHostWindow.appWin=(System.IntPtr)winHandle; frmHostWindow.AppShareWindow=this.Handle; //Define these delegate so that we can use them while closing app sharing //By clicking on the close App share button // // //Commented By zaeem frmHostWindow.appClose+= new WebMeeting.CloseAppShare(this.ApplicationSharing_appShareClose); frmHostWindow.deltakeback+=new WebMeeting.TakeAnnotationRightsBack(this.SendTakenAnnotationRightsBackMessage); // frmHostWindow.Show(); HostWindowHandle=frmHostWindow.Handle; //SetParent((System.IntPtr)winHandle,frmHostWindow.Handle); //MoveWindow((System.IntPtr)winHandle,0,0,frmHostWindow.Width,frmHostWindow.Height,true); NetworkManager.thisInstance.SendLoadPacket(msg); this.whiteBoard.Clear(true,0); sendingThread = new Thread(new ThreadStart(SendingFunction)); sendingThread.Name = "Application Sharing Sending Thread"; sendingThread.Start(); try { if(appServer.lastFrameImage!=null) { appServer.lastFrameImage.Dispose(); appServer.lastFrameImage=null; } } catch(Exception ex) { WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Module ::: AppShare public void LaunchProcess(int winHandle) doing lastframimage null at the launch process",ex,"",false); } appServer.isDesktopWindowInApp = false; //pProcess.PriorityBoostEnabled = true; // by kamran /* * SW_SHOWNORMAL * Activates and displays a window. If the window is minimized or maximized, the system restores it to * its original size and position. * An application should specify this flag when displaying the window for the first time */ Win32.USER32.ShowWindow(new IntPtr(winHandle) ,Win32.USER32.SW_SHOWNORMAL); // it is necessory to maximized widow appServer.SetCaptureWindowAndStartCapturing(new IntPtr(winHandle)); // we have to open one time more setMinimizeDisable(new IntPtr(winHandle)); winStyleTimer = new System.Timers.Timer(); winStyleTimer.Interval = 5000; winStyleTimer.Elapsed += new System.Timers.ElapsedEventHandler(setMinimizeEnable); winStyleTimer.Start(); } if(isDesktopSharing) pictureBox1.Visible = true; else { this.whiteBoard.InitializeToSize(400,400); this.whiteBoard.pictureBox1.isPictureAssign=false; this.whiteBoard.btn_whtLogg.Visible=false; this.whiteBoard.RunSendingThread(); whiteBoard.IsAppSharingWindow = true; whiteBoard.Visible = true; // to display annotation kamran whiteBoard.BringToFront(); } //listView1.Visible = false; lblINfo.Visible = false; btnShare.Visible = true; btnShare.BringToFront(); btnLog.Visible = true; btnLog.BringToFront(); } else { System.Diagnostics.Process pP = System.Diagnostics.Process.GetCurrentProcess(); System.Diagnostics.Process pProcess = System.Diagnostics.Process.GetProcessById(pP.Id); if(pProcess != null) { DrawingClearMessage msg = new DrawingClearMessage(0); msg.m_ControlType = ControlType.ApplicationSharing; msg.SenderID = NetworkManager.thisInstance.profile.ClientId; msg.senderProfile = NetworkManager.thisInstance.profile; NetworkManager.thisInstance.SendLoadPacket(msg); this.whiteBoard.Clear(true,0); sendingThread = new Thread(new ThreadStart(SendingFunction)); sendingThread.Name = "Application Sharing Sending Thread"; sendingThread.Start(); //appServer.isDesktopWindowInApp = false; //pProcess.PriorityBoostEnabled = true; // by kamran Win32.USER32.ShowWindow(pProcess.MainWindowHandle, Win32.USER32.SW_SHOWMAXIMIZED );// it is necessory to maximized widow appServer.SetCaptureWindowAndStartCapturing(pProcess.MainWindowHandle); // we have to open one time more } if(isDesktopSharing) pictureBox1.Visible = true; else { whiteBoard.Visible = false; // to stop annotation kamran whiteBoard.BringToFront(); } //listView1.Visible = false; lblINfo.Visible = false; btnShare.Visible = true; btnShare.BringToFront(); btnLog.Visible = true; btnLog.BringToFront(); } } catch(Exception ex) { WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Module ::: AppShare public void LaunchProcess(int winHandle)",ex,"",false); } }
public void ClearIt() { try { DrawingClearMessage msg = new DrawingClearMessage(sessionID); msg.m_ControlType = ControlType.Browser; msg.SenderID = NetworkManager.getInstance().profile.ClientId; msg.senderProfile = NetworkManager.getInstance().profile; NetworkManager.getInstance().SendLoadPacket(msg); if(NetworkManager.getInstance().profile.clientType == ClientType.ClientHost) annotationBrowser.ClearItems(true,0); else annotationBrowser.ClearItems(false,NetworkManager.getInstance().profile.ClientId); Refresh(); } catch(Exception ex) { WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Module ::: Websharing public void ClearIt()",ex,"",false); } }
public void desktopSharingAtClientUI() { try { System.Diagnostics.Process pP = System.Diagnostics.Process.GetCurrentProcess(); System.Diagnostics.Process pProcess = System.Diagnostics.Process.GetProcessById(pP.Id); if(pProcess != null) { DrawingClearMessage msg = new DrawingClearMessage(0); msg.m_ControlType = ControlType.ApplicationSharing; msg.SenderID = NetworkManager.thisInstance.profile.ClientId; msg.senderProfile = NetworkManager.thisInstance.profile; NetworkManager.thisInstance.SendLoadPacket(msg); //this.whiteBoard.Clear(true,0); sendingThread = new Thread(new ThreadStart(SendingFunction)); sendingThread.Name = "Desktop Sharing Sending Thread"; sendingThread.Start(); pProcess.PriorityBoostEnabled = true; // by kamran appServer.SetCaptureWindowAndStartCapturing(pProcess.MainWindowHandle); // we have to open one time more } if(isDesktopSharing) pictureBox1.Visible = true; else { whiteBoard.Visible = false; // to stop annotation kamran whiteBoard.BringToFront(); } //listView1.Visible = false; lblINfo.Visible = false; } catch(Exception ex) { WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Module ::: AppShare public void desktopSharingAtClientUI()",ex,"",false); } }
/*clear all graphics before displaying new image of appshare.*/ public void OptimizeAppShareClear() { DrawingClearMessage msg = new DrawingClearMessage(0); msg.m_ControlType = ControlType.DrawingBoard; msg.SenderID = -1; msg.senderProfile = NetworkManager.getInstance().profile; //network.SendLoadPacket(msg); lock(this.sendingArrayList) { this.sendingArrayList.Add(msg); } eventStore.Clear(); undoArray.Clear(); // if(g!=null) // g.Clear(Color.White); }