91 |
goto end; |
goto end; |
92 |
|
|
93 |
if (style & WS_POPUP) |
if (style & WS_POPUP) |
94 |
|
{ |
95 |
parent = (HWND) GetWindowLong(hwnd, GWL_HWNDPARENT); |
parent = (HWND) GetWindowLong(hwnd, GWL_HWNDPARENT); |
96 |
|
if (!parent) |
97 |
|
parent = (HWND) - 1; |
98 |
|
} |
99 |
else |
else |
100 |
parent = NULL; |
parent = NULL; |
101 |
|
|
108 |
|
|
109 |
if (wp->flags & SWP_SHOWWINDOW) |
if (wp->flags & SWP_SHOWWINDOW) |
110 |
{ |
{ |
111 |
// FIXME: Now, just like create! |
char title[150]; |
112 |
debug("SWP_SHOWWINDOW for %p!", hwnd); |
int state; |
113 |
|
|
114 |
vchannel_write("CREATE,0x%p,0x%p,0x%x", hwnd, parent, 0); |
vchannel_write("CREATE,0x%p,0x%p,0x%x", hwnd, parent, 0); |
115 |
|
|
116 |
// FIXME: SETSTATE |
GetWindowText(hwnd, title, sizeof(title)); |
117 |
|
|
118 |
|
/* FIXME: Strip title of dangerous characters */ |
119 |
|
|
120 |
|
vchannel_write("TITLE,0x%x,%s,0x%x", hwnd, title, 0); |
121 |
|
|
122 |
|
if (style & WS_MAXIMIZE) |
123 |
|
state = 2; |
124 |
|
else if (style & WS_MINIMIZE) |
125 |
|
state = 1; |
126 |
|
else |
127 |
|
state = 0; |
128 |
|
|
129 |
|
vchannel_write("STATE,0x%p,0x%x,0x%x", hwnd, state, 0); |
130 |
|
|
131 |
update_position(hwnd); |
update_position(hwnd); |
132 |
|
|
133 |
|
/* FIXME: Figure out z order */ |
134 |
} |
} |
135 |
|
|
136 |
if (wp->flags & SWP_HIDEWINDOW) |
if (wp->flags & SWP_HIDEWINDOW) |
137 |
vchannel_write("DESTROY,0x%p,0x%x", hwnd, 0); |
vchannel_write("DESTROY,0x%p,0x%x", hwnd, 0); |
138 |
|
|
139 |
if (!(style & WS_VISIBLE)) |
if (!(style & WS_VISIBLE) || (style & WS_MINIMIZE)) |
140 |
break; |
break; |
141 |
|
|
142 |
if (!(wp->flags & SWP_NOMOVE && wp->flags & SWP_NOSIZE)) |
if (!(wp->flags & SWP_NOMOVE && wp->flags & SWP_NOSIZE)) |
154 |
} |
} |
155 |
|
|
156 |
case WM_SIZE: |
case WM_SIZE: |
157 |
if (!(style & WS_VISIBLE)) |
if (!(style & WS_VISIBLE) || (style & WS_MINIMIZE)) |
158 |
break; |
break; |
159 |
update_position(hwnd); |
update_position(hwnd); |
160 |
break; |
break; |
161 |
|
|
162 |
case WM_MOVE: |
case WM_MOVE: |
163 |
if (!(style & WS_VISIBLE)) |
if (!(style & WS_VISIBLE) || (style & WS_MINIMIZE)) |
164 |
break; |
break; |
165 |
update_position(hwnd); |
update_position(hwnd); |
166 |
break; |
break; |
167 |
|
|
168 |
|
case WM_SETTEXT: |
169 |
|
if (!(style & WS_VISIBLE)) |
170 |
|
break; |
171 |
|
/* FIXME: Strip title of dangerous characters */ |
172 |
|
vchannel_write("TITLE,0x%p,%s,0x%x", hwnd, (char *) lparam, 0); |
173 |
|
break; |
174 |
|
|
175 |
case WM_DESTROY: |
case WM_DESTROY: |
176 |
if (!(style & WS_VISIBLE)) |
if (!(style & WS_VISIBLE)) |
177 |
break; |
break; |
200 |
|
|
201 |
show = LOWORD(lparam); |
show = LOWORD(lparam); |
202 |
|
|
203 |
if (show == SW_SHOWNORMAL) |
if ((show == SW_NORMAL) || (show == SW_SHOWNORMAL)) |
204 |
state = 0; |
state = 0; |
205 |
else if (show == SW_SHOWMINIMIZED) |
else if ((show == SW_MINIMIZE) || (show == SW_SHOWMINIMIZED)) |
206 |
state = 1; |
state = 1; |
207 |
else if (show == SW_SHOWMAXIMIZED) |
else if ((show == SW_MAXIMIZE) || (show == SW_SHOWMAXIMIZED)) |
208 |
state = 2; |
state = 2; |
209 |
|
else |
210 |
|
{ |
211 |
|
debug("Unexpected show: %d", show); |
212 |
|
break; |
213 |
|
} |
214 |
vchannel_write("STATE,0x%p,0x%x,0x%x", (HWND) wparam, state, 0); |
vchannel_write("STATE,0x%p,0x%x,0x%x", (HWND) wparam, state, 0); |
215 |
break; |
break; |
216 |
} |
} |