/[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 1177 by ossman_, Tue Mar 21 14:42:25 2006 UTC revision 1179 by ossman_, Tue Mar 21 14:58:29 2006 UTC
# Line 143  update_zorder(HWND hwnd) Line 143  update_zorder(HWND hwnd)
143          vchannel_unblock();          vchannel_unblock();
144  }  }
145    
146    static HWND
147    get_parent(HWND hwnd)
148    {
149            LONG style;
150            HWND parent;
151    
152            style = GetWindowLong(hwnd, GWL_STYLE);
153    
154            if (style & (WS_POPUP | DS_MODALFRAME))
155            {
156                    parent = (HWND) GetWindowLong(hwnd, GWL_HWNDPARENT);
157    
158                    if (parent)
159                    {
160                            style = GetWindowLong(parent, GWL_STYLE);
161                            if (((style & WS_CHILD) && !(style & WS_POPUP)) || !(style & WS_VISIBLE))
162                                    parent = NULL;
163                    }
164    
165                    if (!parent)
166                            parent = GetWindow(hwnd, GW_OWNER);
167    
168                    if (parent)
169                    {
170                            style = GetWindowLong(parent, GWL_STYLE);
171                            if (((style & WS_CHILD) && !(style & WS_POPUP)) || !(style & WS_VISIBLE))
172                                    parent = NULL;
173                    }
174    
175                    if (!parent)
176                            parent = (HWND) - 1;
177            }
178            else
179                    parent = NULL;
180    
181            return parent;
182    }
183    
184  static LRESULT CALLBACK  static LRESULT CALLBACK
185  wndproc_hook_proc(int code, WPARAM cur_thread, LPARAM details)  wndproc_hook_proc(int code, WPARAM cur_thread, LPARAM details)
186  {  {
# Line 168  wndproc_hook_proc(int code, WPARAM cur_t Line 206  wndproc_hook_proc(int code, WPARAM cur_t
206          if ((style & WS_CHILD) && !(style & WS_POPUP))          if ((style & WS_CHILD) && !(style & WS_POPUP))
207                  goto end;                  goto end;
208    
209          if (style & WS_POPUP)          parent = get_parent(hwnd);
         {  
                 parent = (HWND) GetWindowLong(hwnd, GWL_HWNDPARENT);  
                 if (!parent)  
                         parent = (HWND) - 1;  
         }  
         else  
                 parent = NULL;  
210    
211          switch (msg)          switch (msg)
212          {          {
# Line 280  wndprocret_hook_proc(int code, WPARAM cu Line 311  wndprocret_hook_proc(int code, WPARAM cu
311          if ((style & WS_CHILD) && !(style & WS_POPUP))          if ((style & WS_CHILD) && !(style & WS_POPUP))
312                  goto end;                  goto end;
313    
314          if (style & WS_POPUP)          parent = get_parent(hwnd);
         {  
                 parent = (HWND) GetWindowLong(hwnd, GWL_HWNDPARENT);  
                 if (!parent)  
                         parent = (HWND) - 1;  
         }  
         else  
                 parent = NULL;  
315    
316          switch (msg)          switch (msg)
317          {          {

Legend:
Removed from v.1177  
changed lines
  Added in v.1179

  ViewVC Help
Powered by ViewVC 1.1.26