ReactOS  0.4.15-dev-4920-g5fa8403
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_DEVICECHANGE:
332  return TRUE;
333 
334  case WM_POPUPSYSTEMMENU:
335  {
336  /* This is an undocumented message used by the windows taskbar to
337  display the system menu of windows that belong to other processes. */
338  HMENU menu = GetSystemMenu(hWnd, FALSE);
339  ERR("WM_POPUPSYSTEMMENU\n");
340  if (menu)
341  {
344  LOWORD(lParam), HIWORD(lParam), 0, hWnd, NULL);
345  }
346  return 0;
347  }
348 
349  case WM_RBUTTONUP:
350  {
351  POINT Pt;
352  Pt.x = GET_X_LPARAM(lParam);
353  Pt.y = GET_Y_LPARAM(lParam);
354  ClientToScreen(hWnd, &Pt);
355  lParam = MAKELPARAM(Pt.x, Pt.y);
356  if (bUnicode)
357  {
359  }
360  else
361  {
363  }
364  break;
365  }
366 
367  case WM_NCRBUTTONUP:
368  /*
369  * FIXME : we must NOT send WM_CONTEXTMENU on a WM_NCRBUTTONUP (checked
370  * in Windows), but what _should_ we do? According to MSDN :
371  * "If it is appropriate to do so, the system sends the WM_SYSCOMMAND
372  * message to the window". When is it appropriate?
373  */
374  ERR("WM_NCRBUTTONUP\n");
375  break;
376 
377  case WM_XBUTTONUP:
378  case WM_NCXBUTTONUP:
379  if (HIWORD(wParam) == XBUTTON1 || HIWORD(wParam) == XBUTTON2)
380  {
382  MAKELPARAM(LOWORD(wParam), FAPPCOMMAND_MOUSE | HIWORD(wParam)));
383  }
384  break;
385 
386  case WM_CONTEXTMENU:
387  {
389  {
390  if (bUnicode)
391  {
393  }
394  else
395  {
397  }
398  }
399  else
400  {
401  goto GoSS;
402  }
403  break;
404  }
405 
406  case WM_CLOSE:
408  return (0);
409 
410  case WM_MOUSEACTIVATE:
412  {
414  if (Ret) return (Ret);
415  }
417 
418  case WM_ACTIVATE:
419  /* The default action in Windows is to set the keyboard focus to
420  * the window, if it's being activated and not minimized */
421  if (LOWORD(wParam) != WA_INACTIVE &&
423  {
424  //ERR("WM_ACTIVATE %p\n",hWnd);
425  SetFocus(hWnd);
426  }
427  break;
428 
429  case WM_MOUSEWHEEL:
432  break;
433 
434  case WM_ERASEBKGND:
435  case WM_ICONERASEBKGND:
436  {
437  RECT Rect;
438  HBRUSH hBrush = (HBRUSH)GetClassLongPtrW(hWnd, GCL_HBRBACKGROUND);
439 
440  if (NULL == hBrush)
441  {
442  return 0;
443  }
445  {
446  /* can't use GetClipBox with a parent DC or we fill the whole parent */
448  DPtoLP((HDC)wParam, (LPPOINT)&Rect, 2);
449  }
450  else
451  {
453  }
454  FillRect((HDC)wParam, &Rect, hBrush);
455  return (1);
456  }
457 
458  case WM_CTLCOLORMSGBOX:
459  case WM_CTLCOLOREDIT:
460  case WM_CTLCOLORLISTBOX:
461  case WM_CTLCOLORBTN:
462  case WM_CTLCOLORDLG:
463  case WM_CTLCOLORSTATIC:
466 
467  case WM_CTLCOLOR:
469 
470  case WM_SYSCOMMAND:
472 
473  case WM_VKEYTOITEM:
474  case WM_CHARTOITEM:
475  return (-1);
476 /*
477  case WM_DROPOBJECT:
478  return DRAG_FILE;
479 */
480  case WM_QUERYDROPOBJECT:
481  {
483  {
484  return(1);
485  }
486  break;
487  }
488 
489  case WM_QUERYDRAGICON:
490  {
491  UINT Len;
492  HICON hIcon;
493 
495  if (hIcon)
496  {
497  return ((LRESULT)hIcon);
498  }
499  for (Len = 1; Len < 64; Len++)
500  {
502  {
503  return((LRESULT)hIcon);
504  }
505  }
506  return ((LRESULT)LoadIconW(0, IDI_APPLICATION));
507  }
508 
509  case WM_ISACTIVEICON:
510  {
511  BOOL isai;
512  isai = (pWnd->state & WNDS_ACTIVEFRAME) != 0;
513  return isai;
514  }
515 
516  case WM_NOTIFYFORMAT:
517  {
518  if (lParam == NF_QUERY)
520  break;
521  }
522 
523  case WM_GETICON:
524  {
525  return DefWndGetIcon(pWnd, wParam, lParam);
526  }
527 
528  case WM_HELP:
529  {
530  if (bUnicode)
531  {
533  }
534  else
535  {
537  }
538  break;
539  }
540 
541  case WM_QUERYOPEN:
542  case WM_QUERYENDSESSION:
543  {
544  return (1);
545  }
546 
547  case WM_INPUTLANGCHANGEREQUEST:
548  {
549  HKL NewHkl;
550 
551  if(wParam & INPUTLANGCHANGE_BACKWARD
552  && wParam & INPUTLANGCHANGE_FORWARD)
553  {
554  return FALSE;
555  }
556 
557  //FIXME: What to do with INPUTLANGCHANGE_SYSCHARSET ?
558 
559  if(wParam & INPUTLANGCHANGE_BACKWARD) NewHkl = (HKL) HKL_PREV;
560  else if(wParam & INPUTLANGCHANGE_FORWARD) NewHkl = (HKL) HKL_NEXT;
561  else NewHkl = (HKL) lParam;
562 
563  NtUserActivateKeyboardLayout(NewHkl, 0);
564 
565  return TRUE;
566  }
567 
568  case WM_INPUTLANGCHANGE:
569  {
570  int count = 0;
571  HWND *win_array = WIN_ListChildren( hWnd );
572 
573  if (!win_array)
574  break;
575  while (win_array[count])
576  SendMessageW( win_array[count++], WM_INPUTLANGCHANGE, wParam, lParam);
577  HeapFree(GetProcessHeap(),0,win_array);
578  break;
579  }
580 
581  case WM_QUERYUISTATE:
582  {
583  LRESULT Ret = 0;
584  PWND Wnd = ValidateHwnd(hWnd);
585  if (Wnd != NULL)
586  {
587  if (Wnd->HideFocus)
588  Ret |= UISF_HIDEFOCUS;
589  if (Wnd->HideAccel)
590  Ret |= UISF_HIDEACCEL;
591  }
592  return Ret;
593  }
594 
595  case WM_CHANGEUISTATE:
596  {
597  BOOL AlwaysShowCues = FALSE;
599  WORD Flags = HIWORD(wParam);
600  PWND Wnd;
601 
602  SystemParametersInfoW(SPI_GETKEYBOARDCUES, 0, &AlwaysShowCues, 0);
603  if (AlwaysShowCues)
604  break;
605 
606  Wnd= ValidateHwnd(hWnd);
607  if (!Wnd || lParam != 0)
608  break;
609 
610  if (Flags & ~(UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE))
611  break;
612 
613  if (Flags & UISF_ACTIVE)
614  {
615  WARN("WM_CHANGEUISTATE does not yet support UISF_ACTIVE!\n");
616  }
617 
618  if (Action == UIS_INITIALIZE)
619  {
621  if (Desk == NULL)
622  break;
623 
624  Action = Desk->LastInputWasKbd ? UIS_CLEAR : UIS_SET;
625  Flags = UISF_HIDEFOCUS | UISF_HIDEACCEL;
626 
627  /* We need to update wParam in case we need to send out messages */
629  }
630 
631  switch (Action)
632  {
633  case UIS_SET:
634  /* See if we actually need to change something */
635  if ((Flags & UISF_HIDEFOCUS) && !Wnd->HideFocus)
636  break;
637  if ((Flags & UISF_HIDEACCEL) && !Wnd->HideAccel)
638  break;
639 
640  /* Don't need to do anything... */
641  return 0;
642 
643  case UIS_CLEAR:
644  /* See if we actually need to change something */
645  if ((Flags & UISF_HIDEFOCUS) && Wnd->HideFocus)
646  break;
647  if ((Flags & UISF_HIDEACCEL) && Wnd->HideAccel)
648  break;
649 
650  /* Don't need to do anything... */
651  return 0;
652 
653  default:
654  WARN("WM_CHANGEUISTATE: Unsupported Action 0x%x\n", Action);
655  break;
656  }
657 
658  if ((Wnd->style & WS_CHILD) && Wnd->spwndParent != NULL)
659  {
660  /* We're a child window and we need to pass this message down until
661  we reach the root */
663  }
664  else
665  {
666  /* We're a top level window, we need to change the UI state */
667  Msg = WM_UPDATEUISTATE;
668  }
669 
670  if (bUnicode)
671  return SendMessageW(hWnd, Msg, wParam, lParam);
672  else
673  return SendMessageA(hWnd, Msg, wParam, lParam);
674  }
675 
676  case WM_UPDATEUISTATE:
677  {
678  BOOL Change = TRUE;
679  BOOL AlwaysShowCues = FALSE;
681  WORD Flags = HIWORD(wParam);
682  PWND Wnd;
683 
684  SystemParametersInfoW(SPI_GETKEYBOARDCUES, 0, &AlwaysShowCues, 0);
685  if (AlwaysShowCues)
686  break;
687 
688  Wnd = ValidateHwnd(hWnd);
689  if (!Wnd || lParam != 0)
690  break;
691 
692  if (Flags & ~(UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE))
693  break;
694 
695  if (Flags & UISF_ACTIVE)
696  {
697  WARN("WM_UPDATEUISTATE does not yet support UISF_ACTIVE!\n");
698  }
699 
700  if (Action == UIS_INITIALIZE)
701  {
703  if (Desk == NULL)
704  break;
705 
706  Action = Desk->LastInputWasKbd ? UIS_CLEAR : UIS_SET;
707  Flags = UISF_HIDEFOCUS | UISF_HIDEACCEL;
708 
709  /* We need to update wParam for broadcasting the update */
711  }
712 
713  switch (Action)
714  {
715  case UIS_SET:
716  /* See if we actually need to change something */
717  if ((Flags & UISF_HIDEFOCUS) && !Wnd->HideFocus)
718  break;
719  if ((Flags & UISF_HIDEACCEL) && !Wnd->HideAccel)
720  break;
721 
722  /* Don't need to do anything... */
723  Change = FALSE;
724  break;
725 
726  case UIS_CLEAR:
727  /* See if we actually need to change something */
728  if ((Flags & UISF_HIDEFOCUS) && Wnd->HideFocus)
729  break;
730  if ((Flags & UISF_HIDEACCEL) && Wnd->HideAccel)
731  break;
732 
733  /* Don't need to do anything... */
734  Change = FALSE;
735  break;
736 
737  default:
738  WARN("WM_UPDATEUISTATE: Unsupported Action 0x%x\n", Action);
739  return 0;
740  }
741 
742  /* Pack the information and call win32k */
743  if (Change)
744  {
745  if (!NtUserxUpdateUiState(hWnd, Flags | ((DWORD)Action << 3)))
746  break;
747  }
748 
749  /* Always broadcast the update to all children */
752  (LPARAM)wParam);
753 
754  break;
755  }
756 
757  case WM_COPYGLOBALDATA:
758  {
759  TRACE("WM_COPYGLOBALDATA hGlobal %p Size %d Flags 0x%x\n",lParam,wParam,GlobalFlags((HGLOBAL)lParam));
760  return lParam;
761  }
762 
763 /* Move to Win32k !*/
764  case WM_SHOWWINDOW:
765  if (!lParam) break; // Call when it is necessary.
766  case WM_LBUTTONDOWN:
767  case WM_RBUTTONDOWN:
768  case WM_MBUTTONDOWN:
769  case WM_NCLBUTTONDOWN:
770  case WM_NCRBUTTONDOWN:
771  case WM_LBUTTONDBLCLK:
772  case WM_NCLBUTTONDBLCLK:
773  case WM_KEYF1:
774  case WM_KEYUP:
775  case WM_SYSKEYUP:
776  case WM_KEYDOWN:
777  case WM_SYSKEYDOWN:
778  case WM_SYSCHAR:
779  case WM_CANCELMODE:
780  case WM_PAINTICON:
781  case WM_PAINT:
782  case WM_PRINT:
783  case WM_SETICON:
784  case WM_SYSCOLORCHANGE:
785  case WM_NCUAHDRAWCAPTION:
786  case WM_NCUAHDRAWFRAME:
787  case WM_NCPAINT:
788  case WM_NCACTIVATE:
789  case WM_NCCALCSIZE:
790  case WM_NCHITTEST:
791  case WM_SYNCPAINT:
792  case WM_SETREDRAW:
793  case WM_CLIENTSHUTDOWN:
794  case WM_GETHOTKEY:
795  case WM_SETHOTKEY:
797  case WM_WINDOWPOSCHANGED:
798  case WM_APPCOMMAND:
799  case WM_SETCURSOR:
800 GoSS:
801  {
802  LRESULT lResult;
803  NtUserMessageCall( hWnd, Msg, wParam, lParam, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, !bUnicode);
804  return lResult;
805  }
806  }
807  return 0;
808 }
809 
810 
813  UINT Msg,
814  WPARAM wParam,
815  LPARAM lParam)
816 {
817  LRESULT Result = 0;
818  PWND Wnd;
819 
820  Wnd = ValidateHwnd(hWnd);
821 
822  if ( !Wnd &&
823  Msg != WM_CTLCOLORMSGBOX &&
824  Msg != WM_CTLCOLORBTN &&
825  Msg != WM_CTLCOLORDLG &&
827  return 0;
828 
830  switch (Msg)
831  {
832  case WM_NCCREATE:
833  {
834  if ( Wnd &&
835  Wnd->style & (WS_HSCROLL | WS_VSCROLL) )
836  {
837  if (!Wnd->pSBInfo)
838  {
839  SCROLLINFO si = {sizeof si, SIF_ALL, 0, 100, 0, 0, 0};
840  SetScrollInfo( hWnd, SB_HORZ, &si, FALSE );
841  SetScrollInfo( hWnd, SB_VERT, &si, FALSE );
842  }
843  }
844 
845  if (lParam)
846  {
848  /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
849  * may have child window IDs instead of window name */
850  if (HIWORD(cs->lpszName))
851  {
852  DefSetText(hWnd, (PCWSTR)cs->lpszName, TRUE);
853  }
854  Result = 1;
855  }
856  break;
857  }
858 
859  case WM_GETTEXTLENGTH:
860  {
861  PWSTR buf;
862  ULONG len;
863 
864  if (Wnd != NULL && Wnd->strName.Length != 0)
865  {
867  if (buf != NULL &&
869  buf,
870  Wnd->strName.Length)))
871  {
872  Result = (LRESULT) len;
873  }
874  }
875  else Result = 0L;
876 
877  break;
878  }
879 
880  case WM_GETTEXT:
881  {
882  PWSTR buf = NULL;
883  PSTR outbuf = (PSTR)lParam;
884  SIZE_T copy;
885 
886  if (Wnd != NULL && wParam != 0)
887  {
888  if (Wnd->strName.Buffer != NULL)
890  else
891  outbuf[0] = L'\0';
892 
893  if (buf != NULL)
894  {
895  if (Wnd->strName.Length != 0)
896  {
897  copy = min(Wnd->strName.Length / sizeof(WCHAR), wParam - 1);
899  0,
900  buf,
901  copy,
902  outbuf,
903  wParam,
904  NULL,
905  NULL);
906  outbuf[Result] = '\0';
907  }
908  else
909  outbuf[0] = '\0';
910  }
911  }
912  break;
913  }
914 
915  case WM_SETTEXT:
916  {
918 
920  {
922  IntNotifyWinEvent(EVENT_OBJECT_NAMECHANGE, hWnd, OBJID_WINDOW, CHILDID_SELF, 0);
923  }
924  Result = 1;
925  break;
926  }
927 
928  case WM_IME_KEYDOWN:
929  {
931  break;
932  }
933 
934  case WM_IME_KEYUP:
935  {
937  break;
938  }
939 
940  case WM_IME_CHAR:
941  {
942  if (HIBYTE(wParam))
945  break;
946  }
947 
948  case WM_IME_COMPOSITION:
949  if (lParam & GCS_RESULTSTR)
950  {
951  LONG size, i;
952  unsigned char lead = 0;
953  char *buf = NULL;
954  HIMC himc = IMM_FN(ImmGetContext)( hWnd );
955 
956  if (himc)
957  {
958  if ((size = IMM_FN(ImmGetCompositionStringA)( himc, GCS_RESULTSTR, NULL, 0 )))
959  {
960  if (!(buf = HeapAlloc( GetProcessHeap(), 0, size ))) size = 0;
962  }
963  IMM_FN(ImmReleaseContext)( hWnd, himc );
964 
965  for (i = 0; i < size; i++)
966  {
967  unsigned char c = buf[i];
968  if (!lead)
969  {
970  if (IsDBCSLeadByte( c ))
971  lead = c;
972  else
973  SendMessageA( hWnd, WM_IME_CHAR, c, 1 );
974  }
975  else
976  {
977  SendMessageA( hWnd, WM_IME_CHAR, MAKEWORD(c, lead), 1 );
978  lead = 0;
979  }
980  }
981  HeapFree( GetProcessHeap(), 0, buf );
982  }
983  }
984  /* fall through */
985  case WM_IME_STARTCOMPOSITION:
986  case WM_IME_ENDCOMPOSITION:
987  case WM_IME_SELECT:
988  case WM_IME_NOTIFY:
989  case WM_IME_CONTROL:
990  {
991  HWND hwndIME;
992 
993  hwndIME = IMM_FN(ImmGetDefaultIMEWnd)(hWnd);
994  if (hwndIME)
995  Result = SendMessageA(hwndIME, Msg, wParam, lParam);
996  break;
997  }
998 
999  case WM_IME_SETCONTEXT:
1000  {
1001  HWND hwndIME;
1002 
1003  hwndIME = IMM_FN(ImmGetDefaultIMEWnd)(hWnd);
1004  if (hwndIME)
1005  Result = SendMessageA(hwndIME, Msg, wParam, lParam);
1006  break;
1007  }
1008 
1009  /* fall through */
1010  default:
1012  }
1013 
1015  return Result;
1016 }
1017 
1018 
1021  UINT Msg,
1022  WPARAM wParam,
1023  LPARAM lParam)
1024 {
1025  LRESULT Result = 0;
1026  PWND Wnd;
1027 
1028  Wnd = ValidateHwnd(hWnd);
1029 
1030  if ( !Wnd &&
1031  Msg != WM_CTLCOLORMSGBOX &&
1032  Msg != WM_CTLCOLORBTN &&
1033  Msg != WM_CTLCOLORDLG &&
1034  Msg != WM_CTLCOLORSTATIC )
1035  return 0;
1036 
1038  switch (Msg)
1039  {
1040  case WM_NCCREATE:
1041  {
1042  if ( Wnd &&
1043  Wnd->style & (WS_HSCROLL | WS_VSCROLL) )
1044  {
1045  if (!Wnd->pSBInfo)
1046  {
1047  SCROLLINFO si = {sizeof si, SIF_ALL, 0, 100, 0, 0, 0};
1048  if (Wnd->style & WS_HSCROLL)
1049  SetScrollInfo( hWnd, SB_HORZ, &si, FALSE );
1050  if (Wnd->style & WS_VSCROLL)
1051  SetScrollInfo( hWnd, SB_VERT, &si, FALSE );
1052  }
1053  }
1054 
1055  if (lParam)
1056  {
1058  /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
1059  * may have child window IDs instead of window name */
1060  if (HIWORD(cs->lpszName))
1061  {
1062  DefSetText(hWnd, cs->lpszName, FALSE);
1063  }
1064  Result = 1;
1065  }
1066  break;
1067  }
1068 
1069  case WM_GETTEXTLENGTH:
1070  {
1071  PWSTR buf;
1072  ULONG len;
1073 
1074  if (Wnd != NULL && Wnd->strName.Length != 0)
1075  {
1077  if (buf != NULL &&
1079  buf,
1080  Wnd->strName.Length)))
1081  {
1082  Result = (LRESULT) (Wnd->strName.Length / sizeof(WCHAR));
1083  }
1084  }
1085  else Result = 0L;
1086 
1087  break;
1088  }
1089 
1090  case WM_GETTEXT:
1091  {
1092  PWSTR buf = NULL;
1093  PWSTR outbuf = (PWSTR)lParam;
1094 
1095  if (Wnd != NULL && wParam != 0)
1096  {
1097  if (Wnd->strName.Buffer != NULL)
1099  else
1100  outbuf[0] = L'\0';
1101 
1102  if (buf != NULL)
1103  {
1104  if (Wnd->strName.Length != 0)
1105  {
1106  Result = min(Wnd->strName.Length / sizeof(WCHAR), wParam - 1);
1107  RtlCopyMemory(outbuf,
1108  buf,
1109  Result * sizeof(WCHAR));
1110  outbuf[Result] = L'\0';
1111  }
1112  else
1113  outbuf[0] = L'\0';
1114  }
1115  }
1116  break;
1117  }
1118 
1119  case WM_SETTEXT:
1120  {
1122 
1124  UserPaintCaption(Wnd, DC_TEXT);
1125  Result = 1;
1126  break;
1127  }
1128 
1129  case WM_IME_CHAR:
1130  {
1132  Result = 0;
1133  break;
1134  }
1135 
1136  case WM_IME_KEYDOWN:
1137  {
1139  break;
1140  }
1141 
1142  case WM_IME_KEYUP:
1143  {
1145  break;
1146  }
1147 
1148  case WM_IME_COMPOSITION:
1149  if (lParam & GCS_RESULTSTR)
1150  {
1151  LONG size, i;
1152  WCHAR *buf = NULL;
1153  HIMC himc = IMM_FN(ImmGetContext)( hWnd );
1154 
1155  if (himc)
1156  {
1157  if ((size = IMM_FN(ImmGetCompositionStringW)( himc, GCS_RESULTSTR, NULL, 0 )))
1158  {
1159  if (!(buf = HeapAlloc( GetProcessHeap(), 0, size * sizeof(WCHAR) ))) size = 0;
1160  else size = IMM_FN(ImmGetCompositionStringW)( himc, GCS_RESULTSTR, buf, size * sizeof(WCHAR) );
1161  }
1162  IMM_FN(ImmReleaseContext)( hWnd, himc );
1163 
1164  for (i = 0; i < size / sizeof(WCHAR); i++)
1165  SendMessageW( hWnd, WM_IME_CHAR, buf[i], 1 );
1166  HeapFree( GetProcessHeap(), 0, buf );
1167  }
1168  }
1169  /* fall through */
1170  case WM_IME_STARTCOMPOSITION:
1171  case WM_IME_ENDCOMPOSITION:
1172  case WM_IME_SELECT:
1173  case WM_IME_NOTIFY:
1174  case WM_IME_CONTROL:
1175  {
1176  HWND hwndIME;
1177 
1178  hwndIME = IMM_FN(ImmGetDefaultIMEWnd)(hWnd);
1179  if (hwndIME)
1180  Result = SendMessageW(hwndIME, Msg, wParam, lParam);
1181  break;
1182  }
1183 
1184  case WM_IME_SETCONTEXT:
1185  {
1186  HWND hwndIME;
1187 
1188  hwndIME = IMM_FN(ImmGetDefaultIMEWnd)(hWnd);
1189  if (hwndIME)
1190  Result = SendMessageW(hwndIME, Msg, wParam, lParam);
1191  break;
1192  }
1193 
1194  default:
1196  }
1198 
1199  return Result;
1200 }
1201 
1204  UINT Msg,
1205  WPARAM wParam,
1206  LPARAM lParam)
1207 {
1208  BOOL Hook, msgOverride = FALSE;
1209  LRESULT Result = 0;
1210 
1211  LoadUserApiHook();
1212 
1213  Hook = BeginIfHookedUserApiHook();
1214  if (Hook)
1215  {
1216  msgOverride = IsMsgOverride(Msg, &guah.DefWndProcArray);
1217  if(msgOverride == FALSE)
1218  {
1219  EndUserApiHook();
1220  }
1221  }
1222 
1223  /* Bypass SEH and go direct. */
1224  if (!Hook || !msgOverride)
1226 
1227  _SEH2_TRY
1228  {
1230  }
1232  {
1233  ERR("Got exception in hooked DefWindowProcA!\n");
1234  }
1235  _SEH2_END;
1236 
1237  EndUserApiHook();
1238 
1239  return Result;
1240 }
1241 
1244  UINT Msg,
1245  WPARAM wParam,
1246  LPARAM lParam)
1247 {
1248  BOOL Hook, msgOverride = FALSE;
1249  LRESULT Result = 0;
1250 
1251  LoadUserApiHook();
1252 
1253  Hook = BeginIfHookedUserApiHook();
1254  if (Hook)
1255  {
1256  msgOverride = IsMsgOverride(Msg, &guah.DefWndProcArray);
1257  if(msgOverride == FALSE)
1258  {
1259  EndUserApiHook();
1260  }
1261  }
1262 
1263  /* Bypass SEH and go direct. */
1264  if (!Hook || !msgOverride)
1266 
1267  _SEH2_TRY
1268  {
1270  }
1272  {
1273  ERR("Got exception in hooked DefWindowProcW!\n");
1274  }
1275  _SEH2_END;
1276 
1277  EndUserApiHook();
1278 
1279  return Result;
1280 }
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1679
#define WM_SYNCPAINT
Definition: winuser.h:1677
VOID NTAPI RtlInitLargeUnicodeString(IN OUT PLARGE_UNICODE_STRING, IN PCWSTR, IN INT)
Definition: rtlstr.c:42
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
#define WM_GETTEXTLENGTH
Definition: winuser.h:1606
CONST char * PCSZ
Definition: umtypes.h:125
#define WM_IME_KEYUP
Definition: winuser.h:1826
#define WM_SETHOTKEY
Definition: winuser.h:1639
BOOL FASTCALL EndUserApiHook(VOID)
Definition: usrapihk.c:164
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define WM_IME_NOTIFY
Definition: winuser.h:1817
#define WM_PAINTICON
Definition: winuser.h:1628
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1613
#define COLOR_3DHILIGHT
Definition: winuser.h:931
static HICON
Definition: imagelist.c:84
LONG WINAPI ImmGetCompositionStringA(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
Definition: compstr.c:850
#define HTHSCROLL
Definition: winuser.h:2461
#define MAKEWPARAM(l, h)
Definition: winuser.h:3989
UINT HideFocus
Definition: ntuser.h:737
#define WM_IME_KEYDOWN
Definition: winuser.h:1825
#define SC_KEYMENU
Definition: winuser.h:2576
#define SC_RESTORE
Definition: winuser.h:2578
long y
Definition: polytest.cpp:48
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_CHAR
Definition: winuser.h:1704
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
#define WM_LBUTTONDOWN
Definition: winuser.h:1763
#define WideCharToMultiByte
Definition: compat.h:111
#define WM_IME_CHAR
Definition: winuser.h:1821
#define LOBYTE(W)
Definition: jmemdos.c:487
LRESULT WINAPI DefWindowProcW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:1243
long x
Definition: polytest.cpp:48
#define TPM_SYSTEM_MENU
Definition: undocuser.h:72
#define QUERY_WINDOW_FOREGROUND
Definition: ntuser.h:2925
#define MAKEWORD(a, b)
Definition: typedefs.h:248
#define SB_VERT
Definition: winuser.h:553
HKL NTAPI NtUserActivateKeyboardLayout(HKL hKl, ULONG Flags)
Definition: kbdlayout.c:825
#define TRUE
Definition: types.h:120
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CTLCOLORDLG
Definition: winuser.h:1757
#define WM_GETHOTKEY
Definition: winuser.h:1640
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
uint16_t * PWSTR
Definition: typedefs.h:56
#define WM_CLIENTSHUTDOWN
Definition: undocuser.h:35
#define WM_MOUSEWHEEL
Definition: treelist.c:96
#define WM_NCCALCSIZE
Definition: winuser.h:1672
#define CP_ACP
Definition: compat.h:109
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1759
UINT NTAPI GlobalFlags(HGLOBAL hMem)
Definition: heapmem.c:520
#define WM_GETTEXT
Definition: winuser.h:1605
#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:112
#define MAKELPARAM(l, h)
Definition: winuser.h:3988
USERAPIHOOK guah
Definition: usrapihk.c:344
#define WM_QUERYENDSESSION
Definition: winuser.h:1609
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:35
#define WM_SETREDRAW
Definition: winuser.h:1603
PSERVERINFO gpsi
Definition: imm.c:17
#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:950
#define WM_IME_SELECT
Definition: winuser.h:1820
PSBINFO pSBInfo
Definition: ntuser.h:705
#define GET_X_LPARAM(lp)
Definition: windowsx.h:274
#define FNID_DEFWINDOWPROC
Definition: ntuser.h:842
#define DCX_USESTYLE
Definition: GetDCEx.c:10
#define MA_ACTIVATE
Definition: winuser.h:2481
LRESULT WINAPI RealDefWindowProcW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:1020
#define WM_SHOWWINDOW
Definition: winuser.h:1615
#define GWL_EXSTYLE
Definition: winuser.h:845
#define WM_NCRBUTTONDOWN
Definition: winuser.h:1682
#define SC_HOTKEY
Definition: winuser.h:2581
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WM_CTLCOLOR
Definition: windowsx.h:4
#define SC_MOUSEMENU
Definition: winuser.h:2575
LRESULT WINAPI DefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:1203
#define WM_NCHITTEST
Definition: winuser.h:1673
#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:4775
#define GetWindowLongPtrW
Definition: winuser.h:4809
#define WM_CTLCOLORLISTBOX
Definition: winuser.h:1755
#define FASTCALL
Definition: nt_native.h:50
#define WM_NCCREATE
Definition: winuser.h:1670
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:912
LRESULT FASTCALL DefWndGetIcon(PWND pWnd, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:472
int32_t INT
Definition: typedefs.h:58
WPARAM wParam
Definition: combotst.c:138
#define WM_QUERYDROPOBJECT
Definition: undocuser.h:54
#define DCX_WINDOW
Definition: winuser.h:2100
#define SPY_DEFWNDPROC
Definition: user32p.h:69
_SEH2_TRY
Definition: create.c:4226
#define ICON_SMALL
Definition: tnclass.cpp:48
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define SC_TASKLIST
Definition: winuser.h:2579
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
#define WM_NCPAINT
Definition: winuser.h:1674
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:4172
BOOL FASTCALL IsMsgOverride(UINT, PUAHOWP)
Definition: usrapihk.c:63
struct tagCREATESTRUCTA * LPCREATESTRUCTA
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define GCL_STYLE
Definition: winuser.h:665
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
#define WM_QUERYDRAGICON
Definition: winuser.h:1641
#define TPM_RIGHTBUTTON
Definition: winuser.h:2360
uint32_t cs
Definition: isohybrid.c:75
#define L(x)
Definition: ntvdm.h:50
#define WM_CHARTOITEM
Definition: winuser.h:1636
#define COLOR_3DFACE
Definition: winuser.h:923
LRESULT WINAPI RealDefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:812
#define WM_CTLCOLORBTN
Definition: winuser.h:1756
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
WNDPROC DefWindowProcW
Definition: undocuser.h:339
#define FALSE
Definition: types.h:117
DWORD dwSRVIFlags
Definition: ntuser.h:1022
#define WM_NCACTIVATE
Definition: winuser.h:1675
WINE_DEFAULT_DEBUG_CHANNEL(user32)
#define WS_MINIMIZE
Definition: pedump.c:622
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:533
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_POPUPSYSTEMMENU
Definition: undocuser.h:60
BOOL NTAPI NtUserSetSysColors(int cElements, IN CONST INT *lpaElements, IN CONST COLORREF *lpaRgbValues, FLONG Flags)
Definition: ntstubs.c:288
long LONG
Definition: pedump.c:60
#define WM_NCRBUTTONUP
Definition: winuser.h:1683
#define WM_SETCURSOR
Definition: winuser.h:1623
#define COLOR_SCROLLBAR
Definition: winuser.h:906
static HTREEITEM hRoot
Definition: treeview.c:381
UAHOWP DefWndProcArray
Definition: undocuser.h:340
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define FIXME(fmt,...)
Definition: debug.h:111
#define WM_CTLCOLORSCROLLBAR
Definition: winuser.h:1758
#define WM_SYSCHAR
Definition: winuser.h:1708
#define CHILDID_SELF
Definition: winable.h:14
#define SC_MAXIMIZE
Definition: winuser.h:2568
struct _WND * spwndOwner
Definition: ntuser.h:694
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
#define WM_ICONERASEBKGND
Definition: winuser.h:1629
HBRUSH FASTCALL DefWndControlColor(HDC hDC, UINT ctlType)
Definition: defwnd.c:33
_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:2270
#define WM_KEYDOWN
Definition: winuser.h:1702
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1753
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:1624
DWORD HIMC
Definition: dimm.idl:75
BOOL WINAPI IsWindowUnicode(_In_ HWND)
#define WM_SETTEXT
Definition: winuser.h:1604
LARGE_UNICODE_STRING strName
Definition: ntuser.h:715
VOID FASTCALL ScrollTrackScrollBar(HWND Wnd, INT SBType, POINT Pt)
Definition: scrollbar.c:1156
UINT HideAccel
Definition: ntuser.h:738
#define WM_RBUTTONDOWN
Definition: winuser.h:1766
#define DECLSPEC_HOTPATCH
Definition: _mingw.h:243
#define DC_ACTIVE
Definition: winuser.h:427
#define WM_APPCOMMAND
Definition: winuser.h:1869
#define UserHMGetHandle(obj)
Definition: ntuser.h:222
#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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI ImmGetCompositionStringW(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
Definition: compstr.c:892
__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:2439
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
DWORD COLORREF
Definition: windef.h:300
#define WM_IME_SETCONTEXT
Definition: winuser.h:1816
#define COLOR_WINDOWTEXT
Definition: winuser.h:915
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1010
#define WM_NCUAHDRAWCAPTION
Definition: undocuser.h:45
#define WM_IME_CONTROL
Definition: winuser.h:1818
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1648
#define WM_CLOSE
Definition: winuser.h:1608
#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:6
const GLubyte * c
Definition: glext.h:8905
#define WM_KEYUP
Definition: winuser.h:1703
#define CTLCOLOR_EDIT
Definition: winuser.h:946
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:1635
int WINAPI GetClipBox(_In_ HDC, _Out_ LPRECT)
#define SetLastError(x)
Definition: compat.h:611
#define WM_RBUTTONUP
Definition: winuser.h:1767
#define WM_PRINT
Definition: winuser.h:1867
#define WS_HSCROLL
Definition: pedump.c:628
#define SC_PREVWINDOW
Definition: winuser.h:2571
#define WM_PAINT
Definition: winuser.h:1607
WNDPROC DefWindowProcA
Definition: undocuser.h:338
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
#define CTLCOLOR_LISTBOX
Definition: winuser.h:947
#define WM_CANCELMODE
Definition: winuser.h:1622
GLenum GLsizei len
Definition: glext.h:6722
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1765
#define SRVINFO_APIHOOK
Definition: ntuser.h:929
#define LRESULT
Definition: ole.h:14
#define WNDS_ACTIVEFRAME
Definition: ntuser.h:594
ATOM atomIconProp
Definition: ntuser.h:1037
#define MA_NOACTIVATE
Definition: winuser.h:2483
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:2486
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:247
#define NF_QUERY
Definition: winuser.h:2440
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:1051
#define SC_MINIMIZE
Definition: winuser.h:2566
#define ERR(fmt,...)
Definition: debug.h:110
#define HTCAPTION
Definition: winuser.h:2456
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:672
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:911
static HDC hDC
Definition: 3dtext.c:33
ULONG_PTR SIZE_T
Definition: typedefs.h:80
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:4400
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: ime.c:818
#define WM_ACTIVATE
Definition: winuser.h:1599
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
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:506
HICON hIcon
Definition: msconfig.c:44
#define HKL_NEXT
Definition: winuser.h:109
_Use_decl_annotations_ NTSTATUS NTAPI RtlUnicodeToMultiByteSize(_Out_ PULONG MbSize, _In_ PCWCH UnicodeString, _In_ ULONG UnicodeSize)
Definition: nlsboot.c:145
#define WM_SYSKEYUP
Definition: winuser.h:1707
#define WM_CTLCOLOREDIT
Definition: winuser.h:1754
#define SC_SIZE
Definition: winuser.h:2564
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:1769
signed char * PSTR
Definition: retypes.h:7
#define NUM_SYSCOLORS
Definition: SetSysColors.c:10
DWORD state
Definition: ntuser.h:680
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:1583
unsigned int UINT
Definition: ndis.h:50
#define SPY_RESULT_DEFWND
Definition: user32p.h:72
#define NULL
Definition: types.h:112
ATOM atomIconSmProp
Definition: ntuser.h:1036
BOOL UserPaintCaption(PWND pWnd, INT Flags)
Definition: defwnd.c:396
static PVOID FASTCALL DesktopPtrToUser(PVOID ptr)
Definition: utils.c:278
#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:584
#define HKL_PREV
Definition: winuser.h:110
#define GCL_HBRBACKGROUND
Definition: winuser.h:659
UINT LastInputWasKbd
Definition: ntuser.h:150
#define WM_DEVICECHANGE
Definition: winuser.h:1798
#define NFR_ANSI
Definition: winuser.h:2438
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:275
#define HTVSCROLL
Definition: winuser.h:2462
HWND * WIN_ListChildren(HWND hWndparent)
Definition: mdi.c:140
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1649
#define SC_MOVE
Definition: winuser.h:2565
#define SC_CLOSE
Definition: winuser.h:2572
#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:4450
#define WM_SYSKEYDOWN
Definition: winuser.h:1706
#define TPM_LEFTBUTTON
Definition: winuser.h:2359
struct _WND * spwndParent
Definition: ntuser.h:692
LRESULT WINAPI User32DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
Definition: defwnd.c:316
struct @1589 Msg[]
#define HIWORD(l)
Definition: typedefs.h:247
unsigned int ULONG
Definition: retypes.h:1
#define GCS_RESULTSTR
Definition: imm.h:374
BOOL WINAPI SetForegroundWindow(_In_ HWND)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define WA_INACTIVE
Definition: winuser.h:2602
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define SC_NEXTWINDOW
Definition: winuser.h:2570
#define WM_ERASEBKGND
Definition: winuser.h:1612
#define WM_QUERYOPEN
Definition: winuser.h:1611
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
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
#define WS_VISIBLE
Definition: pedump.c:620
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:1728
#define SC_VSCROLL
Definition: winuser.h:2573
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:594
#define GetClassLongPtrW
Definition: winuser.h:4544
#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:47
BOOL NTAPI NtUserDrawCaption(HWND hWnd, HDC hDc, LPCRECT lpRc, UINT uFlags)
Definition: painting.c:2462
#define WNDS_HASCAPTION
Definition: ntuser.h:591
struct Rect Rect
#define DC_DRAWCAPTIONMD
Definition: undocuser.h:150
EXTINLINE BOOL NtUserxUpdateUiState(HWND hWnd, DWORD Param)
Definition: ntwrapper.h:686
#define ICON_BIG
Definition: tnclass.cpp:51
#define WM_NCLBUTTONDBLCLK
Definition: winuser.h:1681
HBRUSH WINAPI DECLSPEC_HOTPATCH GetSysColorBrush(int nIndex)
Definition: defwnd.c:39
#define SIF_ALL
Definition: winuser.h:1222
#define ValidateHwnd(hwnd)
Definition: precomp.h:85
#define IMM_FN(name)
Definition: user32p.h:56
DWORD style
Definition: ntuser.h:685
#define SC_HSCROLL
Definition: winuser.h:2574