00088 {
00089
BOOL fVisOld, fVisNew;
00090
UINT swpFlags = SWP_NOMOVE | SWP_NOSIZE;
00091
PTHREADINFO pti;
00092
BOOL bFirstMain =
FALSE;
00093
int cmdShow = LOWORD(cmdShowAnimate);
00094
00095
CheckLock(pwnd);
00096
00097 fVisOld =
TestWF(pwnd, WFVISIBLE);
00098 pti =
PtiCurrent();
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
if ((pti->
ppi->
usi.
dwFlags & STARTF_USESHOWWINDOW) &&
00113 !
TestwndChild(pwnd) &&
00114 (
TestWF(pwnd, WFBORDERMASK) == (
BYTE)
LOBYTE(WFCAPTION)) &&
00115 (pwnd->
spwndOwner ==
NULL)) {
00116
00117 bFirstMain =
TRUE;
00118
00119
switch (cmdShow) {
00120
case SW_SHOWNORMAL:
00121
case SW_SHOW:
00122
00123
00124
00125
00126 cmdShow = SW_SHOWDEFAULT;
00127
break;
00128 }
00129 }
00130
00131
00132
00133
00134
00135
00136
00137
if (cmdShow == SW_SHOWDEFAULT) {
00138
00139
00140
00141
00142
00143
if (pti->
ppi->
usi.
dwFlags & STARTF_USESHOWWINDOW) {
00144
00145 bFirstMain =
TRUE;
00146
00147 cmdShow = pti->
ppi->
usi.
wShowWindow;
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165 }
00166 }
00167
00168
00169
00170
00171
00172
00173
if (cmdShow == SW_SHOWDEFAULT)
00174 cmdShow = SW_SHOWNORMAL;
00175
00176
00177
00178
00179
00180
00181
00182
00183
if (bFirstMain) {
00184 pti->
ppi->
usi.
dwFlags &=
00185 ~(STARTF_USESHOWWINDOW | STARTF_USESIZE | STARTF_USEPOSITION);
00186 }
00187
00188
00189
00190
00191
00192
if (cmdShow & 0xFF00) {
00193
if ((cmdShow & 0xFF80) == (
int)0xFF80)
00194 cmdShow = SW_SHOWMINNOACTIVE;
00195
else
00196 cmdShow = SW_SHOW;
00197 }
00198
00199
00200
00201
00202
if ((
GetFullScreen(pwnd) != WINDOWED)
00203 && (pwnd->
head.rpdesk ==
grpdeskRitInput)) {
00204
if ((cmdShow == SW_SHOWNORMAL) ||
00205 (cmdShow == SW_RESTORE) ||
00206 (cmdShow == SW_MAXIMIZE) ||
00207 (cmdShow == SW_SHOWMAXIMIZED)) {
00208 cmdShow = SW_SHOWMINIMIZED;
00209
00210
if (
GetFullScreen(pwnd) == FULLSCREENMIN) {
00211
SetFullScreen(pwnd, FULLSCREEN);
00212 }
00213
00214
if (
gpqForeground !=
NULL &&
00215
gpqForeground->
spwndActive == pwnd) {
00216
xxxMakeWindowForegroundWithState(NULL, 0);
00217 }
00218 }
00219 }
00220
00221
switch (cmdShow) {
00222
case SW_SHOWNOACTIVATE:
00223
case SW_SHOWNORMAL:
00224
case SW_RESTORE:
00225
00226
00227
00228
00229
if (
TestWF(pwnd, WFMINIMIZED) ||
TestWF(pwnd, WFMAXIMIZED)) {
00230
xxxMinMaximize(pwnd, (UINT)cmdShow, cmdShowAnimate & MINMAX_ANIMATE);
00231
return fVisOld;
00232
00233 }
else {
00234
00235
00236
00237
00238
if (fVisOld) {
00239
return fVisOld;
00240 }
00241
00242 swpFlags |= SWP_SHOWWINDOW;
00243
if ( cmdShow == SW_SHOWNOACTIVATE) {
00244 swpFlags |= SWP_NOZORDER;
00245
#ifdef NEVER
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
if (pti->
pq->
spwndActive !=
NULL)
00258 swpFlags |= SWP_NOACTIVATE;
00259
#else
00260
swpFlags |= SWP_NOACTIVATE;
00261
#endif
00262
}
00263 }
00264
break;
00265
00266
case SW_FORCEMINIMIZE:
00267
xxxMinimizeHungWindow(pwnd);
00268
return fVisOld;
00269
00270
case SW_SHOWMINNOACTIVE:
00271
case SW_SHOWMINIMIZED:
00272
case SW_SHOWMAXIMIZED:
00273
case SW_MINIMIZE:
00274
xxxMinMaximize(pwnd, (UINT)cmdShow, cmdShowAnimate & MINMAX_ANIMATE);
00275
return fVisOld;
00276
00277
case SW_SHOWNA:
00278 swpFlags |= SWP_SHOWWINDOW | SWP_NOACTIVATE;
00279
00280
00281
00282
00283
00284
00285
00286
break;
00287
00288
case SW_SHOW:
00289
00290
00291
00292
00293
if (fVisOld)
00294
return fVisOld;
00295
00296 swpFlags |= SWP_SHOWWINDOW;
00297 UserAssert(cmdShow != SW_SHOWNOACTIVATE);
00298
break;
00299
00300
case SW_HIDE:
00301
00302
00303
00304
00305
if (!fVisOld)
00306
return fVisOld;
00307
00308 swpFlags |= SWP_HIDEWINDOW;
00309
if (pwnd != pti->
pq->
spwndActive)
00310 swpFlags |= (SWP_NOACTIVATE | SWP_NOZORDER);
00311
break;
00312
00313
default:
00314 RIPERR0(ERROR_INVALID_SHOWWIN_COMMAND, RIP_VERBOSE,
"");
00315
return fVisOld;
00316 }
00317
00318
00319
00320
00321
00322 fVisNew = !(cmdShow == SW_HIDE);
00323
if (fVisNew != fVisOld) {
00324
xxxSendMessage(pwnd, WM_SHOWWINDOW, fVisNew, 0L);
00325
if (!
TestWF(pwnd, WFWIN31COMPAT)) {
00326
xxxSendMessage(pwnd, WM_SETVISIBLE, fVisNew, 0L);
00327 }
00328 }
00329
00330
if (!
TestwndChild(pwnd)) {
00331
if (
TestCF(pwnd, CFSAVEBITS)) {
00332
00333
00334
00335
00336
if (cmdShow == SW_SHOW || cmdShow == SW_SHOWNORMAL) {
00337
xxxActivateWindow(pwnd, AW_USE);
00338 swpFlags |= SWP_NOZORDER | SWP_NOACTIVATE;
00339 }
00340 }
00341 }
else {
00342
00343
00344
00345
00346 swpFlags |= (SWP_NOACTIVATE | SWP_NOZORDER);
00347 }
00348
00349
00350
00351
00352
if (
_FChildVisible(pwnd)) {
00353
xxxSetWindowPos(pwnd, (
PWND)NULL, 0, 0, 0, 0, swpFlags);
00354 }
else {
00355
if (cmdShow == SW_HIDE)
00356
SetVisible(pwnd, SV_UNSET);
00357
else
00358
SetVisible(pwnd, SV_SET);
00359 }
00360
00361
00362
00363
00364
if (
TestWF(pwnd, WFSENDSIZEMOVE)) {
00365
ClrWF(pwnd, WFSENDSIZEMOVE);
00366
if (
TestWF(pwnd, WFMINIMIZED)) {
00367
xxxSendSizeMessage(pwnd, SIZE_MINIMIZED);
00368 }
else if (
TestWF(pwnd, WFMAXIMIZED)) {
00369
xxxSendSizeMessage(pwnd, SIZE_MAXIMIZED);
00370 }
else {
00371
xxxSendSizeMessage(pwnd, SIZE_RESTORED);
00372 }
00373
00374
xxxSendMessage(pwnd, WM_MOVE, 0,
00375 (pwnd->
spwndParent ==
PWNDDESKTOP(pwnd)) ?
00376 MAKELONG(pwnd->
rcClient.left, pwnd->
rcClient.top) :
00377 MAKELONG(
00378 pwnd->
rcClient.left - pwnd->
spwndParent->
rcClient.left,
00379 pwnd->
rcClient.top - pwnd->
spwndParent->
rcClient. top));
00380 }
00381
00382
00383
00384
00385
00386
if (cmdShow == SW_HIDE) {
00387
if ((pwnd == pti->
pq->
spwndActive) && (pti->
pq ==
gpqForeground)) {
00388
xxxActivateWindow(pwnd, AW_SKIP);
00389 }
else {
00390
xxxCheckFocus(pwnd);
00391 }
00392 }
00393
00394
return fVisOld;
00395 }