CVS: seamlessrdp/ServerExe main.cpp,1.11,1.12

Pierre Ossman <[email protected]>
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/seamlessrdp/ServerExe
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5190

Modified Files:
	main.cpp 
Log Message:
Run indent-all on the server source.


Index: main.cpp
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/main.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** main.cpp	8 Mar 2006 09:30:21 -0000	1.11
--- main.cpp	8 Mar 2006 16:12:48 -0000	1.12
***************
*** 41,50 ****
      strcpy( nid.szTip, szAppName );
      nid.hIcon = ::LoadIcon( hAppInstance, MAKEINTRESOURCE( IDI_TRAY ) );
!     
      if ( Shell_NotifyIcon( NIM_ADD, &nid ) != TRUE ) {
          Message( "Unable to create tray icon." );
          return false;
      }
!     
      return true;
  }
--- 41,50 ----
      strcpy( nid.szTip, szAppName );
      nid.hIcon = ::LoadIcon( hAppInstance, MAKEINTRESOURCE( IDI_TRAY ) );
! 
      if ( Shell_NotifyIcon( NIM_ADD, &nid ) != TRUE ) {
          Message( "Unable to create tray icon." );
          return false;
      }
! 
      return true;
  }
***************
*** 59,65 ****
          return false;
      }
!     
      return true;
!     
  }
  
--- 59,65 ----
          return false;
      }
! 
      return true;
! 
  }
  
***************
*** 75,79 ****
              DestroyWindow( hwndDlg );
      }
!     
      return 0;
  }
--- 75,79 ----
              DestroyWindow( hwndDlg );
      }
! 
      return 0;
  }
***************
*** 94,98 ****
          return ;
      }
!     
      HMENU hSubMenu = GetSubMenu( hMenu, 0 );
      if ( hSubMenu == NULL ) {
--- 94,98 ----
          return ;
      }
! 
      HMENU hSubMenu = GetSubMenu( hMenu, 0 );
      if ( hSubMenu == NULL ) {
***************
*** 100,108 ****
          return ;
      }
!     
      // get the cursor position
      POINT pt;
      GetCursorPos( &pt );
!     
      SetForegroundWindow( ghWnd );
      int cmd = TrackPopupMenu( hSubMenu,
--- 100,108 ----
          return ;
      }
! 
      // get the cursor position
      POINT pt;
      GetCursorPos( &pt );
! 
      SetForegroundWindow( ghWnd );
      int cmd = TrackPopupMenu( hSubMenu,
***************
*** 110,120 ****
                                pt.x, pt.y, 0, ghWnd, NULL );
      DeleteObject( hMenu );
!     
      switch ( cmd ) {
!         case ID_WMEXIT: {
              PostQuitMessage( 0 );
              break;
          }
!         case ID_WMABOUT: {
              AboutDlg();
              break;
--- 110,120 ----
                                pt.x, pt.y, 0, ghWnd, NULL );
      DeleteObject( hMenu );
! 
      switch ( cmd ) {
!     case ID_WMEXIT: {
              PostQuitMessage( 0 );
              break;
          }
!     case ID_WMABOUT: {
              AboutDlg();
              break;
***************
*** 129,137 ****
  {
      switch ( uMsg ) {
!         case WM_DESTROY: {
              PostQuitMessage( 0 );
              return 0;
          }
!         case WM_TRAY_NOTIFY: {
              if ( lParam == WM_RBUTTONDOWN )
                  DoContextMenu();
--- 129,137 ----
  {
      switch ( uMsg ) {
!     case WM_DESTROY: {
              PostQuitMessage( 0 );
              return 0;
          }
!     case WM_TRAY_NOTIFY: {
              if ( lParam == WM_RBUTTONDOWN )
                  DoContextMenu();
***************
*** 139,143 ****
          }
      }
!     
      return DefWindowProc( hWnd, uMsg, wParam, lParam );
  }
--- 139,143 ----
          }
      }
! 
      return DefWindowProc( hWnd, uMsg, wParam, lParam );
  }
***************
*** 160,169 ****
      wndclass.lpszMenuName = NULL;
      wndclass.lpszClassName = szAppName;
!     
      if ( !RegisterClass( &wndclass ) ) {
          Message( "Unable to register the window class." );
          return false;
      }
!     
      // create the frame
      ghWnd = CreateWindow( szAppName, szAppName,
--- 160,169 ----
      wndclass.lpszMenuName = NULL;
      wndclass.lpszClassName = szAppName;
! 
      if ( !RegisterClass( &wndclass ) ) {
          Message( "Unable to register the window class." );
          return false;
      }
! 
      // create the frame
      ghWnd = CreateWindow( szAppName, szAppName,
***************
*** 171,175 ****
                            WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, 640,
                            480, NULL, NULL, hAppInstance, NULL );
!                           
      // make sure window was created
      if ( !ghWnd ) {
--- 171,175 ----
                            WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, 640,
                            480, NULL, NULL, hAppInstance, NULL );
! 
      // make sure window was created
      if ( !ghWnd ) {
***************
*** 177,181 ****
          return false;
      }
!     
      return true;
  }
--- 177,181 ----
          return false;
      }
! 
      return true;
  }
***************
*** 192,196 ****
          return false;
      }
!     
      // check number of instances
      if ( WTSWinClipper::GetInstanceCount() == 1 ) {
--- 192,196 ----
          return false;
      }
! 
      // check number of instances
      if ( WTSWinClipper::GetInstanceCount() == 1 ) {
***************
*** 214,218 ****
          return 0;
      }
