CVS: seamlessrdp/ServerExe/HookDll hookdll.c,1.5,1.6

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-serv20538/ServerExe/HookDll

Modified Files:
	hookdll.c 
Log Message:
Catch WM_MOVE and WM_SIZE.


Index: hookdll.c
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll/hookdll.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** hookdll.c	9 Mar 2006 15:57:10 -0000	1.5
--- hookdll.c	9 Mar 2006 16:13:26 -0000	1.6
***************
*** 50,53 ****
--- 50,69 ----
  static HANDLE g_mutex = NULL;
  
+ static void
+ update_position(HWND hwnd)
+ {
+ 	RECT rect;
+ 
+ 	if (!GetWindowRect(hwnd, &rect))
+ 	{
+ 		debug("GetWindowRect failed!\n");
+ 		return;
+ 	}
+ 
+ 	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);
+ }
+ 
  static LRESULT CALLBACK
  wndproc_hook_proc(int code, WPARAM cur_thread, LPARAM details)
***************
*** 78,82 ****
  		case WM_WINDOWPOSCHANGED:
  			{
- 				RECT rect;
  				WINDOWPOS *wp = (WINDOWPOS *) lparam;
  
--- 94,97 ----
***************
*** 89,102 ****
  					// 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);
  				}
  
--- 104,108 ----
  					// FIXME: SETSTATE
  
! 					update_position(hwnd);
  				}
  
***************
*** 108,124 ****
  
  				if (!(wp->flags & SWP_NOMOVE && wp->flags & SWP_NOSIZE))
! 				{
! 					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_NOZORDER))
--- 114,118 ----
  
  				if (!(wp->flags & SWP_NOMOVE && wp->flags & SWP_NOSIZE))
! 					update_position(hwnd);
  
  				if (!(wp->flags & SWP_NOZORDER))
***************
*** 133,136 ****
--- 127,138 ----
  			}
  
+ 		case WM_SIZE:
+ 			update_position(hwnd);
+ 			break;
+ 
+ 		case WM_MOVE:
+ 			update_position(hwnd);
+ 			break;
+ 
  		case WM_DESTROY:
  			vchannel_write("DESTROY1,0x%p,0x%x", hwnd, 0);



-------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.