/[rdesktop]/sourceforge.net/trunk/seamlessrdp/ServerExe/main.cpp
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/seamlessrdp/ServerExe/main.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 936 by astrand, Thu Jun 30 14:46:14 2005 UTC revision 937 by astrand, Fri Jul 1 06:50:52 2005 UTC
# Line 114  void DoContextMenu() Line 114  void DoContextMenu()
114      DeleteObject(hMenu);      DeleteObject(hMenu);
115    
116      switch (cmd) {      switch (cmd) {
117      case ID_WMEXIT:      case ID_WMEXIT: {
         {  
118              PostQuitMessage(0);              PostQuitMessage(0);
119              break;              break;
120          }          }
121      case ID_WMABOUT:      case ID_WMABOUT: {
         {  
122              AboutDlg();              AboutDlg();
123              break;              break;
124          }          }
# Line 133  void DoContextMenu() Line 131  void DoContextMenu()
131  LONG WINAPI MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)  LONG WINAPI MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
132  {  {
133      switch (uMsg) {      switch (uMsg) {
134      case WM_DESTROY:      case WM_DESTROY: {
         {  
135              PostQuitMessage(0);              PostQuitMessage(0);
136              return 0;              return 0;
137          }          }
138      case WM_TRAY_NOTIFY:      case WM_TRAY_NOTIFY: {
         {  
139              if (lParam == WM_RBUTTONDOWN)              if (lParam == WM_RBUTTONDOWN)
140                  DoContextMenu();                  DoContextMenu();
141              return 0;              return 0;
# Line 172  bool InitWindow() Line 168  bool InitWindow()
168          return false;          return false;
169      }      }
170    
171      // create the frame      // create the frame
172      ghWnd = CreateWindow(szAppName, szAppName,      ghWnd = CreateWindow(szAppName, szAppName,
173                           WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS |                           WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS |
174                           WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, 640,                           WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, 640,
# Line 195  bool Init(LPSTR lpCmdLine) Line 191  bool Init(LPSTR lpCmdLine)
191      // try to load WTSWinClipper.dll      // try to load WTSWinClipper.dll
192      if (!WTSWinClipper::Init()) {      if (!WTSWinClipper::Init()) {
193          Message          Message
194              ("Application not installed correctly: Unable to init hookdll.dll.");          ("Application not installed correctly: Unable to init hookdll.dll.");
195          return false;          return false;
196      }      }
197    
# Line 204  bool Init(LPSTR lpCmdLine) Line 200  bool Init(LPSTR lpCmdLine)
200          // hook in          // hook in
201          WTSWinClipper::SetCbtHook();          WTSWinClipper::SetCbtHook();
202          return true;          return true;
203      }      } else {
     else {  
204          // already hooked          // already hooked
205          return false;          return false;
206      }      }
207  }  }
208    
209  //  //
210  // our main loop  // our main loop
211  //  //
212  int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,  int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
# Line 229  int WINAPI WinMain(HINSTANCE hInstance, Line 224  int WINAPI WinMain(HINSTANCE hInstance,
224          // shell. We do this by calling SystemParametersInfo. If we don't do this, we won't get the WH_SHELL notifications.          // shell. We do this by calling SystemParametersInfo. If we don't do this, we won't get the WH_SHELL notifications.
225    
226          // From MSDN:          // From MSDN:
227          // Note that custom shell applications do not receive WH_SHELL messages. Therefore, any application that          // Note that custom shell applications do not receive WH_SHELL messages. Therefore, any application that
228          // registers itself as the default shell must call the SystemParametersInfo function with SPI_SETMINIMIZEDMETRICS          // registers itself as the default shell must call the SystemParametersInfo function with SPI_SETMINIMIZEDMETRICS
229          // before it (or any other application) can receive WH_SHELL messages.          // before it (or any other application) can receive WH_SHELL messages.
230    
231          MINIMIZEDMETRICS mmm;          MINIMIZEDMETRICS mmm;
# Line 255  int WINAPI WinMain(HINSTANCE hInstance, Line 250  int WINAPI WinMain(HINSTANCE hInstance,
250                            &startupInfo, &procInfo);                            &startupInfo, &procInfo);
251    
252          if (m_create != false) {          if (m_create != false) {
253              // A loop to watch the process.              // A loop to watch the process.
254              GetExitCodeProcess(procInfo.hProcess, &dwExitCode);              GetExitCodeProcess(procInfo.hProcess, &dwExitCode);
255    
256              while (dwExitCode == STILL_ACTIVE) {              while (dwExitCode == STILL_ACTIVE) {
# Line 266  int WINAPI WinMain(HINSTANCE hInstance, Line 261  int WINAPI WinMain(HINSTANCE hInstance,
261              // Release handles              // Release handles
262              CloseHandle(procInfo.hProcess);              CloseHandle(procInfo.hProcess);
263              CloseHandle(procInfo.hThread);              CloseHandle(procInfo.hThread);
264          }          } else {
         else {  
265              // CreateProcess failed.              // CreateProcess failed.
266              Message("Unable to launch the requested application");              Message("Unable to launch the requested application");
267          }          }
268      }      } else
     else  
269          // we are launching without an app, therefore we will show the system tray app and wait for the user to close it          // we are launching without an app, therefore we will show the system tray app and wait for the user to close it
270      {      {
271          // create a dummy window to receive WM_QUIT message          // create a dummy window to receive WM_QUIT message

Legend:
Removed from v.936  
changed lines
  Added in v.937

  ViewVC Help
Powered by ViewVC 1.1.26