19 #define HELP_CONTEXT 0x0001
20 #define HELP_QUIT 0x0002
21 #define HELP_INDEX 0x0003
22 #define HELP_CONTENTS 0x0003
23 #define HELP_HELPONHELP 0x0004
24 #define HELP_SETINDEX 0x0005
25 #define HELP_SETCONTENTS 0x0005
26 #define HELP_CONTEXTPOPUP 0x0008
27 #define HELP_FORCEFILE 0x0009
28 #define HELP_KEY 0x0101
29 #define HELP_COMMAND 0x0102
30 #define HELP_PARTIALKEY 0x0105
31 #define HELP_MULTIKEY 0x0201
32 #define HELP_SETWINPOS 0x0203
35 /***********************************************************************
38 * Clean-up everything and exit the Wine process.
39 * This is the back-end of ExitWindows(), called when all windows
40 * have agreed to be terminated.
42 void EXEC_ExitWindows( int retCode )
44 /* Do the clean-up stuff */
53 /***********************************************************************
54 * ExitWindows (USER.7)
56 BOOL ExitWindows( DWORD dwReturnCode, WORD wReserved )
58 HWND hwnd, hwndDesktop;
64 api_assert("ExitWindows", wReserved == 0);
65 api_assert("ExitWindows", HIWORD(dwReturnCode) == 0);
67 /* We have to build a list of all windows first, as in EnumWindows */
69 /* First count the windows */
71 hwndDesktop = GetDesktopWindow();
73 for (hwnd = GetTopWindow(hwndDesktop); hwnd != 0; hwnd = wndPtr->hwndNext)
75 if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return FALSE;
78 if (!count) /* No windows, we can exit at once */
79 EXEC_ExitWindows( LOWORD(dwReturnCode) );
81 /* Now build the list of all windows */
83 if (!(list = (HWND *)malloc( sizeof(HWND) * count ))) return FALSE;
84 for (hwnd = GetTopWindow(hwndDesktop), pWnd = list; hwnd != 0; hwnd = wndPtr->hwndNext)
86 wndPtr = WIN_FindWndPtr( hwnd );
90 /* Now send a WM_QUERYENDSESSION message to every window */
92 for (pWnd = list, i = 0; i < count; i++, pWnd++)
94 /* Make sure that window still exists */
95 if (!IsWindow(*pWnd)) continue;
96 if (!SendMessage( *pWnd, WM_QUERYENDSESSION, 0, 0 )) break;
98 result = (i == count);
100 /* Now notify all windows that got a WM_QUERYENDSESSION of the result */
102 for (pWnd = list; i > 0; i--, pWnd++)
104 if (!IsWindow(*pWnd)) continue;
105 SendMessage( *pWnd, WM_ENDSESSION, result, 0 );
109 if (result) EXEC_ExitWindows( LOWORD(dwReturnCode) );
114 /**********************************************************************
117 BOOL WinHelp(HWND hWnd, LPSTR lpHelpFile, WORD wCommand, DWORD dwData)
120 dprintf_exec(stddeb,"WinHelp(%s, %u, %lu)\n",
121 lpHelpFile, wCommand, dwData);
124 case HELP_HELPONHELP:
125 GetWindowsDirectory(str, sizeof(str));
126 strcat(str, "\\winhelp.exe winhelp.hlp");
127 dprintf_exec(stddeb,"'%s'\n", str);
130 GetWindowsDirectory(str, sizeof(str));
131 strcat(str, "\\winhelp.exe ");
132 strcat(str, lpHelpFile);
133 dprintf_exec(stddeb,"'%s'\n", str);
140 WinExec(str, SW_SHOWNORMAL);