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 |
{ |
{ |
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) |
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) |
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 |
{ |
{ |
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; |