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 |
{ |
{ |
71 |
HWND hwnd; |
HWND hwnd, parent; |
72 |
UINT msg; |
UINT msg; |
73 |
WPARAM wparam; |
WPARAM wparam; |
74 |
LPARAM lparam; |
LPARAM lparam; |
90 |
if ((style & WS_CHILD) && !(style & WS_POPUP)) |
if ((style & WS_CHILD) && !(style & WS_POPUP)) |
91 |
goto end; |
goto end; |
92 |
|
|
93 |
|
if (style & WS_POPUP) |
94 |
|
parent = (HWND) GetWindowLong(hwnd, GWL_HWNDPARENT); |
95 |
|
else |
96 |
|
parent = NULL; |
97 |
|
|
98 |
switch (msg) |
switch (msg) |
99 |
{ |
{ |
100 |
|
|
106 |
{ |
{ |
107 |
// FIXME: Now, just like create! |
// FIXME: Now, just like create! |
108 |
debug("SWP_SHOWWINDOW for %p!", hwnd); |
debug("SWP_SHOWWINDOW for %p!", hwnd); |
109 |
vchannel_write("CREATE,0x%p,0x%x", hwnd, 0); |
vchannel_write("CREATE,0x%p,0x%p,0x%x", hwnd, parent, 0); |
110 |
|
|
111 |
// FIXME: SETSTATE |
// FIXME: SETSTATE |
112 |
|
|
162 |
static LRESULT CALLBACK |
static LRESULT CALLBACK |
163 |
cbt_hook_proc(int code, WPARAM wparam, LPARAM lparam) |
cbt_hook_proc(int code, WPARAM wparam, LPARAM lparam) |
164 |
{ |
{ |
|
char title[150]; |
|
|
|
|
165 |
if (code < 0) |
if (code < 0) |
166 |
goto end; |
goto end; |
167 |
|
|
173 |
|
|
174 |
show = LOWORD(lparam); |
show = LOWORD(lparam); |
175 |
|
|
|
if ((show == SW_SHOWMINIMIZED) || (show == SW_MINIMIZE)) |
|
|
{ |
|
|
MessageBox(0, |
|
|
"Minimizing windows is not allowed in this version. Sorry!", |
|
|
"SeamlessRDP", MB_OK); |
|
|
return 1; |
|
|
} |
|
|
|
|
|
GetWindowText((HWND) wparam, title, sizeof(title)); |
|
|
|
|
|
/* FIXME: Strip title of dangerous characters */ |
|
|
|
|
176 |
if (show == SW_SHOWNORMAL) |
if (show == SW_SHOWNORMAL) |
177 |
state = 0; |
state = 0; |
178 |
else if (show == SW_SHOWMINIMIZED) |
else if (show == SW_SHOWMINIMIZED) |
179 |
state = 1; |
state = 1; |
180 |
else if (show == SW_SHOWMAXIMIZED) |
else if (show == SW_SHOWMAXIMIZED) |
181 |
state = 2; |
state = 2; |
182 |
vchannel_write("SETSTATE,0x%p,%s,0x%x,0x%x", |
vchannel_write("STATE,0x%p,0x%x,0x%x", (HWND) wparam, state, 0); |
|
(HWND) wparam, title, state, 0); |
|
183 |
break; |
break; |
184 |
} |
} |
185 |
|
|