/[rdesktop]/sourceforge.net/trunk/seamlessrdp/ServerExe/HookDll/hookdll.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/HookDll/hookdll.cpp

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

revision 1005 by astrand, Tue Aug 30 11:34:05 2005 UTC revision 1007 by astrand, Tue Aug 30 12:04:08 2005 UTC
# Line 147  LRESULT CALLBACK CallWndProc( int nCode, Line 147  LRESULT CALLBACK CallWndProc( int nCode,
147                    
148          case WM_CREATE:          case WM_CREATE:
149          if ( cs->style & WS_DLGFRAME ) {          if ( cs->style & WS_DLGFRAME ) {
150            
151              snprintf( result, sizeof( result ),              snprintf( result, sizeof( result ),
152                        "CREATE1,0x%p,0x%x\n",                        "CREATE1,0x%p,0x%x\n",
153                        details->hwnd, 0 );                        details->hwnd, 0 );
154              result[ sizeof( result ) - 1 ] = '\0';              result[ sizeof( result ) - 1 ] = '\0';
155              WriteToChannel( result );              WriteToChannel( result );
156                
157                snprintf( result, sizeof( result ),
158                          "SETSTATE1,0x%p,%s,0x%x,0x%x\n",
159                          details->hwnd,
160                          cs->lpszName,
161                          1,    // FIXME: Check for WS_MAXIMIZE/WS_MINIMIZE
162                          0 );
163                result[ sizeof( result ) - 1 ] = '\0';
164                WriteToChannel( result );
165                
166                snprintf( result, sizeof( result ),
167                          "POSITION1,0x%p,%d,%d,%d,%d,0x%x",
168                          details->hwnd,
169                          cs->x,
170                          cs->y,
171                          cs->cx,
172                          cs->cy,
173                          0 );
174                result[ sizeof( result ) - 1 ] = '\0';
175                WriteToChannel( result );
176                
177          }          }
178          break;          break;
179                    
# Line 333  LRESULT CALLBACK ShellProc( int nCode, W Line 355  LRESULT CALLBACK ShellProc( int nCode, W
355      return CallNextHookEx( hhook, nCode, wParam, lParam );      return CallNextHookEx( hhook, nCode, wParam, lParam );
356  }  }
357    
358  DLL_EXPORT void SetCbtHook( void )  DLL_EXPORT void SetHooks( void )
359  {  {
360      if ( !bHooked ) {      if ( !bHooked ) {
361          hhook = SetWindowsHookEx( WH_CBT, ( HOOKPROC ) CbtProc, hInst, ( DWORD ) NULL );          hhook = SetWindowsHookEx( WH_CBT, ( HOOKPROC ) CbtProc, hInst, ( DWORD ) NULL );
362          bHooked = true;          bHooked = true;
363      }      }
364            
365    #if 0
366      if ( !bHooked2 ) {      if ( !bHooked2 ) {
367          hhook2 = SetWindowsHookEx( WH_SHELL, ( HOOKPROC ) ShellProc, hInst, ( DWORD ) NULL );          hhook2 = SetWindowsHookEx( WH_SHELL, ( HOOKPROC ) ShellProc, hInst, ( DWORD ) NULL );
368          bHooked2 = true;          bHooked2 = true;
369      }      }
370    #endif
371            
372      if ( !bHooked3 ) {      if ( !bHooked3 ) {
373          hhook3 = SetWindowsHookEx( WH_CALLWNDPROC, ( HOOKPROC ) CallWndProc, hInst, ( DWORD ) NULL );          hhook3 = SetWindowsHookEx( WH_CALLWNDPROC, ( HOOKPROC ) CallWndProc, hInst, ( DWORD ) NULL );
# Line 351  DLL_EXPORT void SetCbtHook( void ) Line 375  DLL_EXPORT void SetCbtHook( void )
375      }      }
376  }  }
377    
378  DLL_EXPORT void RemoveCbtHook( void )  DLL_EXPORT void RemoveHooks( void )
379  {  {
380      if ( bHooked ) {      if ( bHooked ) {
381          UnhookWindowsHookEx( hhook );          UnhookWindowsHookEx( hhook );

Legend:
Removed from v.1005  
changed lines
  Added in v.1007

  ViewVC Help
Powered by ViewVC 1.1.26