50 #include <private/qthread_p.h> 60 return GetModuleHandle(0);
70 #if defined(Q_OS_WINCE) 73 STARTUPINFO startupInfo;
74 GetStartupInfo(&startupInfo);
76 return (startupInfo.dwFlags & STARTF_USESHOWWINDOW)
77 ? startupInfo.wShowWindow
94 wchar_t buffer[MAX_PATH + 2];
95 DWORD v = GetModuleFileName(0, buffer, MAX_PATH + 1);
96 buffer[MAX_PATH + 1] = 0;
100 else if (v <= MAX_PATH)
110 b =
reinterpret_cast<wchar_t *
>(realloc(b, (size + 1) *
sizeof(
wchar_t)));
112 v = GetModuleFileName(NULL, b, size);
113 }
while (b && v == size);
133 { InitializeCriticalSection(&cs); }
135 { DeleteCriticalSection(&cs); }
138 { EnterCriticalSection(&cs); }
140 { LeaveCriticalSection(&cs); }
155 staticCriticalSection.
lock();
159 OutputDebugString((
wchar_t*)s.
utf16());
161 staticCriticalSection.
unlock();
169 #if defined(Q_OS_WINCE) 174 void qWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam,
178 static bool already_called =
false;
180 if (already_called) {
181 qWarning(
"Qt: Internal error: qWinMain should be called only once");
184 already_called =
true;
191 argv = qWinCmdLine<char>(cmdParam, int(strlen(cmdParam)),
argc);
233 && static_cast<QTimerEvent *>(pe.
event)->timerId() == timerId) {
234 --pe.
receiver->d_func()->postedEvents;
243 #if defined(Q_WS_WIN) && !defined(QT_NO_DEBUG_STREAM) 249 #include <windowsx.h> 253 #if !defined(GET_X_LPARAM) 254 # define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) 255 # define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) 258 # ifndef WM_NCACTIVATE 259 # define WM_NCACTIVATE 0x86 270 {{ 0x0000,
"WM_NULL" },
271 { 0x0001,
"WM_CREATE" },
272 { 0x0002,
"WM_DESTROY" },
273 { 0x0003,
"WM_MOVE" },
274 { 0x0005,
"WM_SIZE" },
275 { 0x0006,
"WM_ACTIVATE" },
276 { 0x0007,
"WM_SETFOCUS" },
277 { 0x0008,
"WM_KILLFOCUS" },
278 { 0x000A,
"WM_ENABLE" },
279 { 0x000B,
"WM_SETREDRAW" },
280 { 0x000C,
"WM_SETTEXT" },
281 { 0x000D,
"WM_GETTEXT" },
282 { 0x000E,
"WM_GETTEXTLENGTH" },
283 { 0x000F,
"WM_PAINT" },
284 { 0x0010,
"WM_CLOSE" },
285 { 0x0011,
"WM_QUERYENDSESSION" },
286 { 0x0013,
"WM_QUERYOPEN" },
287 { 0x0016,
"WM_ENDSESSION" },
288 { 0x0012,
"WM_QUIT" },
289 { 0x0014,
"WM_ERASEBKGND" },
290 { 0x0015,
"WM_SYSCOLORCHANGE" },
291 { 0x0018,
"WM_SHOWWINDOW" },
292 { 0x001A,
"WM_WININICHANGE" },
293 { 0x001B,
"WM_DEVMODECHANGE" },
294 { 0x001C,
"WM_ACTIVATEAPP" },
295 { 0x001D,
"WM_FONTCHANGE" },
296 { 0x001E,
"WM_TIMECHANGE" },
297 { 0x001F,
"WM_CANCELMODE" },
298 { 0x0020,
"WM_SETCURSOR" },
299 { 0x0021,
"WM_MOUSEACTIVATE" },
300 { 0x0022,
"WM_CHILDACTIVATE" },
301 { 0x0023,
"WM_QUEUESYNC" },
302 { 0x0024,
"WM_GETMINMAXINFO" },
303 { 0x0026,
"WM_PAINTICON" },
304 { 0x0027,
"WM_ICONERASEBKGND" },
305 { 0x0028,
"WM_NEXTDLGCTL" },
306 { 0x002A,
"WM_SPOOLERSTATUS" },
307 { 0x002B,
"WM_DRAWITEM" },
308 { 0x002C,
"WM_MEASUREITEM" },
309 { 0x002D,
"WM_DELETEITEM" },
310 { 0x002E,
"WM_VKEYTOITEM" },
311 { 0x002F,
"WM_CHARTOITEM" },
312 { 0x0030,
"WM_SETFONT" },
313 { 0x0031,
"WM_GETFONT" },
314 { 0x0032,
"WM_SETHOTKEY" },
315 { 0x0033,
"WM_GETHOTKEY" },
316 { 0x0037,
"WM_QUERYDRAGICON" },
317 { 0x0039,
"WM_COMPAREITEM" },
318 { 0x003D,
"WM_GETOBJECT" },
319 { 0x0041,
"WM_COMPACTING" },
320 { 0x0044,
"WM_COMMNOTIFY" },
321 { 0x0046,
"WM_WINDOWPOSCHANGING" },
322 { 0x0047,
"WM_WINDOWPOSCHANGED" },
323 { 0x0048,
"WM_POWER" },
324 { 0x004A,
"WM_COPYDATA" },
325 { 0x004B,
"WM_CANCELJOURNAL" },
326 { 0x004E,
"WM_NOTIFY" },
327 { 0x0050,
"WM_INPUTLANGCHANGEREQUEST" },
328 { 0x0051,
"WM_INPUTLANGCHANGE" },
329 { 0x0052,
"WM_TCARD" },
330 { 0x0053,
"WM_HELP" },
331 { 0x0054,
"WM_USERCHANGED" },
332 { 0x0055,
"WM_NOTIFYFORMAT" },
333 { 0x007B,
"WM_CONTEXTMENU" },
334 { 0x007C,
"WM_STYLECHANGING" },
335 { 0x007D,
"WM_STYLECHANGED" },
336 { 0x007E,
"WM_DISPLAYCHANGE" },
337 { 0x007F,
"WM_GETICON" },
338 { 0x0080,
"WM_SETICON" },
339 { 0x0081,
"WM_NCCREATE" },
340 { 0x0082,
"WM_NCDESTROY" },
341 { 0x0083,
"WM_NCCALCSIZE" },
342 { 0x0084,
"WM_NCHITTEST" },
343 { 0x0085,
"WM_NCPAINT" },
344 { 0x0086,
"WM_NCACTIVATE" },
345 { 0x0087,
"WM_GETDLGCODE" },
346 { 0x0088,
"WM_SYNCPAINT" },
347 { 0x00A0,
"WM_NCMOUSEMOVE" },
348 { 0x00A1,
"WM_NCLBUTTONDOWN" },
349 { 0x00A2,
"WM_NCLBUTTONUP" },
350 { 0x00A3,
"WM_NCLBUTTONDBLCLK" },
351 { 0x00A4,
"WM_NCRBUTTONDOWN" },
352 { 0x00A5,
"WM_NCRBUTTONUP" },
353 { 0x00A6,
"WM_NCRBUTTONDBLCLK" },
354 { 0x00A7,
"WM_NCMBUTTONDOWN" },
355 { 0x00A8,
"WM_NCMBUTTONUP" },
356 { 0x00A9,
"WM_NCMBUTTONDBLCLK" },
357 { 0x00AB,
"WM_NCXBUTTONDOWN" },
358 { 0x00AC,
"WM_NCXBUTTONUP" },
359 { 0x00AD,
"WM_NCXBUTTONDBLCLK" },
360 { 0x00FF,
"WM_INPUT" },
361 { 0x0100,
"WM_KEYDOWN" },
362 { 0x0101,
"WM_KEYUP" },
363 { 0x0102,
"WM_CHAR" },
364 { 0x0103,
"WM_DEADCHAR" },
365 { 0x0104,
"WM_SYSKEYDOWN" },
366 { 0x0105,
"WM_SYSKEYUP" },
367 { 0x0106,
"WM_SYSCHAR" },
368 { 0x0107,
"WM_SYSDEADCHAR" },
369 { 0x0109,
"WM_UNICHAR" },
370 { 0x010D,
"WM_IME_STARTCOMPOSITION" },
371 { 0x010E,
"WM_IME_ENDCOMPOSITION" },
372 { 0x010F,
"WM_IME_COMPOSITION" },
373 { 0x0110,
"WM_INITDIALOG" },
374 { 0x0111,
"WM_COMMAND" },
375 { 0x0112,
"WM_SYSCOMMAND" },
376 { 0x0113,
"WM_TIMER" },
377 { 0x0114,
"WM_HSCROLL" },
378 { 0x0115,
"WM_VSCROLL" },
379 { 0x0116,
"WM_INITMENU" },
380 { 0x0117,
"WM_INITMENUPOPUP" },
381 { 0x011F,
"WM_MENUSELECT" },
382 { 0x0120,
"WM_MENUCHAR" },
383 { 0x0121,
"WM_ENTERIDLE" },
384 { 0x0122,
"WM_MENURBUTTONUP" },
385 { 0x0123,
"WM_MENUDRAG" },
386 { 0x0124,
"WM_MENUGETOBJECT" },
387 { 0x0125,
"WM_UNINITMENUPOPUP" },
388 { 0x0126,
"WM_MENUCOMMAND" },
389 { 0x0127,
"WM_CHANGEUISTATE" },
390 { 0x0128,
"WM_UPDATEUISTATE" },
391 { 0x0129,
"WM_QUERYUISTATE" },
392 { 0x0132,
"WM_CTLCOLORMSGBOX" },
393 { 0x0133,
"WM_CTLCOLOREDIT" },
394 { 0x0134,
"WM_CTLCOLORLISTBOX" },
395 { 0x0135,
"WM_CTLCOLORBTN" },
396 { 0x0136,
"WM_CTLCOLORDLG" },
397 { 0x0137,
"WM_CTLCOLORSCROLLBAR" },
398 { 0x0138,
"WM_CTLCOLORSTATIC" },
399 { 0x0200,
"WM_MOUSEMOVE" },
400 { 0x0201,
"WM_LBUTTONDOWN" },
401 { 0x0202,
"WM_LBUTTONUP" },
402 { 0x0203,
"WM_LBUTTONDBLCLK" },
403 { 0x0204,
"WM_RBUTTONDOWN" },
404 { 0x0205,
"WM_RBUTTONUP" },
405 { 0x0206,
"WM_RBUTTONDBLCLK" },
406 { 0x0207,
"WM_MBUTTONDOWN" },
407 { 0x0208,
"WM_MBUTTONUP" },
408 { 0x0209,
"WM_MBUTTONDBLCLK" },
409 { 0x020A,
"WM_MOUSEWHEEL" },
410 { 0x020B,
"WM_XBUTTONDOWN" },
411 { 0x020C,
"WM_XBUTTONUP" },
412 { 0x020D,
"WM_XBUTTONDBLCLK" },
413 { 0x020E,
"WM_MOUSEHWHEEL" },
414 { 0x0210,
"WM_PARENTNOTIFY" },
415 { 0x0211,
"WM_ENTERMENULOOP" },
416 { 0x0212,
"WM_EXITMENULOOP" },
417 { 0x0213,
"WM_NEXTMENU" },
418 { 0x0214,
"WM_SIZING" },
419 { 0x0215,
"WM_CAPTURECHANGED" },
420 { 0x0216,
"WM_MOVING" },
421 { 0x0218,
"WM_POWERBROADCAST" },
422 { 0x0219,
"WM_DEVICECHANGE" },
423 { 0x0220,
"WM_MDICREATE" },
424 { 0x0221,
"WM_MDIDESTROY" },
425 { 0x0222,
"WM_MDIACTIVATE" },
426 { 0x0223,
"WM_MDIRESTORE" },
427 { 0x0224,
"WM_MDINEXT" },
428 { 0x0225,
"WM_MDIMAXIMIZE" },
429 { 0x0226,
"WM_MDITILE" },
430 { 0x0227,
"WM_MDICASCADE" },
431 { 0x0228,
"WM_MDIICONARRANGE" },
432 { 0x0229,
"WM_MDIGETACTIVE" },
433 { 0x0230,
"WM_MDISETMENU" },
434 { 0x0231,
"WM_ENTERSIZEMOVE" },
435 { 0x0232,
"WM_EXITSIZEMOVE" },
436 { 0x0233,
"WM_DROPFILES" },
437 { 0x0234,
"WM_MDIREFRESHMENU" },
438 { 0x0281,
"WM_IME_SETCONTEXT" },
439 { 0x0282,
"WM_IME_NOTIFY" },
440 { 0x0283,
"WM_IME_CONTROL" },
441 { 0x0284,
"WM_IME_COMPOSITIONFULL" },
442 { 0x0285,
"WM_IME_SELECT" },
443 { 0x0286,
"WM_IME_CHAR" },
444 { 0x0288,
"WM_IME_REQUEST" },
445 { 0x0290,
"WM_IME_KEYDOWN" },
446 { 0x0291,
"WM_IME_KEYUP" },
447 { 0x02A0,
"WM_NCMOUSEHOVER" },
448 { 0x02A1,
"WM_MOUSEHOVER" },
449 { 0x02A2,
"WM_NCMOUSELEAVE" },
450 { 0x02A3,
"WM_MOUSELEAVE" },
451 { 0x02B1,
"WM_WTSSESSION_CHANGE" },
452 { 0x02C0,
"WM_TABLET_FIRST" },
453 { 0x02C1,
"WM_TABLET_FIRST + 1" },
454 { 0x02C2,
"WM_TABLET_FIRST + 2" },
455 { 0x02C3,
"WM_TABLET_FIRST + 3" },
456 { 0x02C4,
"WM_TABLET_FIRST + 4" },
457 { 0x02C5,
"WM_TABLET_FIRST + 5" },
458 { 0x02C6,
"WM_TABLET_FIRST + 6" },
459 { 0x02C7,
"WM_TABLET_FIRST + 7" },
460 { 0x02C8,
"WM_TABLET_FIRST + 8" },
461 { 0x02C9,
"WM_TABLET_FIRST + 9" },
462 { 0x02CA,
"WM_TABLET_FIRST + 10" },
463 { 0x02CB,
"WM_TABLET_FIRST + 11" },
464 { 0x02CC,
"WM_TABLET_FIRST + 12" },
465 { 0x02CD,
"WM_TABLET_FIRST + 13" },
466 { 0x02CE,
"WM_TABLET_FIRST + 14" },
467 { 0x02CF,
"WM_TABLET_FIRST + 15" },
468 { 0x02D0,
"WM_TABLET_FIRST + 16" },
469 { 0x02D1,
"WM_TABLET_FIRST + 17" },
470 { 0x02D2,
"WM_TABLET_FIRST + 18" },
471 { 0x02D3,
"WM_TABLET_FIRST + 19" },
472 { 0x02D4,
"WM_TABLET_FIRST + 20" },
473 { 0x02D5,
"WM_TABLET_FIRST + 21" },
474 { 0x02D6,
"WM_TABLET_FIRST + 22" },
475 { 0x02D7,
"WM_TABLET_FIRST + 23" },
476 { 0x02D8,
"WM_TABLET_FIRST + 24" },
477 { 0x02D9,
"WM_TABLET_FIRST + 25" },
478 { 0x02DA,
"WM_TABLET_FIRST + 26" },
479 { 0x02DB,
"WM_TABLET_FIRST + 27" },
480 { 0x02DC,
"WM_TABLET_FIRST + 28" },
481 { 0x02DD,
"WM_TABLET_FIRST + 29" },
482 { 0x02DE,
"WM_TABLET_FIRST + 30" },
483 { 0x02DF,
"WM_TABLET_LAST" },
484 { 0x0300,
"WM_CUT" },
485 { 0x0301,
"WM_COPY" },
486 { 0x0302,
"WM_PASTE" },
487 { 0x0303,
"WM_CLEAR" },
488 { 0x0304,
"WM_UNDO" },
489 { 0x0305,
"WM_RENDERFORMAT" },
490 { 0x0306,
"WM_RENDERALLFORMATS" },
491 { 0x0307,
"WM_DESTROYCLIPBOARD" },
492 { 0x0308,
"WM_DRAWCLIPBOARD" },
493 { 0x0309,
"WM_PAINTCLIPBOARD" },
494 { 0x030A,
"WM_VSCROLLCLIPBOARD" },
495 { 0x030B,
"WM_SIZECLIPBOARD" },
496 { 0x030C,
"WM_ASKCBFORMATNAME" },
497 { 0x030D,
"WM_CHANGECBCHAIN" },
498 { 0x030E,
"WM_HSCROLLCLIPBOARD" },
499 { 0x030F,
"WM_QUERYNEWPALETTE" },
500 { 0x0310,
"WM_PALETTEISCHANGING" },
501 { 0x0311,
"WM_PALETTECHANGED" },
502 { 0x0312,
"WM_HOTKEY" },
503 { 0x0317,
"WM_PRINT" },
504 { 0x0318,
"WM_PRINTCLIENT" },
505 { 0x0319,
"WM_APPCOMMAND" },
506 { 0x031A,
"WM_THEMECHANGED" },
507 { 0x0358,
"WM_HANDHELDFIRST" },
508 { 0x0359,
"WM_HANDHELDFIRST + 1" },
509 { 0x035A,
"WM_HANDHELDFIRST + 2" },
510 { 0x035B,
"WM_HANDHELDFIRST + 3" },
511 { 0x035C,
"WM_HANDHELDFIRST + 4" },
512 { 0x035D,
"WM_HANDHELDFIRST + 5" },
513 { 0x035E,
"WM_HANDHELDFIRST + 6" },
514 { 0x035F,
"WM_HANDHELDLAST" },
515 { 0x0360,
"WM_AFXFIRST" },
516 { 0x0361,
"WM_AFXFIRST + 1" },
517 { 0x0362,
"WM_AFXFIRST + 2" },
518 { 0x0363,
"WM_AFXFIRST + 3" },
519 { 0x0364,
"WM_AFXFIRST + 4" },
520 { 0x0365,
"WM_AFXFIRST + 5" },
521 { 0x0366,
"WM_AFXFIRST + 6" },
522 { 0x0367,
"WM_AFXFIRST + 7" },
523 { 0x0368,
"WM_AFXFIRST + 8" },
524 { 0x0369,
"WM_AFXFIRST + 9" },
525 { 0x036A,
"WM_AFXFIRST + 10" },
526 { 0x036B,
"WM_AFXFIRST + 11" },
527 { 0x036C,
"WM_AFXFIRST + 12" },
528 { 0x036D,
"WM_AFXFIRST + 13" },
529 { 0x036E,
"WM_AFXFIRST + 14" },
530 { 0x036F,
"WM_AFXFIRST + 15" },
531 { 0x0370,
"WM_AFXFIRST + 16" },
532 { 0x0371,
"WM_AFXFIRST + 17" },
533 { 0x0372,
"WM_AFXFIRST + 18" },
534 { 0x0373,
"WM_AFXFIRST + 19" },
535 { 0x0374,
"WM_AFXFIRST + 20" },
536 { 0x0375,
"WM_AFXFIRST + 21" },
537 { 0x0376,
"WM_AFXFIRST + 22" },
538 { 0x0377,
"WM_AFXFIRST + 23" },
539 { 0x0378,
"WM_AFXFIRST + 24" },
540 { 0x0379,
"WM_AFXFIRST + 25" },
541 { 0x037A,
"WM_AFXFIRST + 26" },
542 { 0x037B,
"WM_AFXFIRST + 27" },
543 { 0x037C,
"WM_AFXFIRST + 28" },
544 { 0x037D,
"WM_AFXFIRST + 29" },
545 { 0x037E,
"WM_AFXFIRST + 30" },
546 { 0x037F,
"WM_AFXLAST" },
547 { 0x0380,
"WM_PENWINFIRST" },
548 { 0x0381,
"WM_PENWINFIRST + 1" },
549 { 0x0382,
"WM_PENWINFIRST + 2" },
550 { 0x0383,
"WM_PENWINFIRST + 3" },
551 { 0x0384,
"WM_PENWINFIRST + 4" },
552 { 0x0385,
"WM_PENWINFIRST + 5" },
553 { 0x0386,
"WM_PENWINFIRST + 6" },
554 { 0x0387,
"WM_PENWINFIRST + 7" },
555 { 0x0388,
"WM_PENWINFIRST + 8" },
556 { 0x0389,
"WM_PENWINFIRST + 9" },
557 { 0x038A,
"WM_PENWINFIRST + 10" },
558 { 0x038B,
"WM_PENWINFIRST + 11" },
559 { 0x038C,
"WM_PENWINFIRST + 12" },
560 { 0x038D,
"WM_PENWINFIRST + 13" },
561 { 0x038E,
"WM_PENWINFIRST + 14" },
562 { 0x038F,
"WM_PENWINLAST" },
563 { 0x0400,
"WM_USER" },
564 { 0x8000,
"WM_APP" },
571 const char* result = 0;
592 #define FLGSTR(x) FLAG_STRING(x, #x) 600 va_start(ap, actual);
622 va_start(ap, actual);
647 const WPARAM wParam = msg.wParam;
648 const LPARAM lParam = msg.lParam;
655 rawParameters.
sprintf(
"hwnd(0x%p) ", (
void *)msg.hwnd);
658 if (msg.message > WM_APP)
660 else if (msg.message > WM_USER)
664 switch (msg.message) {
671 FLAG_STRING(WA_CLICKACTIVE,
"Activate by mouseclick"),
677 #ifdef WM_CAPTURECHANGED 678 case WM_CAPTURECHANGED:
679 parameters.
sprintf(
"Hwnd gaining capture (0x%p)", (
void *)lParam);
685 LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
727 #ifdef WS_EX_ACCEPTFILES
728 FLGSTR(WS_EX_ACCEPTFILES),
730 #ifdef WS_EX_APPWINDOW
734 FLGSTR(WS_EX_DLGMODALFRAME),
738 FLGSTR(WS_EX_LEFTSCROLLBAR),
739 #ifdef WS_EX_LTRREADING
742 #ifdef WS_EX_MDICHILD
745 #ifdef WS_EX_NOACTIVATE
748 #ifdef WS_EX_NOANIMATION
749 FLGSTR(WS_EX_NOANIMATION),
752 FLGSTR(WS_EX_OVERLAPPEDWINDOW),
753 #ifdef WS_EX_PALETTEWINDOW
754 FLGSTR(WS_EX_PALETTEWINDOW),
759 #ifdef WS_EX_RIGHTSCROLLBAR
760 FLGSTR(WS_EX_RIGHTSCROLLBAR),
762 #ifdef WS_EX_RTLREADING
768 #ifdef WS_EX_TRANSPARENT
769 FLGSTR(WS_EX_TRANSPARENT),
778 if (lpcs->lpszClass != 0) {
779 if (HIWORD(lpcs->lpszClass) == 0)
783 (
int)wcslen(reinterpret_cast<const wchar_t *>(lpcs->lpszClass)));
787 if (lpcs->lpszName != 0)
789 (
int)wcslen(reinterpret_cast<const wchar_t *>(lpcs->lpszName)));
791 parameters.
sprintf(
"x,y(%4d,%4d) w,h(%4d,%4d) className(%s) windowName(%s) parent(0x%p) style(%s) exStyle(%s)",
792 lpcs->x, lpcs->y, lpcs->cx, lpcs->cy, className.
toLatin1().
data(),
800 parameters.
sprintf(
"Destroy hwnd (0x%p)", (
void *)msg.hwnd);
807 FLGSTR(IMN_CHANGECANDIDATE),
808 FLGSTR(IMN_CLOSECANDIDATE),
809 FLGSTR(IMN_CLOSESTATUSWINDOW),
811 FLGSTR(IMN_OPENCANDIDATE),
812 FLGSTR(IMN_OPENSTATUSWINDOW),
813 FLGSTR(IMN_SETCANDIDATEPOS),
814 FLGSTR(IMN_SETCOMPOSITIONFONT),
815 FLGSTR(IMN_SETCOMPOSITIONWINDOW),
816 FLGSTR(IMN_SETCONVERSIONMODE),
817 FLGSTR(IMN_SETOPENSTATUS),
818 FLGSTR(IMN_SETSENTENCEMODE),
819 FLGSTR(IMN_SETSTATUSWINDOWPOS),
825 #ifdef WM_IME_SETCONTEXT 826 case WM_IME_SETCONTEXT:
828 bool fSet = (BOOL)wParam;
829 DWORD fShow = (DWORD)lParam;
831 #ifdef ISC_SHOWUICOMPOSITIONWINDOW
832 FLGSTR(ISC_SHOWUICOMPOSITIONWINDOW),
834 #ifdef ISC_SHOWUIGUIDWINDOW
835 FLGSTR(ISC_SHOWUIGUIDWINDOW),
837 #ifdef ISC_SHOWUISOFTKBD
838 FLGSTR(ISC_SHOWUISOFTKBD),
840 FLGSTR(ISC_SHOWUICANDIDATEWINDOW),
841 FLGSTR(ISC_SHOWUICANDIDATEWINDOW << 1),
842 FLGSTR(ISC_SHOWUICANDIDATEWINDOW << 2),
843 FLGSTR(ISC_SHOWUICANDIDATEWINDOW << 3),
845 parameters.
sprintf(
"Input context(%s) Show flags(%s)", (fSet?
"Active" :
"Inactive"), showFlgs.
toLatin1().
data());
851 parameters.
sprintf(
"Hwnd gaining keyboard focus (0x%p)", (
void *)wParam);
866 int nVirtKey = (int)wParam;
867 long lKeyData = (long)lParam;
868 int repCount = (lKeyData & 0xffff);
869 int scanCode = (lKeyData & 0xf0000) >> 16;
870 bool contextCode = (lKeyData && 0x20000000);
871 bool prevState = (lKeyData && 0x40000000);
872 bool transState = (lKeyData && 0x80000000);
873 parameters.
sprintf(
"Virual-key(0x%x) Scancode(%d) Rep(%d) Contextcode(%d), Prev state(%d), Trans state(%d)",
874 nVirtKey, scanCode, repCount, contextCode, prevState, transState);
878 #ifdef WM_INPUTLANGCHANGE 879 case WM_INPUTLANGCHANGE:
882 #endif // WM_INPUTLANGCHANGE 890 #ifdef WM_MOUSEACTIVATE 891 case WM_MOUSEACTIVATE:
894 parameters.
sprintf(
"TLW(0x%p) HittestCode(0x%x) MouseMsg(%s)", (
void *)wParam, LOWORD(lParam), mouseMsg.
toLatin1().
data());
908 #ifdef WM_MOUSEHWHEEL 911 #ifdef WM_LBUTTONDBLCLK 912 case WM_LBUTTONDBLCLK:
914 #ifdef WM_LBUTTONDOWN 920 #ifdef WM_MBUTTONDBLCLK 921 case WM_MBUTTONDBLCLK:
923 #ifdef WM_MBUTTONDOWN 929 #ifdef WM_RBUTTONDBLCLK 930 case WM_RBUTTONDBLCLK:
932 #ifdef WM_RBUTTONDOWN 960 parameters.
sprintf(
"x,y(%4d,%4d)", LOWORD(lParam), HIWORD(lParam));
963 #if defined(WM_PAINT) && defined(WM_ERASEBKGND) 966 parameters.
sprintf(
"hdc(0x%p)", (
void *)wParam);
969 #ifdef WM_QUERYNEWPALETTE 970 case WM_QUERYNEWPALETTE:
977 parameters.
sprintf(
"HitTestCode(0x%x) MouseMsg(%s)", LOWORD(lParam), mouseMsg.
toLatin1().
data());
983 parameters.
sprintf(
"Lost Focus (0x%p)", (
void *)wParam);
988 parameters.
sprintf(
"Set Text (%s)",
QString((
QChar*)lParam, (
int)wcslen(reinterpret_cast<const wchar_t *>(lParam))).toLatin1().
data());
1002 parameters.
sprintf(
"w,h(%4d,%4d) showmode(%s)", LOWORD(lParam), HIWORD(lParam), showMode.
toLatin1().
data());
1006 #ifdef WM_WINDOWPOSCHANGED 1007 case WM_WINDOWPOSCHANGED:
1009 LPWINDOWPOS winPos = (LPWINDOWPOS)lParam;
1022 FLGSTR(SWP_FRAMECHANGED),
1025 #ifdef SWP_NOCOPYBITS
1029 FLGSTR(SWP_NOOWNERZORDER),
1031 FLGSTR(SWP_NOREPOSITION),
1032 #ifdef SWP_NOSENDCHANGING
1033 FLGSTR(SWP_NOSENDCHANGING),
1039 parameters.
sprintf(
"x,y(%4d,%4d) w,h(%4d,%4d) flags(%s) hwndAfter(%s)", winPos->x, winPos->y, winPos->cx, winPos->cy, flags.
toLatin1().
data(), hwndAfter.
toLatin1().
data());
1044 parameters.
sprintf(
"wParam(0x%p) lParam(0x%p)", (
void *)wParam, (
void *)lParam);
1051 message += rawParameters;
1052 message += parameters;
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
The QDebug class provides an output stream for debugging information.
QString & sprintf(const char *format,...)
Safely builds a formatted string from the format string cformat and an arbitrary list of arguments...
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
QIntegerForSizeof< void * >::Unsigned quintptr
QString decodeMSG(const MSG &msg)
#define QT_END_NAMESPACE
This macro expands to.
char * data()
Returns a pointer to the data stored in the byte array.
QDebug & nospace()
Clears the stream's internal flag that records whether the last character was a space and returns a r...
Q_CORE_EXPORT int qWinAppCmdShow()
Q_CORE_EXPORT void qWinMsgHandler(QtMsgType t, const char *str)
#define QT_END_INCLUDE_NAMESPACE
This macro is equivalent to QT_BEGIN_NAMESPACE.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QWinMsgHandlerCriticalSection()
The QString class provides a Unicode character string.
QString flagCheck(uint actual,...)
Q_CORE_EXPORT QString qAppFileName()
~QWinMsgHandlerCriticalSection()
The QVector class is a template class that provides a dynamic array.
The QObject class is the base class of all Qt objects.
QtMsgType
This enum describes the messages that can be sent to a message handler (QtMsgHandler).
QString valueCheck(uint actual,...)
The QChar class provides a 16-bit Unicode character.
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual QString appName() const
QIntegerForSizeof< void * >::Signed qptrdiff
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
const T & at(int i) const
Returns the item at index position i in the list.
Q_CORE_EXPORT void qWarning(const char *,...)
static const char * data(const QByteArray &arr)
QPostEventList postEventList
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
#define WS_EX_NOPARENTNOTIFY
QDebug operator<<(QDebug dbg, const MSG &msg)
Q_CORE_EXPORT HINSTANCE qWinAppPrevInst()
QString baseName() const
Returns the base name of the file without the path.
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
QtMsgHandler qInstallMsgHandler(QtMsgHandler h)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
int size() const
Returns the number of items in the list.
static void removePostedTimerEvent(QObject *object, int timerId)
#define WS_OVERLAPPEDWINDOW
static const char * findWMstr(uint msg)
#define QT_BEGIN_INCLUDE_NAMESPACE
This macro is equivalent to QT_END_NAMESPACE.
Q_CORE_EXPORT HINSTANCE qWinAppInst()
The QFileInfo class provides system-independent file information.
#define WS_EX_CAPTIONOKBTN
Type type() const
Returns the event type.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
FLAG_STRING_STRUCT FLAG_STRING(uint value=0, const char *c=0)
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Q_CORE_EXPORT void __cdecl qWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam, int cmdShow, int &argc, QVector< char *> &argv)
virtual bool winEventFilter(MSG *message, long *result)
The message procedure calls this function for every message received.
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.