CVS: seamlessrdp/ServerExe/HookDll hookdll.c,1.3,1.4
Pierre Ossman <[email protected]>
| Newsgroups | gmane.network.rdesktop.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5037/ServerExe/HookDll
Modified Files:
hookdll.c
Log Message:
More cleanup and reorganisation.
Index: hookdll.c
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll/hookdll.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** hookdll.c 9 Mar 2006 12:26:31 -0000 1.3
--- hookdll.c 9 Mar 2006 15:48:55 -0000 1.4
***************
*** 53,83 ****
wndproc_hook_proc(int code, WPARAM cur_thread, LPARAM details)
{
! HWND hwnd = ((CWPSTRUCT *) details)->hwnd;
! UINT msg = ((CWPSTRUCT *) details)->message;
! WPARAM wparam = ((CWPSTRUCT *) details)->wParam;
! LPARAM lparam = ((CWPSTRUCT *) details)->lParam;
! LONG style = GetWindowLong(hwnd, GWL_STYLE);
! WINDOWPOS *wp = (WINDOWPOS *) lparam;
! RECT rect;
if (code < 0)
goto end;
switch (msg)
{
case WM_WINDOWPOSCHANGED:
! if (style & WS_CHILD)
! break;
! if (wp->flags & SWP_SHOWWINDOW)
! {
! // FIXME: Now, just like create!
! debug("SWP_SHOWWINDOW for %p!", hwnd);
! vchannel_write("CREATE1,0x%p,0x%x", hwnd, 0);
! // FIXME: SETSTATE
if (!GetWindowRect(hwnd, &rect))
--- 53,112 ----
wndproc_hook_proc(int code, WPARAM cur_thread, LPARAM details)
{
! HWND hwnd;
! UINT msg;
! WPARAM wparam;
! LPARAM lparam;
! LONG style;
if (code < 0)
goto end;
+ hwnd = ((CWPSTRUCT *) details)->hwnd;
+ msg = ((CWPSTRUCT *) details)->message;
+ wparam = ((CWPSTRUCT *) details)->wParam;
+ lparam = ((CWPSTRUCT *) details)->lParam;
+
+ style = GetWindowLong(hwnd, GWL_STYLE);
+
+ if (style & WS_CHILD)
+ goto end;
+
switch (msg)
{
case WM_WINDOWPOSCHANGED:
! {
! RECT rect;
! WINDOWPOS *wp = (WINDOWPOS *) lparam;
+ if (wp->flags & SWP_SHOWWINDOW)
+ {
+ // FIXME: Now, just like create!
+ debug("SWP_SHOWWINDOW for %p!", hwnd);
+ vchannel_write("CREATE1,0x%p,0x%x", hwnd, 0);
! // FIXME: SETSTATE
! 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);
! }
!
! if (wp->flags & SWP_HIDEWINDOW)
! vchannel_write("DESTROY1,0x%p,0x%x", hwnd, 0);
!
! if (!(style & WS_VISIBLE))
! break;
!
! if (wp->flags & SWP_NOMOVE && wp->flags & SWP_NOSIZE)
! break;
if (!GetWindowRect(hwnd, &rect))
***************
*** 86,155 ****
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);
- }
-
-
- if (wp->flags & SWP_HIDEWINDOW)
- vchannel_write("DESTROY1,0x%p,0x%x", hwnd, 0);
-
- if (!(style & WS_VISIBLE))
- break;
-
- if (wp->flags & SWP_NOMOVE && wp->flags & SWP_NOSIZE)
- break;
-
- 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);
-
- break;
-
-
- /* Note: WM_WINDOWPOSCHANGING/WM_WINDOWPOSCHANGED are
- strange. Sometimes, for example when bringing up the
- Notepad About dialog, only an WM_WINDOWPOSCHANGING is
- sent. In some other cases, for exmaple when opening
- Format->Text in Notepad, both events are sent. Also, for
- some reason, when closing the Notepad About dialog, an
- WM_WINDOWPOSCHANGING event is sent which looks just like
- the event that was sent when the About dialog was opened... */
case WM_WINDOWPOSCHANGING:
! if (style & WS_CHILD)
! break;
!
! if (!(style & WS_VISIBLE))
! break;
!
! if (!(wp->flags & SWP_NOZORDER))
! vchannel_write("ZCHANGE1,0x%p,0x%p,0x%x",
! hwnd,
! wp->flags & SWP_NOACTIVATE ? wp->hwndInsertAfter : 0,
! 0);
!
! break;
!
- case WM_DESTROY:
- if (style & WS_CHILD)
break;
vchannel_write("DESTROY1,0x%p,0x%x", hwnd, 0);
-
break;
-
default:
break;
--- 115,147 ----
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);
break;
}
case WM_WINDOWPOSCHANGING:
! {
! WINDOWPOS *wp = (WINDOWPOS *) lparam;
+ if (!(style & WS_VISIBLE))
+ break;
+ if (!(wp->flags & SWP_NOZORDER))
+ vchannel_write("ZCHANGE1,0x%p,0x%p,0x%x",
+ hwnd,
+ wp->flags & SWP_NOACTIVATE ? wp->
+ hwndInsertAfter : 0, 0);
break;
+ }
+ case WM_DESTROY:
vchannel_write("DESTROY1,0x%p,0x%x", hwnd, 0);
break;
default:
break;
***************
*** 172,176 ****
case HCBT_MINMAX:
{
! int show;
show = LOWORD(lparam);
--- 164,168 ----
case HCBT_MINMAX:
{
! int show, state;
show = LOWORD(lparam);
***************
*** 188,193 ****
/* FIXME: Strip title of dangerous characters */
vchannel_write("SETSTATE1,0x%p,%s,0x%x,0x%x",
! (HWND) wparam, title, show, 0);
break;
}
--- 180,191 ----
/* FIXME: Strip title of dangerous characters */
+ if (show == SW_SHOWNORMAL)
+ state = 0;
+ else if (show == SW_SHOWMINIMIZED)
+ state = 1;
+ else if (show == SW_SHOWMAXIMIZED)
+ state = 2;
vchannel_write("SETSTATE1,0x%p,%s,0x%x,0x%x",
! (HWND) wparam, title, state, 0);
break;
}
-------------------------------------------------------
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