Changeset 22115 for branches/swt/testapp/apitest/src/ApiTestWin.cpp
- Timestamp:
- Feb 9, 2016, 12:57:59 PM (10 years ago)
- File:
-
- 1 edited
-
branches/swt/testapp/apitest/src/ApiTestWin.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/swt/testapp/apitest/src/ApiTestWin.cpp
r22113 r22115 95 95 /* Message from the button, we post a message to close the window */ 96 96 case ID_EXIT: 97 Post QuitMessage(0);98 break; 99 100 /* Exit Message from the File Menu, forward it to ID_EXIT*/97 PostMessage(hwnd, WM_CLOSE, NULL, NULL); 98 break; 99 100 /* Message from the button, we post a message to close the window */ 101 101 case ID_FILE_EXIT: 102 PostMessage(hwnd, WM_C OMMAND, (UINT) ID_EXIT, NULL);102 PostMessage(hwnd, WM_CLOSE, NULL, NULL); 103 103 break; 104 104 … … 132 132 133 133 /* 134 // Request to quit the application. 134 // This message is generated by a call to PostQuitMessage() or the 135 // posting of a WM_QUIT message. It causes GetMessage() to return zero 136 // and thus the message-loop to end. So this message is never 137 // dispatched and this case thus never reached. After the message-loop 138 // ends, the message-structure contains this message with an exit-code 139 // (from PostQuitMessage()) in wParam. 135 140 */ 136 141 case WM_QUIT: … … 140 145 141 146 /* 142 // Request to close the application.143 // On Win32 WM_CLOSE does a DestroyWindow() but does not post a WM_QUIT144 // message and thus does not terminate the message-loop.147 // This message is sent when the close-button is clicked. 148 // On Win32, DefWindowProc() does a DestroyWindow(), but does not post 149 // a WM_QUIT message and thus does not terminate the message-loop. 145 150 */ 146 151 case WM_CLOSE: 147 152 printf("WM_CLOSE received\n"); 148 153 lres = DefWindowProc(hwnd, msg, wparam, lparam); 149 PostQuitMessage(0); 150 break; 151 152 /* 153 // Window is being destroyed, time to cleanup resources allocated. 154 break; 155 156 /* 157 // This message is generated by a call to DestroyWindow(). 158 // At the time this message is received, the windows and its children 159 // are not destroyed yet. 154 160 */ 155 161 case WM_DESTROY: 156 162 printf("WM_DESTROY received\n"); 157 163 lres = DefWindowProc(hwnd, msg, wparam, lparam); 164 PostQuitMessage(99); 158 165 break; 159 166 … … 266 273 hwnd = CreateWindow( 267 274 MainWndClass, // Our Window Class 268 "ApiTestWin :: Main Window [generated:201602071 054]", // Caption Text275 "ApiTestWin :: Main Window [generated:201602071950]", // Caption Text 269 276 WS_OVERLAPPEDWINDOW, // Window Stype 270 277 100, // The x-pos from ulc … … 292 299 } 293 300 301 /* Last Message Info */ 302 printf("\n"); 303 printf("Last Message:\n"); 304 printf("msg.hwnd=%08X\n", msg.hwnd); 305 printf("msg.message=%08X (%d)\n", msg.message, msg.message); 306 printf("msg.wParam=%08X (%d)\n", msg.wParam, msg.wParam); 307 printf("msg.lParam=%08X (%d)\n", msg.lParam, msg.lParam); 308 294 309 /* App is terminating */ 310 printf("\n"); 295 311 printf("ApiTestWin is terminating...\n"); 296 312 … … 307 323 printf("\n"); 308 324 printf("%s\n","###############################################################################"); 309 printf("%s\n","# This is the Windows variant of ApiTest version.201602071 054#");325 printf("%s\n","# This is the Windows variant of ApiTest version.201602071950 #"); 310 326 printf("%s\n","###############################################################################"); 311 327 printf("\n");
Note:
See TracChangeset
for help on using the changeset viewer.
