source: trunk/mainwin.cpp@ 27

Last change on this file since 27 was 27, checked in by Gregg Young, 7 years ago

Remove mmio code; Ticet #5 Get gotcha "quiet" version working Tickets #1 #7 #9 Dialog changes related to both "quiet" and regular modes ( dialogs still need to be split in order to build both; only "quite can be bult from this) See Ticket #9 for a more complete list of changes.

  • Property svn:eol-style set to native
File size: 20.3 KB
Line 
1/***
2 This file belongs to the Gotcha! distribution.
3 Copyright (C) 1998-2002 Thorsten Thielen <thth@c2226.de>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 ***/
19
20// ** CreateMainWindow **************************************************** /*fold00*/
21
22HWND CreateMainWindow (VOID)
23{
24//#ifdef _QUIET_
25#if 1
26 hwndFrame = WinLoadDlg (HWND_OBJECT, NULLHANDLE, NULL, GETMODULE,
27 ID_DLG_MAIN, NULL);
28#else
29 hwndFrame = WinLoadDlg (HWND_DESKTOP, NULLHANDLE, NULL, GETMODULE,
30 ID_DLG_MAIN, NULL);
31#endif
32 OldFrameWP = WinSubclassWindow (hwndFrame, FrameProcedure);
33
34 // attach the icon
35 if (HPOINTER hicon = WinLoadPointer (HWND_DESKTOP, GETMODULE, 1))
36 WinSendMsg (hwndFrame, WM_SETICON, MPFROMLONG (hicon), NULL);
37
38 // attach the accelerator table
39 if (HACCEL haccel = WinLoadAccelTable (hab, GETMODULE, 1))
40 WinSetAccelTable (hab, haccel, hwndFrame);
41
42 // add extensions to system menu
43 static MENUITEM MenuAbout = { MIT_END, MIS_TEXT, 0, WID_PB_ABOUT, 0, 0 };
44 static MENUITEM MenuSettings = { MIT_END, MIS_TEXT, 0, WID_PB_SETTINGS, 0, 0 };
45 static MENUITEM MenuGeneralHelp = { MIT_END, MIS_TEXT, 0, HM_GENERAL_HELP, 0, 0 };
46 static MENUITEM MenuSeparator = { MIT_END, MIS_SEPARATOR, 0, 0, 0, 0 };
47
48 AddSysMenuItem (hwndFrame, &MenuSeparator, NULL);
49 AddSysMenuItem (hwndFrame, &MenuSettings, RSTR(IDS_SETTINGS));
50 AddSysMenuItem (hwndFrame, &MenuGeneralHelp, RSTR(IDS_GENERALHELP));
51 AddSysMenuItem (hwndFrame, &MenuAbout, RSTR(IDS_PRODUCTINFORMATION));
52
53 HWND hwnd = WinWindowFromID (hwndFrame, FID_CLIENT);
54
55 // select the radio button
56 switch (pset->QuerySaveStyle ())
57 {
58 case SAVESTYLE_CLIPBOARD:
59 WinSendDlgItemMsg (hwnd, WID_RB_CLIPBOARD, BM_CLICK,
60 MPFROMSHORT (TRUE), 0); break;
61 default:
62 WinSendDlgItemMsg (hwnd, WID_RB_FILE, BM_CLICK,
63 MPFROMSHORT (TRUE), 0); break;
64 }
65 AdjustSaveTypeButtons (BOOL (pset->QueryFileSaveStyle ()==FSS_FORCEFILE));
66
67 if (pset->SerialCapture ())
68 WinEnableWindow (WinWindowFromID (hwnd, WID_CB_DELAYEDCAPTURE), FALSE);
69
70 // adjust the other buttons
71 WinSendDlgItemMsg (hwnd, WID_CB_HIDEWINDOW, BM_SETCHECK,
72 MPFROMLONG (pset->HideWindow ()), MPFROMLONG (0));
73 WinSendDlgItemMsg (hwnd, WID_CB_DELAYEDCAPTURE, BM_SETCHECK,
74 MPFROMLONG (pset->DelayedCapture ()), MPFROMLONG (0));
75 return hwndFrame;
76}
77
78// ** Drag **************************************************************** /*FOLD00*/
79
80VOID Drag (HWND hwnd)
81{
82 // determine the new window position
83 TRACKINFO trackinfo ;
84 memset (&trackinfo, 0, sizeof (trackinfo));
85
86 trackinfo.cxBorder = 1;
87 trackinfo.cyBorder = 1;
88 trackinfo.cxGrid = 1;
89 trackinfo.cyGrid = 1;
90 trackinfo.cxKeyboard = 8;
91 trackinfo.cyKeyboard = 8;
92
93 SWP swp;
94 WinQueryWindowPos (hwnd, &swp);
95 trackinfo.rclTrack.xLeft = swp.x;
96 trackinfo.rclTrack.xRight = swp.x + swp.cx;
97 trackinfo.rclTrack.yBottom = swp.y;
98 trackinfo.rclTrack.yTop = swp.y + swp.cy;
99
100 WinQueryWindowPos (HWND_DESKTOP, &swp);
101 trackinfo.rclBoundary.xLeft = swp.x;
102 trackinfo.rclBoundary.xRight = swp.x + swp.cx;
103 trackinfo.rclBoundary.yBottom = swp.y;
104 trackinfo.rclBoundary.yTop = swp.y + swp.cy;
105
106 trackinfo.ptlMinTrackSize.x = 0;
107 trackinfo.ptlMinTrackSize.y = 0;
108 trackinfo.ptlMaxTrackSize.x = swp.cx;
109 trackinfo.ptlMaxTrackSize.y = swp.cy;
110
111 trackinfo.fs = TF_MOVE | TF_STANDARD | TF_ALLINBOUNDARY;
112
113 if (WinTrackRect (HWND_DESKTOP, 0, &trackinfo))
114 WinSetWindowPos (hwnd, 0, trackinfo.rclTrack.xLeft,
115 trackinfo.rclTrack.yBottom, 0, 0, SWP_MOVE);
116}
117
118// ** FrameProcedure ****************************************************** /*FOLD00*/
119
120MRESULT EXPENTRY FrameProcedure (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
121{
122 // ATTENTION: used by both main & snapshot window!
123
124 switch (msg)
125 {
126 case WM_QUERYTRACKINFO:
127 {
128 OldFrameWP (hwnd, msg, mp1, mp2);
129 PTRACKINFO pti = PTRACKINFO (mp2);
130 pti->ptlMinTrackSize.x = pti->ptlMinTrackSize.y = 16;
131 }
132 return MRESULT (TRUE);
133
134 case WM_WINDOWPOSCHANGED:
135 if ((PSWP (mp1)->fl & SWP_HIDE))
136 WinPostMsg (WinWindowFromID (hwnd, FID_CLIENT),
137 UM_WINDOWHIDDEN, 0,0);
138 break;
139 }
140
141 return OldFrameWP (hwnd, msg, mp1, mp2);
142}
143
144// ** WindowProcedure ***************************************************** /*FOLD00*/
145
146MRESULT EXPENTRY WindowProcedure (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
147{
148 static BOOL fInterior = FALSE;
149 static USHORT usState = STATE_IDLE, usCap;
150 static ULONG ulTimer, ulCountdown;
151 static HWND hwndCap, hwndParent;
152 static RECTL rcl;
153
154#ifdef _DOLOGDEBUG_
155 LogDebug( "MainWin:WindowProcedure:Message 0x%04x", msg );
156#endif
157
158 switch (msg)
159 {
160 case WM_CREATE:
161 {
162#ifdef _DOLOGDEBUG_
163 LogDebug( "MainWin:WindowProcedure: WM_CREATE" );
164#endif
165 USHORT usResID = WinQueryWindowUShort (hwnd, QWS_ID);
166
167 // attach the icon
168 if (HPOINTER hicon = WinLoadPointer (HWND_DESKTOP, GETMODULE, usResID))
169 WinSendMsg (hwnd, WM_SETICON, MPFROMLONG (hicon), MPVOID);
170
171 RECTL rcl;
172 WinQueryWindowRect (hwndFrame, &rcl);
173 WinCalcFrameRect (hwndFrame, &rcl, TRUE);
174 WinSetWindowPos (WinWindowFromID (hwndFrame, FID_CLIENT), HWND_TOP,
175 rcl.xLeft, rcl.yBottom, rcl.xRight - rcl.xLeft,
176 rcl.yTop - rcl.yBottom,
177 SWP_SHOW | SWP_MOVE | SWP_SIZE | SWP_ZORDER);
178 }
179 break;
180
181 case WM_QUIT:
182#ifdef _DOLOGDEBUG_
183 LogDebug( "MainWin:WindowProcedure: WM_QUIT" );
184#endif
185 case WM_SAVEAPPLICATION:
186#ifdef _DOLOGDEBUG_
187 LogDebug( "MainWin:WindowProcedure: WM_SAVEAPPLICATION" );
188#endif
189 case WM_CLOSE:
190#ifdef _DOLOGDEBUG_
191 LogDebug( "MainWin:WindowProcedure: WM_CLOSE" );
192#endif
193 WinSendMsg (hwnd, UM_ADJUSTSETTINGS, 0,0);
194 break;
195
196 case UM_ADJUSTSETTINGS:
197 {
198#ifdef _DOLOGDEBUG_
199 LogDebug( "MainWin:WindowProcedure: UM_ADJUSTSETTINGS" );
200#endif
201 if (WinSendMsg (WinWindowFromID (hwnd, WID_RB_CLIPBOARD),
202 BM_QUERYCHECK, 0,0))
203 pset->SetSaveStyle (SAVESTYLE_CLIPBOARD);
204 else
205 pset->SetSaveStyle (SAVESTYLE_FILE);
206
207 BOOL f = FALSE;
208 f = BOOL (WinSendDlgItemMsg (hwnd, WID_CB_HIDEWINDOW,
209 BM_QUERYCHECK, 0, 0));
210 pset->HideWindow (f);
211
212 f = BOOL (WinSendDlgItemMsg (hwnd, WID_CB_DELAYEDCAPTURE,
213 BM_QUERYCHECK, 0, 0));
214 pset->DelayedCapture (f);
215 }
216 return MRESULT (FALSE);
217
218 case WM_MOUSEMOVE:
219 // we don't want the mouse pointer to be reset so capture this msg
220 return MRESULT (FALSE);
221
222 case WM_PAINT:
223 {
224 HPS hps;
225 RECTL rcl;
226 COLOR color = SYSCLR_DIALOGBACKGROUND;
227
228 HWND hwnd2 = WinWindowFromID (hwnd, WID_RB_CLIPBOARD);
229 WinQueryPresParam (hwnd2, PP_BACKGROUNDCOLOR, 0, NULL,
230 sizeof (color), &color, 0L);
231
232 hps = WinBeginPaint (hwnd, NULLHANDLE, &rcl);
233 WinQueryWindowRect (hwnd, &rcl);
234 WinFillRect (hps, &rcl, color);
235 WinEndPaint (hps);
236 }
237 break;
238
239 case WM_COMMAND:
240#ifdef _DOLOGDEBUG_
241 LogDebug( "MainWin:WindowProcedure: WM_COMMAND" );
242#endif
243 if (usState != STATE_IDLE)
244 {
245 // this means ESC was pressed
246 if (SHORT1FROMMP (mp1) == DID_CANCEL)
247 WinSendMsg (hwnd, UM_ABORT, 0,0);
248 return MRESULT (FALSE);
249 }
250 else
251 // FIXME pretty yukki to do it this way I guess ...
252 WinSendMsg (hwnd, UM_ADJUSTSETTINGS, 0,0);
253
254 switch (SHORT1FROMMP (mp1))
255 {
256 case WID_RB_CLIPBOARD:
257 WinSendDlgItemMsg (hwnd, WID_RB_CLIPBOARD, BM_CLICK,
258 MPFROMSHORT (TRUE), PVOID (0));
259 break;
260 case WID_RB_FILE:
261 WinSendDlgItemMsg (hwnd, WID_RB_FILE, BM_CLICK,
262 MPFROMSHORT (TRUE), PVOID (0));
263 break;
264 case WID_CB_HIDEWINDOW:
265 WinSendDlgItemMsg (hwnd, WID_CB_HIDEWINDOW, BM_CLICK,
266 MPFROMSHORT (TRUE), PVOID (0));
267 break;
268 case WID_CB_DELAYEDCAPTURE:
269 WinSendDlgItemMsg (hwnd, WID_CB_DELAYEDCAPTURE, BM_CLICK,
270 MPFROMSHORT (TRUE), PVOID (0));
271 break;
272
273 case WID_PB_ABOUT:
274 AboutBox (hwnd);
275 break;
276
277 case WID_PB_SETTINGS:
278 _DebugHereIAm();
279 pset->Dialog ();
280 break;
281
282 case WID_PB_SETCAPTURETYPE:
283 //int capType;
284
285 switch (pset->QuerySSWCaptureType ())
286 {
287 case CAP_WINDOWINT:
288 WinSendMsg (hwndFrame, WM_COMMAND,
289 MPFROM2SHORT (WID_PB_WINDOWINTERIOR,0), 0);
290 case CAP_SCREENREGION:
291 WinSendMsg (hwndFrame, WM_COMMAND,
292 MPFROM2SHORT (WID_PB_SCREENREGION,0), 0);
293 case CAP_WINDOW:
294 WinSendMsg (hwndFrame, WM_COMMAND,
295 MPFROM2SHORT (WID_PB_WINDOW,0), 0);
296 default:
297 WinSendMsg (hwndFrame, WM_COMMAND,
298 MPFROM2SHORT (WID_PB_SCREEN,0), 0);
299 }
300 break;
301
302 case WID_PB_SCREEN:
303 usCap = CAP_SCREEN;
304//#ifdef _Quiet_
305#if 1
306 WinShowWindow (g_hwndSettingsDialog, FALSE);
307 // WinSendMsg (g_hwndSettingsDialog, WM_CLOSE, 0,0); //Needs to go to the setting dialog
308 // Replace current global with pset->GetSettingDialogHwnd () or such
309 // Need for all 4 cases;
310#endif
311 WinSendMsg (hwnd, UM_PREPARECAPTURE, 0,0);
312 break;
313
314 case WID_PB_SCREENREGION:
315 usCap = CAP_SCREENREGION;
316//#ifdef _Quiet_
317#if 1
318 WinShowWindow (g_hwndSettingsDialog, FALSE);
319#endif
320 WinSendMsg (hwnd, UM_PREPARECAPTURE, 0,0);
321 break;
322
323 case WID_PB_WINDOWINTERIOR:
324 usCap = CAP_WINDOWINT;
325//#ifdef _Quiet_
326#if 1
327 WinShowWindow (g_hwndSettingsDialog, FALSE);
328#endif
329 WinSendMsg (hwnd, UM_PREPARECAPTURE, 0,0);
330 break;
331
332 case WID_PB_WINDOW:
333 usCap = CAP_WINDOW;
334//#ifdef _Quiet_
335#if 1
336 WinShowWindow (g_hwndSettingsDialog, FALSE);
337#endif
338 WinSendMsg (hwnd, UM_PREPARECAPTURE, 0,0);
339 break;
340
341 case WID_PB_EXIT:
342 WinSendMsg (hwnd, WM_CLOSE, 0,0);
343 break;
344
345 case HM_HELP_CONTENTS: g_phelp->DisplayContents (); break;
346 case HM_HELP_INDEX: g_phelp->DisplayIndex (); break;
347 case HM_KEYS_HELP: g_phelp->DisplayKeysHelp (); break;
348
349 case HM_GENERAL_HELP:
350 g_phelp->DisplayGeneralHelp ();
351 break;
352
353 default:
354 break;
355 }
356 return MRESULT (FALSE);
357
358 case UM_PREPARECAPTURE:
359 WinSendMsg (hwndSnapshot, UM_STARTCAPTURE, 0,0);
360
361 usState = STATE_WAITFORHIDE;
362
363 if (usCap == CAP_SCREENREGION || usCap == CAP_SCREEN)
364 hwndParent = WinQueryFocus(HWND_DESKTOP);
365//#ifndef _QUIET_
366#if 0
367 if (WinQueryButtonCheckstate (hwnd, WID_CB_HIDEWINDOW))
368 WinShowWindow (WinQueryWindow (hwnd, QW_PARENT), FALSE);
369 else
370#endif
371 WinSendMsg (hwnd, UM_WINDOWHIDDEN, 0,0);
372 return MRESULT (FALSE);
373
374 case UM_WINDOWHIDDEN:
375 if (usState == STATE_WAITFORHIDE)
376 {
377 // FIXME
378 // I have no idea why this delay is necessary, but CAP_SCREEN with
379 // hiding our window does not work without it ...
380 DosSleep (100);
381 usState = STATE_SELECTWINDOW;
382 WinSendMsg (hwnd, UM_SELECTWINDOW, 0,0);
383 }
384 return MRESULT (FALSE);
385
386 case UM_SELECTWINDOW:
387 switch (usCap)
388 {
389 case CAP_SCREEN:
390 usState = STATE_WINDOWSELECTED;
391 WinPostMsg (hwnd, UM_WINDOWSELECTED,
392 MPFROMHWND (HWND_DESKTOP),
393 MPFROMHWND (HWND_DESKTOP));
394 break;
395
396 case CAP_SCREENREGION:
397 if (DoTracking (&rcl))
398 {
399 usState = STATE_WINDOWSELECTED;
400 int rc = saymsg2(1, hwnd, "Capture", "Do you wish to continue?");
401 _DebugHereIAm();
402 if (rc == 1)
403 WinPostMsg (hwnd, UM_WINDOWSELECTED,
404 MPFROMHWND (HWND_DESKTOP),
405 MPFROMHWND (HWND_DESKTOP));
406 if (rc == 2)
407 WinSendMsg (hwnd, UM_ABORT, 0,0);
408 if (rc == 3) {
409 pset->Dialog ();
410 WinPostMsg (hwnd, UM_WINDOWSELECTED,
411 MPFROMHWND (HWND_DESKTOP),
412 MPFROMHWND (HWND_DESKTOP));
413 }
414 }
415 else
416 usState = STATE_IDLE;
417 break;
418
419 case CAP_WINDOWINT:
420 fInterior = TRUE;
421 StartSelection (hwnd);
422 break;
423
424 case CAP_WINDOW:
425 fInterior = FALSE;
426 StartSelection (hwnd);
427 break;
428
429 default:
430 usState = STATE_IDLE;
431 break;
432 }
433 return MRESULT (FALSE);
434
435 case WM_BUTTON1UP:
436 if (usState != STATE_SELECTWINDOW)
437 return MRESULT (FALSE);
438 else
439 {
440 POINTL ptl;
441 WinQueryPointerPos (HWND_DESKTOP, &ptl);
442
443 HWND hwndCapture =
444 WinWindowFromPoint (HWND_DESKTOP, &ptl, FALSE);
445
446 if (hwndCapture && (hwndCapture != HWND_DESKTOP))
447 {
448 HWND hwndOld = hwndCapture;
449
450 if (fInterior)
451 if (! (hwndCapture = WinWindowFromID (hwndOld,
452 FID_CLIENT)))
453 hwndCapture = WinQueryWindow (hwndOld, QW_BOTTOM);
454
455 if (hwndCapture && (hwndCapture != HWND_DESKTOP))
456 {
457 usState = STATE_WINDOWSELECTED;
458 WinPostMsg (hwnd, UM_WINDOWSELECTED,
459 MPFROMHWND (hwndCapture),
460 MPFROMHWND (hwndOld));
461 }
462 else
463 usState = STATE_IDLE;
464 }
465 else
466 usState = STATE_IDLE;
467 }
468 return MRESULT (FALSE);
469
470 case UM_WINDOWSELECTED:
471 if (usState == STATE_WINDOWSELECTED)
472 {
473 // release the pointing device capture if it is active
474 if (WinQueryCapture (HWND_DESKTOP) == hwnd)
475 WinSetCapture (HWND_DESKTOP, NULLHANDLE);
476
477 // reset the pointer to normal shape
478 WinSetPointer (HWND_DESKTOP, WinQuerySysPointer (HWND_DESKTOP,
479 SPTR_ARROW,
480 FALSE));
481 hwndCap = HWND (mp1);
482 if (usCap != CAP_SCREENREGION && usCap != CAP_SCREEN)
483 hwndParent = HWND (mp2);
484 if (pset->SerialCapture ())
485 {
486 ulTimer = WinStartTimer (hab, hwnd, 1, 49);
487 ulCountdown = pset->QuerySerialTime ();
488 }
489 else if (WinQueryButtonCheckstate (hwnd, WID_CB_DELAYEDCAPTURE))
490 {
491 ulTimer = WinStartTimer (hab, hwnd, 1, 990);
492 ulCountdown = pset->QueryDelayTime ();
493 }
494 else
495 {
496 usState = STATE_CAPTURE;
497 WinPostMsg (hwnd, UM_CAPTURE, 0,0);
498 }
499 }
500 return MRESULT (FALSE);
501
502 case WM_TIMER:
503 ulCountdown --;
504
505 if( ulCountdown % 20 == 0 ) {
506 WinSendMsg (hwndSnapshot, UM_COUNTDOWN, MPFROMLONG (ulCountdown), 0);
507
508 if (pset->DelayCountdown () && !pset->SerialCapture ())
509 DoCountdown (ulCountdown);
510 }
511
512 if (ulCountdown == 0)
513 {
514 WinStopTimer (hab, hwnd, ulTimer);
515 usState = STATE_CAPTURE;
516 WinSendMsg (hwnd, UM_CAPTURE, 0,0);
517 }
518 return MRESULT (FALSE);
519
520 case UM_CAPTURE:
521 usState = STATE_WAITFORHIDE2;
522 if (pset->SSWHide () && WinIsWindowVisible (hwndSnapshot))
523 WinShowWindow (hwndSnapshot, FALSE);
524 else
525 WinSendMsg (hwnd, UM_CAPTURE2, 0,0);
526 return MRESULT (FALSE);
527
528 case UM_SSWHIDDEN:
529 // FIXME
530 // I have no idea why this delay is necessary, but CAP_SCREEN with
531 // hiding our window does not work without it ...
532 DosSleep (100);
533 WinSendMsg (hwnd, UM_CAPTURE2, 0,0);
534 return MRESULT (FALSE);
535
536 case UM_CAPTURE2:
537 if (usState == STATE_WAITFORHIDE2)
538 {
539 HBITMAP hbm;
540
541 WinEnableWindow (hwnd, FALSE);
542 // capture the window to a bitmap and save this
543 if (usCap == CAP_SCREENREGION)
544 hbm = CaptureWindow (hwndCap, hwndParent, &rcl, FALSE);
545 else if (usCap == CAP_SCREEN)
546 hbm = CaptureWindow (hwndCap, hwndParent, NULL, FALSE);
547 else
548 hbm = CaptureWindow (hwndCap, hwndParent, NULL, TRUE);
549
550 if (pset->SerialCapture ())
551 {
552 WinStopTimer (hab, hwnd, ulTimer);
553 if (! WinIsWindowVisible (hwndSnapshot) && pset->SnapshotWindow ())
554 WinShowWindow (hwndSnapshot, TRUE);
555
556 if (hbm)
557 {
558 usState = STATE_WINDOWSELECTED;
559 WinPostMsg (hwnd, UM_WINDOWSELECTED,
560 MPFROMHWND (hwndCap),
561 MPFROMHWND (hwndParent));
562 }
563 else
564 WinSendMsg (hwnd, UM_ABORT, 0,0);
565 }
566 else
567 WinSendMsg (hwnd, UM_CLEANUP, 0,0);
568 }
569 return MRESULT (FALSE);
570
571 case UM_ABORT:
572 DosBeep (100, 500);
573 WinSendMsg (hwnd, UM_CLEANUP, 0,0);
574 return MRESULT (FALSE);
575
576 case UM_CLEANUP:
577 if (WinQueryCapture (HWND_DESKTOP) == hwnd)
578 WinSetCapture (HWND_DESKTOP, NULLHANDLE);
579
580 pset->Load ();
581
582 WinSendMsg (hwndSnapshot, UM_STOPCAPTURE, 0,0);
583 WinStopTimer (hab, hwnd, ulTimer);
584//#ifdef _QUIET_
585#if 1
586 // ? FIXME to give option to reshow window.
587 if (WinQueryButtonCheckstate (hwnd, WID_CB_HIDEWINDOW))
588 WinSendMsg (g_hwndSettingsDialog, WM_CLOSE, 0,0);
589 else if (WinIsWindow ( hab, g_hwndSettingsDialog) &&
590 ! WinIsWindowVisible (g_hwndSettingsDialog))
591 WinShowWindow (g_hwndSettingsDialog, TRUE);
592 pset->HideWindow (TRUE);
593#else
594 // re-show the windows if they are hidden
595 // FIXME using global hwndFrame is pretty yukki
596 if (! WinIsWindowVisible (hwndFrame))
597 WinShowWindow (hwndFrame, TRUE);
598 if (! WinIsWindowVisible (hwndSnapshot) && pset->SnapshotWindow ())
599 WinShowWindow (hwndSnapshot, TRUE);
600#endif
601 WinEnableWindow (hwnd, TRUE);
602 WinSetActiveWindow (HWND_DESKTOP, hwnd);
603 usState = STATE_IDLE;
604 return MRESULT (FALSE);
605 }
606
607#ifdef _DOLOGDEBUG_
608 LogDebug( "MainWin:WindowProcedure:WinDefWindowProc->0x%04x", msg );
609#endif
610 return WinDefWindowProc (hwnd, msg, mp1, mp2);
611}
612
613// ************************************************************************
Note: See TracBrowser for help on using the repository browser.