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