/[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 1082 by ossman_, Thu Mar 9 16:27:59 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 69  wndproc_hook_proc(int code, WPARAM cur_t Line 85  wndproc_hook_proc(int code, WPARAM cur_t
85    
86          style = GetWindowLong(hwnd, GWL_STYLE);          style = GetWindowLong(hwnd, GWL_STYLE);
87    
88          if (style & WS_CHILD)          /* Docs say that WS_CHILD and WS_POPUP is an illegal combination,
89               but they exist nonetheless. */
90            if ((style & WS_CHILD) && !(style & WS_POPUP))
91                  goto end;                  goto end;
92    
93          switch (msg)          switch (msg)
# Line 77  wndproc_hook_proc(int code, WPARAM cur_t Line 95  wndproc_hook_proc(int code, WPARAM cur_t
95    
96                  case WM_WINDOWPOSCHANGED:                  case WM_WINDOWPOSCHANGED:
97                          {                          {
                                 RECT rect;  
98                                  WINDOWPOS *wp = (WINDOWPOS *) lparam;                                  WINDOWPOS *wp = (WINDOWPOS *) lparam;
99    
100                                  if (wp->flags & SWP_SHOWWINDOW)                                  if (wp->flags & SWP_SHOWWINDOW)
# Line 88  wndproc_hook_proc(int code, WPARAM cur_t Line 105  wndproc_hook_proc(int code, WPARAM cur_t
105    
106                                          // FIXME: SETSTATE                                          // FIXME: SETSTATE
107    
108                                          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);  
109                                  }                                  }
110    
111                                  if (wp->flags & SWP_HIDEWINDOW)                                  if (wp->flags & SWP_HIDEWINDOW)
# Line 107  wndproc_hook_proc(int code, WPARAM cur_t Line 115  wndproc_hook_proc(int code, WPARAM cur_t
115                                          break;                                          break;
116    
117                                  if (!(wp->flags & SWP_NOMOVE && wp->flags & SWP_NOSIZE))                                  if (!(wp->flags & SWP_NOMOVE && wp->flags & SWP_NOSIZE))
118                                  {                                          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);  
                                 }  
119    
120                                  if (!(wp->flags & SWP_NOZORDER))                                  if (!(wp->flags & SWP_NOZORDER))
121                                  {                                  {
# Line 132  wndproc_hook_proc(int code, WPARAM cur_t Line 128  wndproc_hook_proc(int code, WPARAM cur_t
128                                  break;                                  break;
129                          }                          }
130    
131                    case WM_SIZE:
132                            update_position(hwnd);
133                            break;
134    
135                    case WM_MOVE:
136                            update_position(hwnd);
137                            break;
138    
139                  case WM_DESTROY:                  case WM_DESTROY:
140                          vchannel_write("DESTROY1,0x%p,0x%x", hwnd, 0);                          vchannel_write("DESTROY1,0x%p,0x%x", hwnd, 0);
141                          break;                          break;

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

  ViewVC Help
Powered by ViewVC 1.1.26