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

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

revision 1080 by ossman_, Thu Mar 9 15:57:10 2006 UTC revision 1081 by ossman_, Thu Mar 9 16:13:26 2006 UTC
# Line 49  static HINSTANCE g_instance = NULL; Line 49  static HINSTANCE g_instance = NULL;
49    
50  static HANDLE g_mutex = NULL;  static HANDLE g_mutex = NULL;
51    
52    static void
53    update_position(HWND hwnd)
54    {
55            RECT rect;
56    
57            if (!GetWindowRect(hwnd, &rect))
58            {
59                    debug("GetWindowRect failed!\n");
60                    return;
61            }
62    
63            vchannel_write("POSITION1,0x%p,%d,%d,%d,%d,0x%x",
64                           hwnd,
65                           rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, 0);
66    }
67    
68  static LRESULT CALLBACK  static LRESULT CALLBACK
69  wndproc_hook_proc(int code, WPARAM cur_thread, LPARAM details)  wndproc_hook_proc(int code, WPARAM cur_thread, LPARAM details)
70  {  {
# Line 77  wndproc_hook_proc(int code, WPARAM cur_t Line 93  wndproc_hook_proc(int code, WPARAM cur_t
93    
94                  case WM_WINDOWPOSCHANGED:                  case WM_WINDOWPOSCHANGED:
95                          {                          {
                                 RECT rect;  
96                                  WINDOWPOS *wp = (WINDOWPOS *) lparam;                                  WINDOWPOS *wp = (WINDOWPOS *) lparam;
97    
98                                  if (wp->flags & SWP_SHOWWINDOW)                                  if (wp->flags & SWP_SHOWWINDOW)
# Line 88  wndproc_hook_proc(int code, WPARAM cur_t Line 103  wndproc_hook_proc(int code, WPARAM cur_t
103    
104                                          // FIXME: SETSTATE                                          // FIXME: SETSTATE
105    
106                                          if (!GetWindowRect(hwnd, &rect))                                          update_position(hwnd);
                                         {  
                                                 debug("GetWindowRect failed!\n");  
                                                 break;  
                                         }  
                                         vchannel_write("POSITION1,0x%p,%d,%d,%d,%d,0x%x",  
                                                        hwnd,  
                                                        rect.left, rect.top,  
                                                        rect.right - rect.left,  
                                                        rect.bottom - rect.top, 0);  
107                                  }                                  }
108    
109                                  if (wp->flags & SWP_HIDEWINDOW)                                  if (wp->flags & SWP_HIDEWINDOW)
# Line 107  wndproc_hook_proc(int code, WPARAM cur_t Line 113  wndproc_hook_proc(int code, WPARAM cur_t
113                                          break;                                          break;
114    
115                                  if (!(wp->flags & SWP_NOMOVE && wp->flags & SWP_NOSIZE))                                  if (!(wp->flags & SWP_NOMOVE && wp->flags & SWP_NOSIZE))
116                                  {                                          update_position(hwnd);
                                         if (!GetWindowRect(hwnd, &rect))  
                                         {  
                                                 debug("GetWindowRect failed!\n");  
                                                 break;  
                                         }  
   
                                         vchannel_write("POSITION1,0x%p,%d,%d,%d,%d,0x%x",  
                                                        hwnd,  
                                                        rect.left, rect.top,  
                                                        rect.right - rect.left,  
                                                        rect.bottom - rect.top, 0);  
                                 }  
117    
118                                  if (!(wp->flags & SWP_NOZORDER))                                  if (!(wp->flags & SWP_NOZORDER))
119                                  {                                  {
# Line 132  wndproc_hook_proc(int code, WPARAM cur_t Line 126  wndproc_hook_proc(int code, WPARAM cur_t
126                                  break;                                  break;
127                          }                          }
128    
129                    case WM_SIZE:
130                            update_position(hwnd);
131                            break;
132    
133                    case WM_MOVE:
134                            update_position(hwnd);
135                            break;
136    
137                  case WM_DESTROY:                  case WM_DESTROY:
138                          vchannel_write("DESTROY1,0x%p,0x%x", hwnd, 0);                          vchannel_write("DESTROY1,0x%p,0x%x", hwnd, 0);
139                          break;                          break;

Legend:
Removed from v.1080  
changed lines
  Added in v.1081

  ViewVC Help
Powered by ViewVC 1.1.26