ReactOS  0.4.14-dev-98-gb0d4763
defwnd.c
Go to the documentation of this file.
1 /*
2  *
3  * COPYRIGHT: See COPYING in the top level directory
4  * PROJECT: ReactOS user32.dll
5  * FILE: win32ss/user/user32/windows/defwnd.c
6  * PURPOSE: Window management
7  * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
8  * UPDATE HISTORY:
9  * 06-06-2001 CSH Created
10  */
11 
12 #include <user32.h>
13 
15 
16 /*
17  * @implemented
18  */
19 DWORD
20 WINAPI
22 GetSysColor(int nIndex)
23 {
24  if(nIndex >= 0 && nIndex < NUM_SYSCOLORS)
25  {
26  return gpsi->argbSystem[nIndex];
27  }
28 
30  return 0;
31 }
32 
33 /*
34  * @implemented
35  */
36 HBRUSH
37 WINAPI
39 GetSysColorBrush(int nIndex)
40 {
41  if(nIndex >= 0 && nIndex < NUM_SYSCOLORS)
42  {
43  return gpsi->ahbrSystem[nIndex];
44  }
45 
46  return NULL;
47 }
48 
49 /*
50  * @implemented
51  */
52 BOOL
53 WINAPI
55  int cElements,
56  CONST INT *lpaElements,
57  CONST COLORREF *lpaRgbValues)
58 {
59  return NtUserSetSysColors(cElements, lpaElements, lpaRgbValues, 0);
60 }
61 
62 BOOL
65 {
66  BOOL Ret;
67  LARGE_STRING lsString;
68 
69  if ( String )
70  {
71  if ( Ansi )
73  else
75  }
76  Ret = NtUserDefSetText(hWnd, (String ? &lsString : NULL));
77 
78  return Ret;
79 }
80 
83 {
84  HWND Ret;
85  PWND Child, OwnerWnd, Root, Owner;
86 
88  Owner = ValidateHwnd(hOwner);
89 
90  for( Child = Root->spwndChild ? DesktopPtrToUser(Root->spwndChild) : NULL;
91  Child;
92  Child = Child->spwndNext ? DesktopPtrToUser(Child->spwndNext) : NULL )
93  {
94  OwnerWnd = Child->spwndOwner ? DesktopPtrToUser(Child->spwndOwner) : NULL;
95  if(!OwnerWnd)
96  continue;
97 
98  if (!(Child->style & WS_POPUP) || !(Child->style & WS_VISIBLE))
99  continue;
100 
101  if(OwnerWnd == Owner)
102  {
103  Ret = Child->head.h;
104  return Ret;
105  }
106  }
107  ERR("IDCWTO Nothing found\n");
108  return NULL;
109 }
110 
111 /***********************************************************************
112  * DefWndTrackScrollBar
113  *
114  * Track a mouse button press on the horizontal or vertical scroll-bar.
115  */
116 static VOID
118 {
119  INT ScrollBar;
120 
121  if (SC_HSCROLL == (wParam & 0xfff0))
122  {
123  if (HTHSCROLL != (wParam & 0x0f))
124  {
125  return;
126  }
127  ScrollBar = SB_HORZ;
128  }
129  else /* SC_VSCROLL */
130  {
131  if (HTVSCROLL != (wParam & 0x0f))
132  {
133  return;
134  }
135  ScrollBar = SB_VERT;
136  }
137  ScrollTrackScrollBar(Wnd, ScrollBar, Pt );
138 }
139 
141 
142 LRESULT
144 {
145  POINT Pt;
146  LRESULT lResult;
147 
148  if (!IsWindowEnabled( hWnd )) return 0;
149 
150  switch (wParam & 0xfff0)
151  {
152  case SC_MOVE:
153  case SC_SIZE:
154 // case SC_DEFAULT:
155  case SC_MOUSEMENU:
156  case SC_KEYMENU:
157  case SC_SCREENSAVE:
158  case SC_MINIMIZE:
159  case SC_MAXIMIZE:
160  case SC_RESTORE:
161  case SC_CLOSE:
162  case SC_HOTKEY:
164  return 0;
165 
166  default:
167  break;
168  }
169 
170  if (ISITHOOKED(WH_CBT))
171  {
173  if (lResult) return 0;
174  }
175 
176  switch (wParam & 0xfff0)
177  {
178 
179  case SC_VSCROLL:
180  case SC_HSCROLL:
181  {
182  Pt.x = (short)LOWORD(lParam);
183  Pt.y = (short)HIWORD(lParam);
185  }
186  break;
187 
188  case SC_TASKLIST:
189  WinExec( "taskman.exe", SW_SHOWNORMAL );
190  break;
191 
192 
193  case SC_NEXTWINDOW:
194  case SC_PREVWINDOW:
196  break;
197 
198  default:
199  FIXME("Unimplemented DefWndHandleSysCommand wParam 0x%x\n",wParam);
200  break;
201  }
202 
203  return(0);
204 }
205 
206 /***********************************************************************
207  * DefWndControlColor
208  *
209  * Default colors for control painting.
210  */
211 HBRUSH
213 {
214  if (ctlType == CTLCOLOR_SCROLLBAR)
215  {
216  HBRUSH hb = GetSysColorBrush(COLOR_SCROLLBAR);
219  SetBkColor(hDC, bk);
220 
221  /* if COLOR_WINDOW happens to be the same as COLOR_3DHILIGHT
222  * we better use 0x55aa bitmap brush to make scrollbar's background
223  * look different from the window background.
224  */
225  if ( bk == GetSysColor(COLOR_WINDOW))
226  return gpsi->hbrGray;
227 
228  UnrealizeObject( hb );
229  return hb;
230  }
231 
233 
234  if ((ctlType == CTLCOLOR_EDIT) || (ctlType == CTLCOLOR_LISTBOX))
235  {
237  }
238  else
239  {
242  }
243 
245 }
246 
247 static BOOL CALLBACK
249 {
250  SendMessageW(hwnd, WM_UPDATEUISTATE, (WPARAM)lParam, 0);
251  return TRUE;
252 }
253 
254 /* WARNING: Redundant with /ntuser/defwnd.c!UserPaintCaption !!
255  Use TWOPARAM_ROUTINE_REDRAWTITLE/REDRAWFRAME or HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK .
256  */
257 static void
259 {
260  if ( pwnd->style & WS_VISIBLE && (pwnd->style & WS_CAPTION) == WS_CAPTION )
261  {
263  Flags |= DC_ACTIVE;
264  /*
265  * When themes are not enabled we can go on and paint the non client area.
266  * However if we do that with themes enabled we will draw a classic frame.
267  * This is solved by sending a themes specific message to notify the themes
268  * engine that the caption needs to be redrawn
269  */
271  {
272  /*
273  * This will cause uxtheme to either paint the themed caption or call
274  * RealUserDrawCaption in order to draw the classic caption when themes
275  * are disabled but the themes service is enabled
276  */
278  }
279  else
280  {
281  RECT rc = {0,0,0,0};
284  ReleaseDC(UserHMGetHandle(pwnd), hDC);
285  }
286  }
287  //NtUserCallTwoParam((DWORD_PTR)UserHMGetHandle(pwnd),Flags,TWOPARAM_ROUTINE_REDRAWTITLE)
288 }
289 
292 {
293  HICON hIconRet;
294  if ( wParam > ICON_SMALL2 )
295  {
297  return 0;
298  }
299  switch(wParam)
300  {
301  case ICON_BIG:
302  hIconRet = UserGetProp(UserHMGetHandle(pWnd), gpsi->atomIconProp, TRUE);
303  break;
304  case ICON_SMALL:
305  case ICON_SMALL2:
306  hIconRet = UserGetProp(UserHMGetHandle(pWnd), gpsi->atomIconSmProp, TRUE);
307  break;
308  default:
309  break;
310  }
311  return (LRESULT)hIconRet;
312 }
313 
314 
317  UINT Msg,
318  WPARAM wParam,
319  LPARAM lParam,
320  BOOL bUnicode)
321 {
322  PWND pWnd = NULL;
323  if (hWnd)
324  {
325  pWnd = ValidateHwnd(hWnd);
326  if (!pWnd) return 0;
327  }
328 
329  switch (Msg)
330  {
331  case WM_POPUPSYSTEMMENU:
332  {
333  /* This is an undocumented message used by the windows taskbar to
334  display the system menu of windows that belong to other processes. */
335  HMENU menu = GetSystemMenu(hWnd, FALSE);
336  ERR("WM_POPUPSYSTEMMENU\n");
337  if (menu)
339  LOWORD(lParam), HIWORD(lParam), 0, hWnd, NULL);
340  return 0;
341  }
342 
343  case WM_RBUTTONUP:
344  {
345  POINT Pt;
346  Pt.x = GET_X_LPARAM(lParam);
347  Pt.y = GET_Y_LPARAM(lParam);
348  ClientToScreen(hWnd, &Pt);
349  lParam = MAKELPARAM(Pt.x, Pt.y);
350  if (bUnicode)
351  {
353  }
354  else
355  {
357  }
358  break;
359  }
360 
361  case WM_NCRBUTTONUP:
362  /*
363  * FIXME : we must NOT send WM_CONTEXTMENU on a WM_NCRBUTTONUP (checked
364  * in Windows), but what _should_ we do? According to MSDN :
365  * "If it is appropriate to do so, the system sends the WM_SYSCOMMAND
366  * message to the window". When is it appropriate?
367  */
368  ERR("WM_NCRBUTTONUP\n");
369  break;
370 
371  case WM_XBUTTONUP:
372  case WM_NCXBUTTONUP:
373  if (HIWORD(wParam) == XBUTTON1 || HIWORD(wParam) == XBUTTON2)
374  {
376  MAKELPARAM(LOWORD(wParam), FAPPCOMMAND_MOUSE | HIWORD(wParam)));
377  }
378  break;
379 
380  case WM_CONTEXTMENU:
381  {
383  {
384  if (bUnicode)
385  {
387  }
388  else
389  {
391  }
392  }
393  else
394  {
395  goto GoSS;
396  }
397  break;
398  }
399 
400  case WM_CLOSE:
402  return (0);
403 
404  case WM_MOUSEACTIVATE:
406  {
408  if (Ret) return (Ret);
409  }
411 
412  case WM_ACTIVATE:
413  /* The default action in Windows is to set the keyboard focus to
414  * the window, if it's being activated and not minimized */
415  if (LOWORD(wParam) != WA_INACTIVE &&
417  {
418  //ERR("WM_ACTIVATE %p\n",hWnd);
419  SetFocus(hWnd);
420  }
421  break;
422 
423  case WM_MOUSEWHEEL:
426  break;
427 
428  case WM_ERASEBKGND:
429  case WM_ICONERASEBKGND:
430  {
431  RECT Rect;
432  HBRUSH hBrush = (HBRUSH)GetClassLongPtrW(hWnd, GCL_HBRBACKGROUND);
433 
434  if (NULL == hBrush)
435  {
436  return 0;
437  }
439  {
440  /* can't use GetClipBox with a parent DC or we fill the whole parent */
442  DPtoLP((HDC)wParam, (LPPOINT)&Rect, 2);
443  }
444  else
445  {
447  }
448  FillRect((HDC)wParam, &Rect, hBrush);
449  return (1);
450  }
451 
452  case WM_CTLCOLORMSGBOX:
453  case WM_CTLCOLOREDIT:
454  case WM_CTLCOLORLISTBOX:
455  case WM_CTLCOLORBTN:
456  case WM_CTLCOLORDLG:
457  case WM_CTLCOLORSTATIC:
460 
461  case WM_CTLCOLOR:
463 
464  case WM_SYSCOMMAND:
466 
467  case WM_VKEYTOITEM:
468  case WM_CHARTOITEM:
469  return (-1);
470 /*
471  case WM_DROPOBJECT:
472  return DRAG_FILE;
473 */
474  case WM_QUERYDROPOBJECT:
475  {
477  {
478  return(1);
479  }
480  break;
481  }
482 
483  case WM_QUERYDRAGICON:
484  {
485  UINT Len;
486  HICON hIcon;
487 
489  if (hIcon)
490  {
491  return ((LRESULT)hIcon);
492  }
493  for (Len = 1; Len < 64; Len++)
494  {
496  {
497  return((LRESULT)hIcon);
498  }
499  }
500  return ((LRESULT)LoadIconW(0, IDI_APPLICATION));
501  }
502 
503  case WM_ISACTIVEICON:
504  {
505  BOOL isai;
506  isai = (pWnd->state & WNDS_ACTIVEFRAME) != 0;
507  return isai;
508  }
509 
510  case WM_NOTIFYFORMAT:
511  {
512  if (lParam == NF_QUERY)
514  break;
515  }
516 
517  case WM_GETICON:
518  {
519  return DefWndGetIcon(pWnd, wParam, lParam);
520  }
521 
522  case WM_HELP:
523  {
524  if (bUnicode)
525  {
527  }
528  else
529  {
531  }
532  break;
533  }
534 
535  case WM_QUERYOPEN:
536  case WM_QUERYENDSESSION:
537  {
538  return (1);
539  }
540 
541  case WM_INPUTLANGCHANGEREQUEST:
542  {
543  HKL NewHkl;
544 
545  if(wParam & INPUTLANGCHANGE_BACKWARD
546  && wParam & INPUTLANGCHANGE_FORWARD)
547  {
548  return FALSE;
549  }
550 
551  //FIXME: What to do with INPUTLANGCHANGE_SYSCHARSET ?
552 
553  if(wParam & INPUTLANGCHANGE_BACKWARD) NewHkl = (HKL) HKL_PREV;
554  else if(wParam & INPUTLANGCHANGE_FORWARD) NewHkl = (HKL) HKL_NEXT;
555  else NewHkl = (HKL) lParam;
556 
557  NtUserActivateKeyboardLayout(NewHkl, 0);
558 
559  return TRUE;
560  }
561 
562  case WM_INPUTLANGCHANGE:
563  {
564  int count = 0;
565  HWND *win_array = WIN_ListChildren( hWnd );
566 
567  if (!win_array)
568  break;
569  while (win_array[count])
570  SendMessageW( win_array[count++], WM_INPUTLANGCHANGE, wParam, lParam);
571  HeapFree(GetProcessHeap(),0,win_array);
572  break;
573  }
574 
575  case WM_QUERYUISTATE:
576  {
577  LRESULT Ret = 0;
578  PWND Wnd = ValidateHwnd(hWnd);
579  if (Wnd != NULL)
580  {
581  if (Wnd->HideFocus)
582  Ret |= UISF_HIDEFOCUS;
583  if (Wnd->HideAccel)
584  Ret |= UISF_HIDEACCEL;
585  }
586  return Ret;
587  }
588 
589  case WM_CHANGEUISTATE:
590  {
591  BOOL AlwaysShowCues = FALSE;
593  WORD Flags = HIWORD(wParam);
594  PWND Wnd;
595 
596  SystemParametersInfoW(SPI_GETKEYBOARDCUES, 0, &AlwaysShowCues, 0);
597  if (AlwaysShowCues)
598  break;
599 
600  Wnd= ValidateHwnd(hWnd);
601  if (!Wnd || lParam != 0)
602  break;
603 
604  if (Flags & ~(UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE))
605  break;
606 
607  if (Flags & UISF_ACTIVE)
608  {
609  WARN("WM_CHANGEUISTATE does not yet support UISF_ACTIVE!\n");
610  }
611 
612  if (Action == UIS_INITIALIZE)
613  {
615  if (Desk == NULL)
616  break;
617 
618  Action = Desk->LastInputWasKbd ? UIS_CLEAR : UIS_SET;
619  Flags = UISF_HIDEFOCUS | UISF_HIDEACCEL;
620 
621  /* We need to update wParam in case we need to send out messages */
623  }
624 
625  switch (Action)
626  {
627  case UIS_SET:
628  /* See if we actually need to change something */
629  if ((Flags & UISF_HIDEFOCUS) && !Wnd->HideFocus)
630  break;
631  if ((Flags & UISF_HIDEACCEL) && !Wnd->HideAccel)
632  break;
633 
634  /* Don't need to do anything... */
635  return 0;
636 
637  case UIS_CLEAR:
638  /* See if we actually need to change something */
639  if ((Flags & UISF_HIDEFOCUS) && Wnd->HideFocus)
640  break;
641  if ((Flags & UISF_HIDEACCEL) && Wnd->HideAccel)
642  break;
643 
644  /* Don't need to do anything... */
645  return 0;
646 
647  default:
648  WARN("WM_CHANGEUISTATE: Unsupported Action 0x%x\n", Action);
649  break;
650  }
651 
652  if ((Wnd->style & WS_CHILD) && Wnd->spwndParent != NULL)
653  {
654  /* We're a child window and we need to pass this message down until
655  we reach the root */
657  }
658  else
659  {
660  /* We're a top level window, we need to change the UI state */
661  Msg = WM_UPDATEUISTATE;
662  }
663 
664  if (bUnicode)
665  return SendMessageW(hWnd, Msg, wParam, lParam);
666  else
667  return SendMessageA(hWnd, Msg, wParam, lParam);
668  }
669 
670  case WM_UPDATEUISTATE:
671  {
672  BOOL Change = TRUE;
673  BOOL AlwaysShowCues = FALSE;
675  WORD Flags = HIWORD(wParam);
676  PWND Wnd;
677 
678  SystemParametersInfoW(SPI_GETKEYBOARDCUES, 0, &AlwaysShowCues, 0);
679  if (AlwaysShowCues)
680  break;
681 
682  Wnd = ValidateHwnd(hWnd);
683  if (!Wnd || lParam != 0)
684  break;
685 
686  if (Flags & ~(UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE))
687  break;
688 
689  if (Flags & UISF_ACTIVE)
690  {
691  WARN("WM_UPDATEUISTATE does not yet support UISF_ACTIVE!\n");
692  }
693 
694  if (Action == UIS_INITIALIZE)
695  {
697  if (Desk == NULL)
698  break;
699 
700  Action = Desk->LastInputWasKbd ? UIS_CLEAR : UIS_SET;
701  Flags = UISF_HIDEFOCUS | UISF_HIDEACCEL;
702 
703  /* We need to update wParam for broadcasting the update */
705  }
706 
707  switch (Action)
708  {
709  case UIS_SET:
710  /* See if we actually need to change something */
711  if ((Flags & UISF_HIDEFOCUS) && !Wnd->HideFocus)
712  break;
713  if ((Flags & UISF_HIDEACCEL) && !Wnd->HideAccel)
714  break;
715 
716  /* Don't need to do anything... */
717  Change = FALSE;
718  break;
719 
720  case UIS_CLEAR:
721  /* See if we actually need to change something */
722  if ((Flags & UISF_HIDEFOCUS) && Wnd->HideFocus)
723  break;
724  if ((Flags & UISF_HIDEACCEL) && Wnd->HideAccel)
725  break;
726 
727  /* Don't need to do anything... */
728  Change = FALSE;
729  break;
730 
731  default:
732  WARN("WM_UPDATEUISTATE: Unsupported Action 0x%x\n", Action);
733  return 0;
734  }
735 
736  /* Pack the information and call win32k */
737  if (Change)
738  {
739  if (!NtUserxUpdateUiState(hWnd, Flags | ((DWORD)Action << 3)))
740  break;
741  }
742 
743  /* Always broadcast the update to all children */
746  (LPARAM)wParam);
747 
748  break;
749  }
750 
751  case WM_COPYGLOBALDATA:
752  {
753  TRACE("WM_COPYGLOBALDATA hGlobal %p Size %d Flags 0x%x\n",lParam,wParam,GlobalFlags((HGLOBAL)lParam));
754  return lParam;
755  }
756 
757 /* Move to Win32k !*/
758  case WM_SHOWWINDOW:
759  if (!lParam) break; // Call when it is necessary.
760  case WM_LBUTTONDOWN:
761  case WM_RBUTTONDOWN:
762  case WM_MBUTTONDOWN:
763  case WM_NCLBUTTONDOWN:
764  case WM_NCRBUTTONDOWN:
765  case WM_LBUTTONDBLCLK:
766  case WM_NCLBUTTONDBLCLK:
767  case WM_KEYF1:
768  case WM_KEYUP:
769  case WM_SYSKEYUP:
770  case WM_KEYDOWN:
771  case WM_SYSKEYDOWN:
772  case WM_SYSCHAR:
773  case WM_CANCELMODE:
774  case WM_PAINTICON:
775  case WM_PAINT:
776  case WM_PRINT:
777  case WM_SETICON:
778  case WM_SYSCOLORCHANGE:
779  case WM_NCUAHDRAWCAPTION:
780  case WM_NCUAHDRAWFRAME:
781  case WM_NCPAINT:
782  case WM_NCACTIVATE:
783  case WM_NCCALCSIZE:
784  case WM_NCHITTEST:
785  case WM_SYNCPAINT:
786  case WM_SETREDRAW:
787  case WM_CLIENTSHUTDOWN:
788  case WM_GETHOTKEY:
789  case WM_SETHOTKEY:
791  case WM_WINDOWPOSCHANGED:
792  case WM_APPCOMMAND:
793  case WM_SETCURSOR:
794 GoSS:
795  {
796  LRESULT lResult;
797  NtUserMessageCall( hWnd, Msg, wParam, lParam, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, !bUnicode);
798  return lResult;
799  }
800  }
801  return 0;
802 }
803 
804 
807  UINT Msg,
808  WPARAM wParam,
809  LPARAM lParam)
810 {
811  LRESULT Result = 0;
812  PWND Wnd;
813 
814  Wnd = ValidateHwnd(hWnd);
815 
816  if ( !Wnd &&
817  Msg != WM_CTLCOLORMSGBOX &&
818  Msg != WM_CTLCOLORBTN &&
819  Msg != WM_CTLCOLORDLG &&
821  return 0;
822 
824  switch (Msg)
825  {
826  case WM_NCCREATE:
827  {
828  if ( Wnd &&
829  Wnd->style & (WS_HSCROLL | WS_VSCROLL) )
830  {
831  if (!Wnd->pSBInfo)
832  {
833  SCROLLINFO si = {sizeof si, SIF_ALL, 0, 100, 0, 0, 0};
834  SetScrollInfo( hWnd, SB_HORZ, &si, FALSE );
835  SetScrollInfo( hWnd, SB_VERT, &si, FALSE );
836  }
837  }
838 
839  if (lParam)
840  {
842  /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
843  * may have child window IDs instead of window name */
844  if (HIWORD(cs->lpszName))
845  {
846  DefSetText(hWnd, (PCWSTR)cs->lpszName, TRUE);
847  }
848  Result = 1;
849  }
850  break;
851  }
852 
853  case WM_GETTEXTLENGTH:
854  {
855  PWSTR buf;
856  ULONG len;
857 
858  if (Wnd != NULL && Wnd->strName.Length != 0)
859  {
861  if (buf != NULL &&
863  buf,
864  Wnd->strName.Length)))
865  {
866  Result = (LRESULT) len;
867  }
868  }
869  else Result = 0L;
870 
871  break;
872  }
873 
874  case WM_GETTEXT:
875  {
876  PWSTR buf = NULL;
877  PSTR outbuf = (PSTR)lParam;
878  SIZE_T copy;
879 
880  if (Wnd != NULL && wParam != 0)
881  {
882  if (Wnd->strName.Buffer != NULL)
884  else
885  outbuf[0] = L'\0';
886 
887  if (buf != NULL)
888  {
889  if (Wnd->strName.Length != 0)
890  {
891  copy = min(Wnd->strName.Length / sizeof(WCHAR), wParam - 1);
893  0,
894  buf,
895  copy,
896  outbuf,
897  wParam,
898  NULL,
899  NULL);
900  outbuf[Result] = '\0';
901  }
902  else
903  outbuf[0] = '\0';
904  }
905  }
906  break;
907  }
908 
909  case WM_SETTEXT:
910  {
912 
914  {
916  IntNotifyWinEvent(EVENT_OBJECT_NAMECHANGE, hWnd, OBJID_WINDOW, CHILDID_SELF, 0);
917  }
918  Result = 1;
919  break;
920  }
921 
922  case WM_IME_KEYDOWN:
923  {
925  break;
926  }
927 
928  case WM_IME_KEYUP:
929  {
931  break;
932  }
933 
934  case WM_IME_CHAR:
935  {
936  if (HIBYTE(wParam))
939  break;
940  }
941 
942  case WM_IME_COMPOSITION:
943  if (lParam & GCS_RESULTSTR)
944  {
945  LONG size, i;
946  unsigned char lead = 0;
947  char *buf = NULL;
948  HIMC himc = ImmGetContext( hWnd );
949 
950  if (himc)
951  {
952  if ((size = ImmGetCompositionStringA( himc, GCS_RESULTSTR, NULL, 0 )))
953  {
954  if (!(buf = HeapAlloc( GetProcessHeap(), 0, size ))) size = 0;
956  }
957  ImmReleaseContext( hWnd, himc );
958 
959  for (i = 0; i < size; i++)
960  {
961  unsigned char c = buf[i];
962  if (!lead)
963  {
964  if (IsDBCSLeadByte( c ))
965  lead = c;
966  else
967  SendMessageA( hWnd, WM_IME_CHAR, c, 1 );
968  }
969  else
970  {
971  SendMessageA( hWnd, WM_IME_CHAR, MAKEWORD(c, lead), 1 );
972  lead = 0;
973  }
974  }
975  HeapFree( GetProcessHeap(), 0, buf );
976  }
977  }
978  /* fall through */
979  case WM_IME_STARTCOMPOSITION:
980  case WM_IME_ENDCOMPOSITION:
981  case WM_IME_SELECT:
982  case WM_IME_NOTIFY:
983  case WM_IME_CONTROL:
984  {
985  HWND hwndIME;
986 
987  hwndIME = ImmGetDefaultIMEWnd(hWnd);
988  if (hwndIME)
989  Result = SendMessageA(hwndIME, Msg, wParam, lParam);
990  break;
991  }
992 
993  case WM_IME_SETCONTEXT:
994  {
995  HWND hwndIME;
996 
997  hwndIME = ImmGetDefaultIMEWnd(hWnd);
998  if (hwndIME)
999  Result = ImmIsUIMessageA(hwndIME, Msg, wParam, lParam);
1000  break;
1001  }
1002 
1003  /* fall through */
1004  default:
1006  }
1007 
1009  return Result;
1010 }
1011 
1012 
1015  UINT Msg,
1016  WPARAM wParam,
1017  LPARAM lParam)
1018 {
1019  LRESULT Result = 0;
1020  PWND Wnd;
1021 
1022  Wnd = ValidateHwnd(hWnd);
1023 
1024  if ( !Wnd &&
1025  Msg != WM_CTLCOLORMSGBOX &&
1026  Msg != WM_CTLCOLORBTN &&
1027  Msg != WM_CTLCOLORDLG &&
1028  Msg != WM_CTLCOLORSTATIC )
1029  return 0;
1030 
1032  switch (Msg)
1033  {
1034  case WM_NCCREATE:
1035  {
1036  if ( Wnd &&
1037  Wnd->style & (WS_HSCROLL | WS_VSCROLL) )
1038  {
1039  if (!Wnd->pSBInfo)
1040  {
1041  SCROLLINFO si = {sizeof si, SIF_ALL, 0, 100, 0, 0, 0};
1042  SetScrollInfo( hWnd, SB_HORZ, &si, FALSE );
1043  SetScrollInfo( hWnd, SB_VERT, &si, FALSE );
1044  }
1045  }
1046 
1047  if (lParam)
1048  {
1050  /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
1051  * may have child window IDs instead of window name */
1052  if (HIWORD(cs->lpszName))
1053  {
1054  DefSetText(hWnd, cs->lpszName, FALSE);
1055  }
1056  Result = 1;
1057  }
1058  break;
1059  }
1060 
1061  case WM_GETTEXTLENGTH:
1062  {
1063  PWSTR buf;
1064  ULONG len;
1065 
1066  if (Wnd != NULL && Wnd->strName.Length != 0)
1067  {
1069  if (buf != NULL &&
1071  buf,
1072  Wnd->strName.Length)))
1073  {
1074  Result = (LRESULT) (Wnd->strName.Length / sizeof(WCHAR));
1075  }
1076  }
1077  else Result = 0L;
1078 
1079  break;
1080  }
1081 
1082  case WM_GETTEXT:
1083  {
1084  PWSTR buf = NULL;
1085  PWSTR outbuf = (PWSTR)lParam;
1086 
1087  if (Wnd != NULL && wParam != 0)
1088  {
1089  if (Wnd->strName.Buffer != NULL)
1091  else
1092  outbuf[0] = L'\0';
1093 
1094  if (buf != NULL)
1095  {
1096  if (Wnd->strName.Length != 0)
1097  {
1098  Result = min(Wnd->strName.Length / sizeof(WCHAR), wParam - 1);
1099  RtlCopyMemory(outbuf,
1100  buf,
1101  Result * sizeof(WCHAR));
1102  outbuf[Result] = L'\0';
1103  }
1104  else
1105  outbuf[0] = L'\0';
1106  }
1107  }
1108  break;
1109  }
1110 
1111  case WM_SETTEXT:
1112  {
1114 
1116  UserPaintCaption(Wnd, DC_TEXT);
1117  Result = 1;
1118  break;
1119  }
1120 
1121  case WM_IME_CHAR:
1122  {
1124  Result = 0;
1125  break;
1126  }
1127 
1128  case WM_IME_KEYDOWN:
1129  {
1131  break;
1132  }
1133 
1134  case WM_IME_KEYUP:
1135  {
1137  break;
1138  }
1139 
1140  case WM_IME_COMPOSITION:
1141  if (lParam & GCS_RESULTSTR)
1142  {
1143  LONG size, i;
1144  WCHAR *buf = NULL;
1145  HIMC himc = ImmGetContext( hWnd );
1146 
1147  if (himc)
1148  {
1149  if ((size = ImmGetCompositionStringW( himc, GCS_RESULTSTR, NULL, 0 )))
1150  {
1151  if (!(buf = HeapAlloc( GetProcessHeap(), 0, size * sizeof(WCHAR) ))) size = 0;
1152  else size = ImmGetCompositionStringW( himc, GCS_RESULTSTR, buf, size * sizeof(WCHAR) );
1153  }
1154  ImmReleaseContext( hWnd, himc );
1155 
1156  for (i = 0; i < size / sizeof(WCHAR); i++)
1157  SendMessageW( hWnd, WM_IME_CHAR, buf[i], 1 );
1158  HeapFree( GetProcessHeap(), 0, buf );
1159  }
1160  }
1161  /* fall through */
1162  case WM_IME_STARTCOMPOSITION:
1163  case WM_IME_ENDCOMPOSITION:
1164  case WM_IME_SELECT:
1165  case WM_IME_NOTIFY:
1166  case WM_IME_CONTROL:
1167  {
1168  HWND hwndIME;
1169 
1170  hwndIME = ImmGetDefaultIMEWnd(hWnd);
1171  if (hwndIME)
1172  Result = SendMessageW(hwndIME, Msg, wParam, lParam);
1173  break;
1174  }
1175 
1176  case WM_IME_SETCONTEXT:
1177  {
1178  HWND hwndIME;
1179 
1180  hwndIME = ImmGetDefaultIMEWnd(hWnd);
1181  if (hwndIME)
1182  Result = ImmIsUIMessageW(hwndIME, Msg, wParam, lParam);
1183  break;
1184  }
1185 
1186  default:
1188  }
1190 
1191  return Result;
1192 }
1193 
1196  UINT Msg,
1197  WPARAM wParam,
1198  LPARAM lParam)
1199 {
1200  BOOL Hook, msgOverride = FALSE;
1201  LRESULT Result = 0;
1202 
1203  LoadUserApiHook();
1204 
1205  Hook = BeginIfHookedUserApiHook();
1206  if (Hook)
1207  {
1208  msgOverride = IsMsgOverride(Msg, &guah.DefWndProcArray);
1209  if(msgOverride == FALSE)
1210  {
1211  EndUserApiHook();
1212  }
1213  }
1214 
1215  /* Bypass SEH and go direct. */
1216  if (!Hook || !msgOverride)
1218 
1219  _SEH2_TRY
1220  {
1222  }
1224  {
1225  ERR("Got exception in hooked DefWindowProcA!\n");
1226  }
1227  _SEH2_END;
1228 
1229  EndUserApiHook();
1230 
1231  return Result;
1232 }
1233 
1236  UINT Msg,
1237  WPARAM wParam,
1238  LPARAM lParam)
1239 {
1240  BOOL Hook, msgOverride = FALSE;
1241  LRESULT Result = 0;
1242 
1243  LoadUserApiHook();
1244 
1245  Hook = BeginIfHookedUserApiHook();
1246  if (Hook)
1247  {
1248  msgOverride = IsMsgOverride(Msg, &guah.DefWndProcArray);
1249  if(msgOverride == FALSE)
1250  {
1251  EndUserApiHook();
1252  }
1253  }
1254 
1255  /* Bypass SEH and go direct. */
1256  if (!Hook || !msgOverride)
1258 
1259  _SEH2_TRY
1260  {
1262  }
1264  {
1265  ERR("Got exception in hooked DefWindowProcW!\n");
1266  }
1267  _SEH2_END;
1268 
1269  EndUserApiHook();
1270 
1271  return Result;
1272 }
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1674
#define WM_SYNCPAINT
Definition: winuser.h:1672
VOID NTAPI RtlInitLargeUnicodeString(IN OUT PLARGE_UNICODE_STRING, IN PCWSTR, IN INT)
Definition: rtlstr.c:42
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
#define WM_GETTEXTLENGTH
Definition: winuser.h:1601
CONST char * PCSZ
Definition: umtypes.h:125
#define WM_IME_KEYUP
Definition: winuser.h:1821
#define WM_SETHOTKEY
Definition: winuser.h:1634
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL FASTCALL EndUserApiHook(VOID)
Definition: usrapihk.c:164
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define WM_IME_NOTIFY
Definition: winuser.h:1812
#define WM_PAINTICON
Definition: winuser.h:1623
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1608
#define COLOR_3DHILIGHT
Definition: winuser.h:927
static HICON
Definition: imagelist.c:84
#define HTHSCROLL
Definition: winuser.h:2456
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define MAKEWPARAM(l, h)
Definition: winuser.h:3948
UINT HideFocus
Definition: ntuser.h:722
#define WM_IME_KEYDOWN
Definition: winuser.h:1820
#define SC_KEYMENU
Definition: winuser.h:2571
#define SC_RESTORE
Definition: winuser.h:2573
long y
Definition: polytest.cpp:48
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_CHAR
Definition: winuser.h:1699
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
#define WideCharToMultiByte
Definition: compat.h:101
#define WM_IME_CHAR
Definition: winuser.h:1816
#define LOBYTE(W)
Definition: jmemdos.c:487
LRESULT WINAPI DefWindowProcW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:1235
long x
Definition: polytest.cpp:48
#define TPM_SYSTEM_MENU
Definition: undocuser.h:71
#define QUERY_WINDOW_FOREGROUND
Definition: ntuser.h:2802
#define MAKEWORD(a, b)
Definition: typedefs.h:247
#define SB_VERT
Definition: winuser.h:553
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
HKL NTAPI NtUserActivateKeyboardLayout(HKL hKl, ULONG Flags)
Definition: kbdlayout.c:705
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CTLCOLORDLG
Definition: winuser.h:1752
#define WM_GETHOTKEY
Definition: winuser.h:1635
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
uint16_t * PWSTR
Definition: typedefs.h:54
#define WM_CLIENTSHUTDOWN
Definition: undocuser.h:35
#define WM_MOUSEWHEEL
Definition: treelist.c:96
#define WM_NCCALCSIZE
Definition: winuser.h:1667
#define CP_ACP
Definition: compat.h:99
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1754
UINT NTAPI GlobalFlags(HGLOBAL hMem)
Definition: heapmem.c:520
#define WM_GETTEXT
Definition: winuser.h:1600
#define SB_HORZ
Definition: winuser.h:552
VOID FASTCALL IntNotifyWinEvent(DWORD Event, PWND pWnd, LONG idObject, LONG idChild, DWORD flags)
Definition: event.c:179
LRESULT FASTCALL DefWndHandleSysCommand(PWND pWnd, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:124
#define WARN(fmt,...)
Definition: debug.h:111
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToMultiByteSize(PULONG MbSize, PCWCH UnicodeString, ULONG UnicodeSize)
USERAPIHOOK guah
Definition: usrapihk.c:344
#define WM_QUERYENDSESSION
Definition: winuser.h:1604
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:27
#define WM_SETREDRAW
Definition: winuser.h:1598
#define SC_SCREENSAVE
Definition: mmsystem.h:933
#define OBJID_WINDOW
Definition: winable.h:15
HWND hWnd
Definition: settings.c:17
#define HIBYTE(W)
Definition: jmemdos.c:486
#define CTLCOLOR_SCROLLBAR
Definition: winuser.h:946
#define WM_IME_SELECT
Definition: winuser.h:1815
PSBINFO pSBInfo
Definition: ntuser.h:690
#define GET_X_LPARAM(lp)
Definition: windowsx.h:274
#define FNID_DEFWINDOWPROC
Definition: ntuser.h:825
#define DCX_USESTYLE
Definition: GetDCEx.c:10
#define MA_ACTIVATE
Definition: winuser.h:2476
LRESULT WINAPI RealDefWindowProcW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:1014
#define WM_SHOWWINDOW
Definition: winuser.h:1610
#define GWL_EXSTYLE
Definition: winuser.h:845
#define WM_NCRBUTTONDOWN
Definition: winuser.h:1677
#define SC_HOTKEY
Definition: winuser.h:2576
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WM_CTLCOLOR
Definition: windowsx.h:4
#define SC_MOUSEMENU
Definition: winuser.h:2570
LRESULT WINAPI DefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:1195
#define WM_NCHITTEST
Definition: winuser.h:1668
static WCHAR String[]
Definition: stringtable.c:55
#define IDI_APPLICATION
Definition: winuser.h:699
UINT_PTR WPARAM
Definition: windef.h:207
#define WS_CHILD
Definition: pedump.c:617
UINT WINAPI DECLSPEC_HOTPATCH WinExec(LPCSTR lpCmdLine, UINT uCmdShow)
Definition: proc.c:4774
#define GetWindowLongPtrW
Definition: winuser.h:4730
#define WM_CTLCOLORLISTBOX
Definition: winuser.h:1750
#define FASTCALL
Definition: nt_native.h:50
#define WM_NCCREATE
Definition: winuser.h:1665
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI DPtoLP(_In_ HDC hdc, _Inout_updates_(c) LPPOINT lppt, _In_ int c)
void SPY_ExitMessage(INT iFlag, HWND hwnd, UINT msg, LRESULT lReturn, WPARAM wParam, LPARAM lParam)
Definition: spy.c:2648
#define COLOR_WINDOW
Definition: winuser.h:908
LRESULT FASTCALL DefWndGetIcon(PWND pWnd, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:472
int32_t INT
Definition: typedefs.h:56
PSERVERINFO gpsi
Definition: main.c:27
WPARAM wParam
Definition: combotst.c:138
#define WM_QUERYDROPOBJECT
Definition: undocuser.h:54
#define DCX_WINDOW
Definition: winuser.h:2095
#define SPY_DEFWNDPROC
Definition: user32p.h:75
LONG WINAPI ImmGetCompositionStringA(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
Definition: imm.c:1459
_SEH2_TRY
Definition: create.c:4250
#define ICON_SMALL
Definition: tnclass.cpp:48
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define SC_TASKLIST
Definition: winuser.h:2574
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:975
#define WM_NCPAINT
Definition: winuser.h:1669
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:3997
BOOL FASTCALL IsMsgOverride(UINT, PUAHOWP)
Definition: usrapihk.c:63
struct tagCREATESTRUCTA * LPCREATESTRUCTA
#define GCL_STYLE
Definition: winuser.h:665
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:93
#define WM_QUERYDRAGICON
Definition: winuser.h:1636
#define TPM_RIGHTBUTTON
Definition: winuser.h:2355
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
uint32_t cs
Definition: isohybrid.c:75
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: imm.c:1716
#define WM_CHARTOITEM
Definition: winuser.h:1631
#define COLOR_3DFACE
Definition: winuser.h:919
LRESULT WINAPI RealDefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:806
static __inline PVOID DesktopPtrToUser(PVOID Ptr)
Definition: user_x.h:12
#define WM_CTLCOLORBTN
Definition: winuser.h:1751
WNDPROC DefWindowProcW
Definition: undocuser.h:332
DWORD dwSRVIFlags
Definition: ntuser.h:1004
#define WM_NCACTIVATE
Definition: winuser.h:1670
WINE_DEFAULT_DEBUG_CHANNEL(user32)
#define WS_MINIMIZE
Definition: pedump.c:622
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_POPUPSYSTEMMENU
Definition: undocuser.h:59
BOOL NTAPI NtUserSetSysColors(int cElements, IN CONST INT *lpaElements, IN CONST COLORREF *lpaRgbValues, FLONG Flags)
Definition: ntstubs.c:311
long LONG
Definition: pedump.c:60
#define WM_NCRBUTTONUP
Definition: winuser.h:1678
#define WM_SETCURSOR
Definition: winuser.h:1618
#define COLOR_SCROLLBAR
Definition: winuser.h:902
static HTREEITEM hRoot
Definition: treeview.c:381
UAHOWP DefWndProcArray
Definition: undocuser.h:333
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define FIXME(fmt,...)
Definition: debug.h:110
#define WM_CTLCOLORSCROLLBAR
Definition: winuser.h:1753
#define WM_SYSCHAR
Definition: winuser.h:1703
#define CHILDID_SELF
Definition: winable.h:14
#define SC_MAXIMIZE
Definition: winuser.h:2563
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
smooth NULL
Definition: ftsmooth.c:416
#define WM_ICONERASEBKGND
Definition: winuser.h:1624
HBRUSH FASTCALL DefWndControlColor(HDC hDC, UINT ctlType)
Definition: defwnd.c:33
#define GCS_RESULTSTR
Definition: imm.h:366
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
BOOL WINAPI IsDBCSLeadByte(BYTE TestByte)
Definition: nls.c:2221
#define WM_KEYDOWN
Definition: winuser.h:1697
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1748
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI IsWindowEnabled(_In_ HWND)
#define WH_CBT
Definition: winuser.h:35
#define WM_MOUSEACTIVATE
Definition: winuser.h:1619
DWORD HIMC
Definition: dimm.idl:75
BOOL WINAPI IsWindowUnicode(_In_ HWND)
#define WM_SETTEXT
Definition: winuser.h:1599
LARGE_UNICODE_STRING strName
Definition: ntuser.h:700
VOID FASTCALL ScrollTrackScrollBar(HWND Wnd, INT SBType, POINT Pt)
Definition: scrollbar.c:1115
UINT HideAccel
Definition: ntuser.h:723
#define WM_RBUTTONDOWN
Definition: winuser.h:1761
#define DECLSPEC_HOTPATCH
Definition: _mingw.h:240
#define DC_ACTIVE
Definition: winuser.h:427
#define WM_APPCOMMAND
Definition: winuser.h:1864
#define UserHMGetHandle(obj)
Definition: ntuser.h:208
#define WS_CAPTION
Definition: pedump.c:624
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
root entry for file system trees
Definition: entries.h:148
BOOL FASTCALL DefSetText(HWND hWnd, PCWSTR String, BOOL Ansi)
Definition: defwnd.c:64
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
VOID NTAPI RtlInitLargeAnsiString(IN OUT PLARGE_ANSI_STRING, IN PCSZ, IN INT)
Definition: rtlstr.c:17
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define NFR_UNICODE
Definition: winuser.h:2434
DWORD COLORREF
Definition: windef.h:285
LONG WINAPI ImmGetCompositionStringW(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
Definition: imm.c:1469
#define WM_IME_SETCONTEXT
Definition: winuser.h:1811
#define COLOR_WINDOWTEXT
Definition: winuser.h:911
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1496
#define WM_NCUAHDRAWCAPTION
Definition: undocuser.h:45
#define WM_IME_CONTROL
Definition: winuser.h:1813
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG _In_ ULONG Action
Definition: fsrtlfuncs.h:738
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
#define WM_CLOSE
Definition: winuser.h:1603
#define ISITHOOKED(HookId)
Definition: hook.h:6
BOOL WINAPI UnrealizeObject(_In_ HGDIOBJ)
HANDLE FASTCALL UserGetProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
Definition: prop.c:46
#define WINAPI
Definition: msvc.h:8
const GLubyte * c
Definition: glext.h:8905
#define WM_KEYUP
Definition: winuser.h:1698
#define CTLCOLOR_EDIT
Definition: winuser.h:942
void SPY_EnterMessage(INT iFlag, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: spy.c:2593
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define Len
Definition: deflate.h:82
#define WM_VKEYTOITEM
Definition: winuser.h:1630
int WINAPI GetClipBox(_In_ HDC, _Out_ LPRECT)
#define SetLastError(x)
Definition: compat.h:409
#define WM_RBUTTONUP
Definition: winuser.h:1762
#define WM_PRINT
Definition: winuser.h:1862
#define WS_HSCROLL
Definition: pedump.c:628
#define SC_PREVWINDOW
Definition: winuser.h:2566
#define WM_PAINT
Definition: winuser.h:1602
WNDPROC DefWindowProcA
Definition: undocuser.h:331
static const WCHAR L[]
Definition: oid.c:1250
static BOOL CALLBACK UserSendUiUpdateMsg(HWND hwnd, LPARAM lParam)
Definition: defwnd.c:248
static VOID DefWndTrackScrollBar(HWND Wnd, WPARAM wParam, POINT Pt)
Definition: defwnd.c:117
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
#define CTLCOLOR_LISTBOX
Definition: winuser.h:943
#define WM_CANCELMODE
Definition: winuser.h:1617
GLenum GLsizei len
Definition: glext.h:6722
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1760
#define SRVINFO_APIHOOK
Definition: ntuser.h:911
#define LRESULT
Definition: ole.h:14
#define WNDS_ACTIVEFRAME
Definition: ntuser.h:579
struct @1580 Msg[]
ATOM atomIconProp
Definition: ntuser.h:1019
#define MA_NOACTIVATE
Definition: winuser.h:2478
UINT_PTR HKL
Definition: msctf.idl:101
BOOL NTAPI NtUserMessageCall(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ResultInfo, DWORD dwType, BOOL Ansi)
Definition: message.c:2323
DWORD WINAPI DECLSPEC_HOTPATCH GetSysColor(int nIndex)
Definition: defwnd.c:22
#define WM_COPYGLOBALDATA
Definition: undocuser.h:36
#define WM_ISACTIVEICON
Definition: undocuser.h:33
Definition: cmtypes.h:240
#define NF_QUERY
Definition: winuser.h:2435
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2253
#define SC_MINIMIZE
Definition: winuser.h:2561
#define ERR(fmt,...)
Definition: debug.h:109
#define HTCAPTION
Definition: winuser.h:2451
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:657
BOOL WINAPI SetSysColors(int cElements, CONST INT *lpaElements, CONST COLORREF *lpaRgbValues)
Definition: defwnd.c:54
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:888
static HDC hDC
Definition: 3dtext.c:33
ULONG_PTR SIZE_T
Definition: typedefs.h:78
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
#define GCL_HICON
Definition: winuser.h:661
#define SW_SHOWNORMAL
Definition: winuser.h:764
_SEH2_END
Definition: create.c:4424
#define WM_ACTIVATE
Definition: winuser.h:1594
HICON hIcon
Definition: msconfig.c:44
#define HKL_NEXT
Definition: winuser.h:109
#define WM_SYSKEYUP
Definition: winuser.h:1702
#define WM_CTLCOLOREDIT
Definition: winuser.h:1749
#define SC_SIZE
Definition: winuser.h:2559
static __inline void LoadUserApiHook()
Definition: user_x.h:85
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
struct tagCREATESTRUCTW * LPCREATESTRUCTW
#define WM_MBUTTONDOWN
Definition: winuser.h:1764
signed char * PSTR
Definition: retypes.h:7
#define NUM_SYSCOLORS
Definition: SetSysColors.c:10
DWORD state
Definition: ntuser.h:665
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
BOOL FASTCALL BeginIfHookedUserApiHook(VOID)
Definition: usrapihk.c:106
#define min(a, b)
Definition: monoChain.cc:55
#define WS_POPUP
Definition: pedump.c:616
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID Owner
Definition: rtlfuncs.h:1557
unsigned int UINT
Definition: ndis.h:50
#define SPY_RESULT_DEFWND
Definition: user32p.h:78
ATOM atomIconSmProp
Definition: ntuser.h:1018
BOOL UserPaintCaption(PWND pWnd, INT Flags)
Definition: defwnd.c:396
#define WS_VSCROLL
Definition: pedump.c:627
HWND FASTCALL IntFindChildWindowToOwner(HWND hRoot, HWND hOwner)
Definition: defwnd.c:82
LRESULT WINAPI DoAppSwitch(WPARAM wParam, LPARAM lParam)
Definition: appswitch.c:601
#define HKL_PREV
Definition: winuser.h:110
#define GCL_HBRBACKGROUND
Definition: winuser.h:659
UINT LastInputWasKbd
Definition: ntuser.h:153
#define NFR_ANSI
Definition: winuser.h:2433
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:275
#define HTVSCROLL
Definition: winuser.h:2457
HWND * WIN_ListChildren(HWND hWndparent)
Definition: mdi.c:140
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1644
#define SC_MOVE
Definition: winuser.h:2560
#define SC_CLOSE
Definition: winuser.h:2567
#define WM_NCUAHDRAWFRAME
Definition: undocuser.h:46
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL NTAPI NtUserDefSetText(HWND WindowHandle, PLARGE_STRING WindowText)
Definition: window.c:4245
#define WM_SYSKEYDOWN
Definition: winuser.h:1701
#define TPM_LEFTBUTTON
Definition: winuser.h:2354
struct _WND * spwndParent
Definition: ntuser.h:677
LRESULT WINAPI User32DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
Definition: defwnd.c:316
#define c
Definition: ke_i.h:80
#define HIWORD(l)
Definition: typedefs.h:246
unsigned int ULONG
Definition: retypes.h:1
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE Child
Definition: acpixf.h:722
#define WA_INACTIVE
Definition: winuser.h:2597
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define SC_NEXTWINDOW
Definition: winuser.h:2565
#define WM_ERASEBKGND
Definition: winuser.h:1607
#define WM_QUERYOPEN
Definition: winuser.h:1606
static __inline PDESKTOPINFO GetThreadDesktopInfo(VOID)
Definition: user_x.h:43
#define WS_EX_ACCEPTFILES
Definition: pedump.c:648
LONG_PTR LRESULT
Definition: windef.h:209
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
#define WS_VISIBLE
Definition: pedump.c:620
BOOL WINAPI ImmIsUIMessageW(HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: imm.c:2146
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define WM_SYSCOMMAND
Definition: winuser.h:1723
#define SC_VSCROLL
Definition: winuser.h:2568
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define LOWORD(l)
Definition: pedump.c:82
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
#define HeapFree(x, y, z)
Definition: compat.h:394
#define GetClassLongPtrW
Definition: winuser.h:4465
#define CONST
Definition: pedump.c:81
#define DC_TEXT
Definition: winuser.h:430
#define CS_PARENTDC
Definition: winuser.h:651
#define WM_KEYF1
Definition: msg.c:52
BOOL NTAPI NtUserDrawCaption(HWND hWnd, HDC hDc, LPCRECT lpRc, UINT uFlags)
Definition: painting.c:2447
BOOL WINAPI ImmIsUIMessageA(HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: imm.c:2124
#define WNDS_HASCAPTION
Definition: ntuser.h:576
struct Rect Rect
#define DC_DRAWCAPTIONMD
Definition: undocuser.h:149
EXTINLINE BOOL NtUserxUpdateUiState(HWND hWnd, DWORD Param)
Definition: ntwrapper.h:686
#define ICON_BIG
Definition: tnclass.cpp:51
#define WM_NCLBUTTONDBLCLK
Definition: winuser.h:1676
HBRUSH WINAPI DECLSPEC_HOTPATCH GetSysColorBrush(int nIndex)
Definition: defwnd.c:39
#define SIF_ALL
Definition: winuser.h:1218
DWORD style
Definition: ntuser.h:670
#define SC_HSCROLL
Definition: winuser.h:2569