!     
      // if we have been specified an app to launch, we will wait until the app has closed and use that for
      // our cue to exit
--- 214,218 ----
          return 0;
      }
! 
      // if we have been specified an app to launch, we will wait until the app has closed and use that for
      // our cue to exit
***************
*** 220,241 ****
          // Because we do not have a explorer.exe we need to make this application the replacement
          // shell. We do this by calling SystemParametersInfo. If we don't do this, we won't get the WH_SHELL notifications.
!         
          // From MSDN:
          // Note that custom shell applications do not receive WH_SHELL messages. Therefore, any application that
          // registers itself as the default shell must call the SystemParametersInfo function with SPI_SETMINIMIZEDMETRICS
          // before it (or any other application) can receive WH_SHELL messages.
!         
          MINIMIZEDMETRICS mmm;
          mmm.cbSize = sizeof( MINIMIZEDMETRICS );
          SystemParametersInfo( SPI_SETMINIMIZEDMETRICS,
                                sizeof( MINIMIZEDMETRICS ), &mmm, 0 );
!                               
          // We require DragFullWindows
          SystemParametersInfo( SPI_SETDRAGFULLWINDOWS, TRUE, NULL, 0 );
!         
          //set the current directory to that of the requested app .exe location
          //tokenise lpCmdLine. first is the exe path. second (if exists) is the current directory to set.
          //SetCurrentDirectory ();
!         
          //start process specified from command line arg.
          PROCESS_INFORMATION procInfo;
--- 220,241 ----
          // Because we do not have a explorer.exe we need to make this application the replacement
          // shell. We do this by calling SystemParametersInfo. If we don't do this, we won't get the WH_SHELL notifications.
! 
          // From MSDN:
          // Note that custom shell applications do not receive WH_SHELL messages. Therefore, any application that
          // registers itself as the default shell must call the SystemParametersInfo function with SPI_SETMINIMIZEDMETRICS
          // before it (or any other application) can receive WH_SHELL messages.
! 
          MINIMIZEDMETRICS mmm;
          mmm.cbSize = sizeof( MINIMIZEDMETRICS );
          SystemParametersInfo( SPI_SETMINIMIZEDMETRICS,
                                sizeof( MINIMIZEDMETRICS ), &mmm, 0 );
! 
          // We require DragFullWindows
          SystemParametersInfo( SPI_SETDRAGFULLWINDOWS, TRUE, NULL, 0 );
! 
          //set the current directory to that of the requested app .exe location
          //tokenise lpCmdLine. first is the exe path. second (if exists) is the current directory to set.
          //SetCurrentDirectory ();
! 
          //start process specified from command line arg.
          PROCESS_INFORMATION procInfo;
***************
*** 247,264 ****
          LPTSTR process = lpCmdLine;
          DWORD dwExitCode;
!         
          BOOL m_create =
              CreateProcess( NULL, process, NULL, NULL, FALSE, 0, NULL, NULL,
                             &startupInfo, &procInfo );
!                            
          if ( m_create != false ) {
              // A loop to watch the process.
              GetExitCodeProcess( procInfo.hProcess, &dwExitCode );
!             
              while ( dwExitCode == STILL_ACTIVE ) {
                  GetExitCodeProcess( procInfo.hProcess, &dwExitCode );
                  Sleep( 1000 );
              }
!             
              // Release handles
              CloseHandle( procInfo.hProcess );
--- 247,264 ----
          LPTSTR process = lpCmdLine;
          DWORD dwExitCode;
! 
          BOOL m_create =
              CreateProcess( NULL, process, NULL, NULL, FALSE, 0, NULL, NULL,
                             &startupInfo, &procInfo );
! 
          if ( m_create != false ) {
              // A loop to watch the process.
              GetExitCodeProcess( procInfo.hProcess, &dwExitCode );
! 
              while ( dwExitCode == STILL_ACTIVE ) {
                  GetExitCodeProcess( procInfo.hProcess, &dwExitCode );
                  Sleep( 1000 );
              }
! 
              // Release handles
              CloseHandle( procInfo.hProcess );
***************
*** 266,272 ****
          } else {
              // CreateProcess failed.
! 	    char msg[ 256 ];
! 	    snprintf( msg, sizeof( msg ), "Unable to launch the requested application:\n%s", process );
! 	    Message( msg );
          }
      } else
--- 266,272 ----
          } else {
              // CreateProcess failed.
!             char msg[ 256 ];
!             snprintf( msg, sizeof( msg ), "Unable to launch the requested application:\n%s", process );
!             Message( msg );
          }
      } else
***************
*** 275,282 ****
          // create a dummy window to receive WM_QUIT message
          InitWindow();
!         
          // create the tray icon
          InitTrayIcon();
!         
          // just get and dispatch messages until we're killed
          MSG msg;
--- 275,282 ----
          // create a dummy window to receive WM_QUIT message
          InitWindow();
! 
          // create the tray icon
          InitTrayIcon();
! 
          // just get and dispatch messages until we're killed
          MSG msg;
***************
*** 285,299 ****
              DispatchMessage( &msg );
          };
!         
          // remove our tray icon
          RemoveTrayIcon();
      }
!     
!     
      // remove hook before saying goodbye
      WTSWinClipper::RemoveHooks();
!     
      WTSWinClipper::Done();
!     
      return 1;
  }
--- 285,299 ----
              DispatchMessage( &msg );
          };
! 
          // remove our tray icon
          RemoveTrayIcon();
      }
! 
! 
      // remove hook before saying goodbye
      WTSWinClipper::RemoveHooks();
! 
      WTSWinClipper::Done();
! 
      return 1;
  }



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.