ReactOS  0.4.15-dev-1206-g731eddf
defwnd.c File Reference
#include <user32.h>
Include dependency graph for defwnd.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (user32)
 
DWORD WINAPI DECLSPEC_HOTPATCH GetSysColor (int nIndex)
 
HBRUSH WINAPI DECLSPEC_HOTPATCH GetSysColorBrush (int nIndex)
 
BOOL WINAPI SetSysColors (int cElements, CONST INT *lpaElements, CONST COLORREF *lpaRgbValues)
 
BOOL FASTCALL DefSetText (HWND hWnd, PCWSTR String, BOOL Ansi)
 
HWND FASTCALL IntFindChildWindowToOwner (HWND hRoot, HWND hOwner)
 
static VOID DefWndTrackScrollBar (HWND Wnd, WPARAM wParam, POINT Pt)
 
LRESULT WINAPI DoAppSwitch (WPARAM wParam, LPARAM lParam)
 
LRESULT DefWndHandleSysCommand (HWND hWnd, WPARAM wParam, LPARAM lParam)
 
HBRUSH DefWndControlColor (HDC hDC, UINT ctlType)
 
static BOOL CALLBACK UserSendUiUpdateMsg (HWND hwnd, LPARAM lParam)
 
static void UserPaintCaption (PWND pwnd, INT Flags)
 
LRESULT FASTCALL DefWndGetIcon (PWND pWnd, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI User32DefWindowProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
 
LRESULT WINAPI RealDefWindowProcA (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI RealDefWindowProcW (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI DefWindowProcA (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI DefWindowProcW (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 

Function Documentation

◆ DefSetText()

BOOL FASTCALL DefSetText ( HWND  hWnd,
PCWSTR  String,
BOOL  Ansi 
)

Definition at line 64 of file defwnd.c.

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 }
VOID NTAPI RtlInitLargeUnicodeString(IN OUT PLARGE_UNICODE_STRING, IN PCWSTR, IN INT)
Definition: rtlstr.c:42
CONST char * PCSZ
Definition: umtypes.h:125
HWND hWnd
Definition: settings.c:17
static WCHAR String[]
Definition: stringtable.c:55
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI RtlInitLargeAnsiString(IN OUT PLARGE_ANSI_STRING, IN PCSZ, IN INT)
Definition: rtlstr.c:17
BOOL NTAPI NtUserDefSetText(HWND WindowHandle, PLARGE_STRING WindowText)
Definition: window.c:4192

Referenced by IntDefWindowProc(), RealDefWindowProcA(), and RealDefWindowProcW().

◆ DefWindowProcA()

LRESULT WINAPI DefWindowProcA ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1200 of file defwnd.c.

1204 {
1205  BOOL Hook, msgOverride = FALSE;
1206  LRESULT Result = 0;
1207 
1208  LoadUserApiHook();
1209 
1210  Hook = BeginIfHookedUserApiHook();
1211  if (Hook)
1212  {
1213  msgOverride = IsMsgOverride(Msg, &guah.DefWndProcArray);
1214  if(msgOverride == FALSE)
1215  {
1216  EndUserApiHook();
1217  }
1218  }
1219 
1220  /* Bypass SEH and go direct. */
1221  if (!Hook || !msgOverride)
1223 
1224  _SEH2_TRY
1225  {
1227  }
1229  {
1230  ERR("Got exception in hooked DefWindowProcA!\n");
1231  }
1232  _SEH2_END;
1233 
1234  EndUserApiHook();
1235 
1236  return Result;
1237 }
BOOL FASTCALL EndUserApiHook(VOID)
Definition: usrapihk.c:164
USERAPIHOOK guah
Definition: usrapihk.c:344
HWND hWnd
Definition: settings.c:17
struct @1610 Msg[]
WPARAM wParam
Definition: combotst.c:138
_SEH2_TRY
Definition: create.c:4226
BOOL FASTCALL IsMsgOverride(UINT, PUAHOWP)
Definition: usrapihk.c:63
LRESULT WINAPI RealDefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:809
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
UAHOWP DefWndProcArray
Definition: undocuser.h:333
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
_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
WNDPROC DefWindowProcA
Definition: undocuser.h:331
#define ERR(fmt,...)
Definition: debug.h:110
_SEH2_END
Definition: create.c:4400
static __inline void LoadUserApiHook()
Definition: user_x.h:85
BOOL FASTCALL BeginIfHookedUserApiHook(VOID)
Definition: usrapihk.c:106
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

◆ DefWindowProcW()

LRESULT WINAPI DefWindowProcW ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1240 of file defwnd.c.

1244 {
1245  BOOL Hook, msgOverride = FALSE;
1246  LRESULT Result = 0;
1247 
1248  LoadUserApiHook();
1249 
1250  Hook = BeginIfHookedUserApiHook();
1251  if (Hook)
1252  {
1253  msgOverride = IsMsgOverride(Msg, &guah.DefWndProcArray);
1254  if(msgOverride == FALSE)
1255  {
1256  EndUserApiHook();
1257  }
1258  }
1259 
1260  /* Bypass SEH and go direct. */
1261  if (!Hook || !msgOverride)
1263 
1264  _SEH2_TRY
1265  {
1267  }
1269  {
1270  ERR("Got exception in hooked DefWindowProcW!\n");
1271  }
1272  _SEH2_END;
1273 
1274  EndUserApiHook();
1275 
1276  return Result;
1277 }
BOOL FASTCALL EndUserApiHook(VOID)
Definition: usrapihk.c:164
USERAPIHOOK guah
Definition: usrapihk.c:344
HWND hWnd
Definition: settings.c:17
LRESULT WINAPI RealDefWindowProcW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:1017
struct @1610 Msg[]
WPARAM wParam
Definition: combotst.c:138
_SEH2_TRY
Definition: create.c:4226
BOOL FASTCALL IsMsgOverride(UINT, PUAHOWP)
Definition: usrapihk.c:63
WNDPROC DefWindowProcW
Definition: undocuser.h:332
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
UAHOWP DefWndProcArray
Definition: undocuser.h:333
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
_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
#define ERR(fmt,...)
Definition: debug.h:110
_SEH2_END
Definition: create.c:4400
static __inline void LoadUserApiHook()
Definition: user_x.h:85
BOOL FASTCALL BeginIfHookedUserApiHook(VOID)
Definition: usrapihk.c:106
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

◆ DefWndControlColor()

HBRUSH DefWndControlColor ( HDC  hDC,
UINT  ctlType 
)

Definition at line 212 of file defwnd.c.

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 }
#define COLOR_3DHILIGHT
Definition: winuser.h:927
#define CTLCOLOR_SCROLLBAR
Definition: winuser.h:946
#define COLOR_WINDOW
Definition: winuser.h:908
PSERVERINFO gpsi
Definition: main.c:27
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:977
#define COLOR_3DFACE
Definition: winuser.h:919
#define COLOR_SCROLLBAR
Definition: winuser.h:902
DWORD COLORREF
Definition: windef.h:300
#define COLOR_WINDOWTEXT
Definition: winuser.h:911
BOOL WINAPI UnrealizeObject(_In_ HGDIOBJ)
#define CTLCOLOR_EDIT
Definition: winuser.h:942
#define CTLCOLOR_LISTBOX
Definition: winuser.h:943
DWORD WINAPI DECLSPEC_HOTPATCH GetSysColor(int nIndex)
Definition: defwnd.c:22
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:888
static HDC hDC
Definition: 3dtext.c:33
HBRUSH WINAPI DECLSPEC_HOTPATCH GetSysColorBrush(int nIndex)
Definition: defwnd.c:39

Referenced by IntDrawScrollInterior().

◆ DefWndGetIcon()

LRESULT FASTCALL DefWndGetIcon ( PWND  pWnd,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 291 of file defwnd.c.

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 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
PSERVERINFO gpsi
Definition: main.c:27
WPARAM wParam
Definition: combotst.c:138
#define ICON_SMALL
Definition: tnclass.cpp:48
#define UserHMGetHandle(obj)
Definition: ntuser.h:208
HANDLE FASTCALL UserGetProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
Definition: prop.c:46
#define SetLastError(x)
Definition: compat.h:611
ATOM atomIconProp
Definition: ntuser.h:1019
ATOM atomIconSmProp
Definition: ntuser.h:1018
LONG_PTR LRESULT
Definition: windef.h:209
#define ICON_BIG
Definition: tnclass.cpp:51

◆ DefWndHandleSysCommand()

LRESULT DefWndHandleSysCommand ( HWND  hWnd,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 143 of file defwnd.c.

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 }
#define SC_KEYMENU
Definition: winuser.h:2571
#define SC_RESTORE
Definition: winuser.h:2573
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define SC_SCREENSAVE
Definition: mmsystem.h:933
HWND hWnd
Definition: settings.c:17
#define FNID_DEFWINDOWPROC
Definition: ntuser.h:825
#define SC_HOTKEY
Definition: winuser.h:2576
#define SC_MOUSEMENU
Definition: winuser.h:2570
UINT WINAPI DECLSPEC_HOTPATCH WinExec(LPCSTR lpCmdLine, UINT uCmdShow)
Definition: proc.c:4776
WPARAM wParam
Definition: combotst.c:138
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define SC_TASKLIST
Definition: winuser.h:2574
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
#define SC_MAXIMIZE
Definition: winuser.h:2563
BOOL WINAPI IsWindowEnabled(_In_ HWND)
#define WH_CBT
Definition: winuser.h:35
#define ISITHOOKED(HookId)
Definition: hook.h:6
#define SC_PREVWINDOW
Definition: winuser.h:2566
static VOID DefWndTrackScrollBar(HWND Wnd, WPARAM wParam, POINT Pt)
Definition: defwnd.c:117
BOOL NTAPI NtUserMessageCall(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ResultInfo, DWORD dwType, BOOL Ansi)
Definition: message.c:2486
#define SC_MINIMIZE
Definition: winuser.h:2561
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define SC_SIZE
Definition: winuser.h:2559
LRESULT WINAPI DoAppSwitch(WPARAM wParam, LPARAM lParam)
Definition: appswitch.c:601
#define SC_MOVE
Definition: winuser.h:2560
#define SC_CLOSE
Definition: winuser.h:2567
#define HIWORD(l)
Definition: typedefs.h:247
#define SC_NEXTWINDOW
Definition: winuser.h:2565
LONG_PTR LRESULT
Definition: windef.h:209
#define WM_SYSCOMMAND
Definition: winuser.h:1723
#define SC_VSCROLL
Definition: winuser.h:2568
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define SC_HSCROLL
Definition: winuser.h:2569

◆ DefWndTrackScrollBar()

static VOID DefWndTrackScrollBar ( HWND  Wnd,
WPARAM  wParam,
POINT  Pt 
)
static

Definition at line 117 of file defwnd.c.

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 }
#define HTHSCROLL
Definition: winuser.h:2456
#define SB_VERT
Definition: winuser.h:553
#define SB_HORZ
Definition: winuser.h:552
int32_t INT
Definition: typedefs.h:58
WPARAM wParam
Definition: combotst.c:138
VOID FASTCALL ScrollTrackScrollBar(HWND Wnd, INT SBType, POINT Pt)
Definition: scrollbar.c:1156
#define HTVSCROLL
Definition: winuser.h:2457
#define SC_HSCROLL
Definition: winuser.h:2569

Referenced by DefWndHandleSysCommand().

◆ DoAppSwitch()

LRESULT WINAPI DoAppSwitch ( WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 601 of file appswitch.c.

602 {
603  HWND hwndActive;
604  MSG msg;
605 
606  // FIXME: Is loading timing OK?
608 
609  if (!CoolSwitch)
610  return 0;
611 
612  // Already in the loop.
613  if (switchdialog || Esc) return 0;
614 
615  if (lParam == VK_ESCAPE)
616  {
617  Esc = TRUE;
618 
619  windowCount = 0;
621 
622  if (windowCount < 2)
623  return 0;
624 
626 
627  hwndActive = GetActiveWindow();
628 
629  if (hwndActive == NULL)
630  {
631  Esc = FALSE;
632  return 0;
633  }
634  }
635 
636  // Capture current active window.
637  hwndActive = GetActiveWindow();
638  if (hwndActive)
639  SetCapture(hwndActive);
640 
641  switch (lParam)
642  {
643  case VK_TAB:
644  if (!GetDialogFont() || !ProcessHotKey())
645  goto Exit;
646  break;
647 
648  case VK_ESCAPE:
649  break;
650 
651  default:
652  goto Exit;
653  }
654 
655  if (!hwndActive)
656  goto Exit;
657 
658  // Main message loop:
659  while (1)
660  {
661  for (;;)
662  {
663  if (PeekMessageW( &msg, 0, 0, 0, PM_NOREMOVE ))
664  {
665  if (!CallMsgFilterW( &msg, MSGF_NEXTWINDOW )) break;
666  /* remove the message from the queue */
667  PeekMessageW( &msg, 0, msg.message, msg.message, PM_REMOVE );
668  }
669  else
670  WaitMessage();
671  }
672 
673  switch (msg.message)
674  {
675  case WM_KEYUP:
676  {
677  PeekMessageW( &msg, 0, msg.message, msg.message, PM_REMOVE );
678  if (msg.wParam == VK_MENU)
679  {
681  }
682  else if (msg.wParam == VK_RETURN)
683  {
685  }
686  else if (msg.wParam == VK_ESCAPE)
687  {
688  TRACE("DoAppSwitch VK_ESCAPE 2\n");
690  }
691  goto Exit; //break;
692  }
693 
694  case WM_SYSKEYDOWN:
695  {
696  PeekMessageW( &msg, 0, msg.message, msg.message, PM_REMOVE );
697  if (HIWORD(msg.lParam) & KF_ALTDOWN)
698  {
699  if ( msg.wParam == VK_TAB )
700  {
701  if (Esc) break;
702  if (GetKeyState(VK_SHIFT) < 0)
703  {
704  MoveLeft();
705  }
706  else
707  {
708  MoveRight();
709  }
710  }
711  else if ( msg.wParam == VK_ESCAPE )
712  {
713  if (!Esc) break;
715  }
716  else if ( msg.wParam == VK_LEFT )
717  {
718  MoveLeft();
719  }
720  else if ( msg.wParam == VK_RIGHT )
721  {
722  MoveRight();
723  }
724  else if ( msg.wParam == VK_UP )
725  {
726  MoveUp();
727  }
728  else if ( msg.wParam == VK_DOWN )
729  {
730  MoveDown();
731  }
732  }
733  break;
734  }
735 
736  case WM_LBUTTONUP:
737  PeekMessageW( &msg, 0, msg.message, msg.message, PM_REMOVE );
738  ProcessMouseMessage(msg.message, msg.lParam);
739  goto Exit;
740 
741  default:
742  if (PeekMessageW( &msg, 0, msg.message, msg.message, PM_REMOVE ))
743  {
746  }
747  break;
748  }
749  }
750 Exit:
751  ReleaseCapture();
753  if (Esc) DestroyAppWindows();
754  switchdialog = NULL;
755  selectedWindow = 0;
756  windowCount = 0;
757  Esc = FALSE;
758  return 0;
759 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
void CompleteSwitch(BOOL doSwitch)
Definition: appswitch.c:134
HWND switchdialog
Definition: appswitch.c:42
#define TRUE
Definition: types.h:120
BOOL WINAPI WaitMessage(void)
Definition: ntwrapper.h:350
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
BOOL Esc
Definition: appswitch.c:64
int windowCount
Definition: appswitch.c:53
#define VK_LEFT
Definition: winuser.h:2199
#define VK_TAB
Definition: winuser.h:2174
#define VK_DOWN
Definition: winuser.h:2202
#define VK_MENU
Definition: winuser.h:2179
#define VK_ESCAPE
Definition: winuser.h:2189
BOOL WINAPI DestroyWindow(_In_ HWND)
#define VK_RETURN
Definition: winuser.h:2176
static void MoveDown(void)
Definition: appswitch.c:573
#define PM_NOREMOVE
Definition: winuser.h:1181
#define MSGF_NEXTWINDOW
Definition: winuser.h:1165
BOOL WINAPI CallMsgFilterW(_In_ LPMSG, _In_ INT)
#define VK_UP
Definition: winuser.h:2200
#define FALSE
Definition: types.h:117
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
static void MoveUp(void)
Definition: appswitch.c:558
#define VK_SHIFT
Definition: winuser.h:2177
smooth NULL
Definition: ftsmooth.c:416
SHORT WINAPI GetKeyState(_In_ int)
static void MoveLeft(void)
Definition: appswitch.c:544
#define TRACE(s)
Definition: solgame.cpp:4
static void Exit(void)
Definition: sock.c:1331
#define WM_KEYUP
Definition: winuser.h:1698
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC, _In_ LPARAM)
DWORD GetDialogFont(VOID)
Definition: appswitch.c:435
SHORT WINAPI GetAsyncKeyState(_In_ int)
#define VK_RIGHT
Definition: winuser.h:2201
HWND WINAPI SetCapture(_In_ HWND hWnd)
BOOL LoadCoolSwitchSettings(void)
Definition: appswitch.c:86
BOOL ProcessHotKey(VOID)
Definition: appswitch.c:472
#define WM_LBUTTONUP
Definition: winuser.h:1759
static void MoveRight(void)
Definition: appswitch.c:552
#define KF_ALTDOWN
Definition: winuser.h:2424
void ProcessMouseMessage(UINT message, LPARAM lParam)
Definition: appswitch.c:294
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2889
void RotateTasks(BOOL bShift)
Definition: appswitch.c:507
#define WM_SYSKEYDOWN
Definition: winuser.h:1701
#define HIWORD(l)
Definition: typedefs.h:247
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1182
BOOL CoolSwitch
Definition: appswitch.c:66
int selectedWindow
Definition: appswitch.c:44
LPARAM lParam
Definition: combotst.c:139
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
static BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
Definition: appswitch.c:284
VOID DestroyAppWindows(VOID)
Definition: appswitch.c:589

Referenced by DefWndHandleSysCommand().

◆ GetSysColor()

DWORD WINAPI DECLSPEC_HOTPATCH GetSysColor ( int  nIndex)

Definition at line 22 of file defwnd.c.

23 {
24  if(nIndex >= 0 && nIndex < NUM_SYSCOLORS)
25  {
26  return gpsi->argbSystem[nIndex];
27  }
28 
30  return 0;
31 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
PSERVERINFO gpsi
Definition: main.c:27
#define SetLastError(x)
Definition: compat.h:611
#define NUM_SYSCOLORS
Definition: SetSysColors.c:10

Referenced by DefWndControlColor().

◆ GetSysColorBrush()

HBRUSH WINAPI DECLSPEC_HOTPATCH GetSysColorBrush ( int  nIndex)

Definition at line 39 of file defwnd.c.

40 {
41  if(nIndex >= 0 && nIndex < NUM_SYSCOLORS)
42  {
43  return gpsi->ahbrSystem[nIndex];
44  }
45 
46  return NULL;
47 }
PSERVERINFO gpsi
Definition: main.c:27
smooth NULL
Definition: ftsmooth.c:416
#define NUM_SYSCOLORS
Definition: SetSysColors.c:10

Referenced by DefWndControlColor(), FillRect(), IntDrawRectEdge(), IntDrawState(), UITOOLS95_DFC_ButtonPush(), and UITOOLS_DrawCheckedRect().

◆ IntFindChildWindowToOwner()

HWND FASTCALL IntFindChildWindowToOwner ( HWND  hRoot,
HWND  hOwner 
)

Definition at line 82 of file defwnd.c.

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 }
static __inline PVOID DesktopPtrToUser(PVOID Ptr)
Definition: user_x.h:12
static HTREEITEM hRoot
Definition: treeview.c:381
smooth NULL
Definition: ftsmooth.c:416
root entry for file system trees
Definition: entries.h:148
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
Definition: cmtypes.h:247
#define ERR(fmt,...)
Definition: debug.h:110
Definition: ntuser.h:657
#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:1556
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:728
#define WS_VISIBLE
Definition: pedump.c:620

◆ RealDefWindowProcA()

LRESULT WINAPI RealDefWindowProcA ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 809 of file defwnd.c.

813 {
814  LRESULT Result = 0;
815  PWND Wnd;
816 
817  Wnd = ValidateHwnd(hWnd);
818 
819  if ( !Wnd &&
820  Msg != WM_CTLCOLORMSGBOX &&
821  Msg != WM_CTLCOLORBTN &&
822  Msg != WM_CTLCOLORDLG &&
824  return 0;
825 
827  switch (Msg)
828  {
829  case WM_NCCREATE:
830  {
831  if ( Wnd &&
832  Wnd->style & (WS_HSCROLL | WS_VSCROLL) )
833  {
834  if (!Wnd->pSBInfo)
835  {
836  SCROLLINFO si = {sizeof si, SIF_ALL, 0, 100, 0, 0, 0};
837  SetScrollInfo( hWnd, SB_HORZ, &si, FALSE );
838  SetScrollInfo( hWnd, SB_VERT, &si, FALSE );
839  }
840  }
841 
842  if (lParam)
843  {
845  /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
846  * may have child window IDs instead of window name */
847  if (HIWORD(cs->lpszName))
848  {
849  DefSetText(hWnd, (PCWSTR)cs->lpszName, TRUE);
850  }
851  Result = 1;
852  }
853  break;
854  }
855 
856  case WM_GETTEXTLENGTH:
857  {
858  PWSTR buf;
859  ULONG len;
860 
861  if (Wnd != NULL && Wnd->strName.Length != 0)
862  {
864  if (buf != NULL &&
866  buf,
867  Wnd->strName.Length)))
868  {
869  Result = (LRESULT) len;
870  }
871  }
872  else Result = 0L;
873 
874  break;
875  }
876 
877  case WM_GETTEXT:
878  {
879  PWSTR buf = NULL;
880  PSTR outbuf = (PSTR)lParam;
881  SIZE_T copy;
882 
883  if (Wnd != NULL && wParam != 0)
884  {
885  if (Wnd->strName.Buffer != NULL)
887  else
888  outbuf[0] = L'\0';
889 
890  if (buf != NULL)
891  {
892  if (Wnd->strName.Length != 0)
893  {
894  copy = min(Wnd->strName.Length / sizeof(WCHAR), wParam - 1);
896  0,
897  buf,
898  copy,
899  outbuf,
900  wParam,
901  NULL,
902  NULL);
903  outbuf[Result] = '\0';
904  }
905  else
906  outbuf[0] = '\0';
907  }
908  }
909  break;
910  }
911 
912  case WM_SETTEXT:
913  {
915 
917  {
919  IntNotifyWinEvent(EVENT_OBJECT_NAMECHANGE, hWnd, OBJID_WINDOW, CHILDID_SELF, 0);
920  }
921  Result = 1;
922  break;
923  }
924 
925  case WM_IME_KEYDOWN:
926  {
928  break;
929  }
930 
931  case WM_IME_KEYUP:
932  {
934  break;
935  }
936 
937  case WM_IME_CHAR:
938  {
939  if (HIBYTE(wParam))
942  break;
943  }
944 
945  case WM_IME_COMPOSITION:
946  if (lParam & GCS_RESULTSTR)
947  {
948  LONG size, i;
949  unsigned char lead = 0;
950  char *buf = NULL;
951  HIMC himc = ImmGetContext( hWnd );
952 
953  if (himc)
954  {
955  if ((size = ImmGetCompositionStringA( himc, GCS_RESULTSTR, NULL, 0 )))
956  {
957  if (!(buf = HeapAlloc( GetProcessHeap(), 0, size ))) size = 0;
959  }
960  ImmReleaseContext( hWnd, himc );
961 
962  for (i = 0; i < size; i++)
963  {
964  unsigned char c = buf[i];
965  if (!lead)
966  {
967  if (IsDBCSLeadByte( c ))
968  lead = c;
969  else
970  SendMessageA( hWnd, WM_IME_CHAR, c, 1 );
971  }
972  else
973  {
974  SendMessageA( hWnd, WM_IME_CHAR, MAKEWORD(c, lead), 1 );
975  lead = 0;
976  }
977  }
978  HeapFree( GetProcessHeap(), 0, buf );
979  }
980  }
981  /* fall through */
982  case WM_IME_STARTCOMPOSITION:
983  case WM_IME_ENDCOMPOSITION:
984  case WM_IME_SELECT:
985  case WM_IME_NOTIFY:
986  case WM_IME_CONTROL:
987  {
988  HWND hwndIME;
989 
990  hwndIME = ImmGetDefaultIMEWnd(hWnd);
991  if (hwndIME)
992  Result = SendMessageA(hwndIME, Msg, wParam, lParam);
993  break;
994  }
995 
996  case WM_IME_SETCONTEXT:
997  {
998  HWND hwndIME;
999 
1000  hwndIME = ImmGetDefaultIMEWnd(hWnd);
1001  if (hwndIME)
1002  Result = ImmIsUIMessageA(hwndIME, Msg, wParam, lParam);
1003  break;
1004  }
1005 
1006  /* fall through */
1007  default:
1009  }
1010 
1012  return Result;
1013 }
#define WM_GETTEXTLENGTH
Definition: winuser.h:1601
#define WM_IME_KEYUP
Definition: winuser.h:1821
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define WM_IME_NOTIFY
Definition: winuser.h:1812
#define WM_IME_KEYDOWN
Definition: winuser.h:1820
#define WM_CHAR
Definition: winuser.h:1699
#define WideCharToMultiByte
Definition: compat.h:111
#define WM_IME_CHAR
Definition: winuser.h:1816
#define LOBYTE(W)
Definition: jmemdos.c:487
#define MAKEWORD(a, b)
Definition: typedefs.h:248
#define SB_VERT
Definition: winuser.h:553
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define TRUE
Definition: types.h:120
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CTLCOLORDLG
Definition: winuser.h:1752
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
uint16_t * PWSTR
Definition: typedefs.h:56
#define CP_ACP
Definition: compat.h:109
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1754
#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
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToMultiByteSize(PULONG MbSize, PCWCH UnicodeString, ULONG UnicodeSize)
#define OBJID_WINDOW
Definition: winable.h:15
HWND hWnd
Definition: settings.c:17
#define HIBYTE(W)
Definition: jmemdos.c:486
#define WM_IME_SELECT
Definition: winuser.h:1815
PSBINFO pSBInfo
Definition: ntuser.h:690
struct @1610 Msg[]
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define WM_NCCREATE
Definition: winuser.h:1665
void SPY_ExitMessage(INT iFlag, HWND hwnd, UINT msg, LRESULT lReturn, WPARAM wParam, LPARAM lParam)
Definition: spy.c:2648
WPARAM wParam
Definition: combotst.c:138
#define SPY_DEFWNDPROC
Definition: user32p.h:70
LONG WINAPI ImmGetCompositionStringA(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
Definition: imm.c:1489
struct tagCREATESTRUCTA * LPCREATESTRUCTA
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:1746
static __inline PVOID DesktopPtrToUser(PVOID Ptr)
Definition: user_x.h:12
#define WM_CTLCOLORBTN
Definition: winuser.h:1751
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
#define CHILDID_SELF
Definition: winable.h:14
smooth NULL
Definition: ftsmooth.c:416
#define GCS_RESULTSTR
Definition: imm.h:369
_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:2232
#define WM_KEYDOWN
Definition: winuser.h:1697
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1748
DWORD HIMC
Definition: dimm.idl:75
#define WM_SETTEXT
Definition: winuser.h:1599
LARGE_UNICODE_STRING strName
Definition: ntuser.h:700
#define WS_CAPTION
Definition: pedump.c:624
BOOL FASTCALL DefSetText(HWND hWnd, PCWSTR String, BOOL Ansi)
Definition: defwnd.c:64
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define WM_IME_SETCONTEXT
Definition: winuser.h:1811
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1526
#define WM_IME_CONTROL
Definition: winuser.h:1813
const GLubyte * c
Definition: glext.h:8905
#define WM_KEYUP
Definition: winuser.h:1698
void SPY_EnterMessage(INT iFlag, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: spy.c:2593
#define WS_HSCROLL
Definition: pedump.c:628
static const WCHAR L[]
Definition: oid.c:1250
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
GLenum GLsizei len
Definition: glext.h:6722
#define LRESULT
Definition: ole.h:14
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2283
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:657
ULONG_PTR SIZE_T
Definition: typedefs.h:80
signed char * PSTR
Definition: retypes.h:7
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
#define min(a, b)
Definition: monoChain.cc:55
#define SPY_RESULT_DEFWND
Definition: user32p.h:73
BOOL UserPaintCaption(PWND pWnd, INT Flags)
Definition: defwnd.c:396
#define WS_VSCROLL
Definition: pedump.c:627
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:247
unsigned int ULONG
Definition: retypes.h:1
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
#define HeapFree(x, y, z)
Definition: compat.h:594
#define DC_TEXT
Definition: winuser.h:430
BOOL WINAPI ImmIsUIMessageA(HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: imm.c:2154
#define SIF_ALL
Definition: winuser.h:1218
DWORD style
Definition: ntuser.h:670

Referenced by DefWindowProcA(), and ResetUserApiHook().

◆ RealDefWindowProcW()

LRESULT WINAPI RealDefWindowProcW ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1017 of file defwnd.c.

1021 {
1022  LRESULT Result = 0;
1023  PWND Wnd;
1024 
1025  Wnd = ValidateHwnd(hWnd);
1026 
1027  if ( !Wnd &&
1028  Msg != WM_CTLCOLORMSGBOX &&
1029  Msg != WM_CTLCOLORBTN &&
1030  Msg != WM_CTLCOLORDLG &&
1031  Msg != WM_CTLCOLORSTATIC )
1032  return 0;
1033 
1035  switch (Msg)
1036  {
1037  case WM_NCCREATE:
1038  {
1039  if ( Wnd &&
1040  Wnd->style & (WS_HSCROLL | WS_VSCROLL) )
1041  {
1042  if (!Wnd->pSBInfo)
1043  {
1044  SCROLLINFO si = {sizeof si, SIF_ALL, 0, 100, 0, 0, 0};
1045  if (Wnd->style & WS_HSCROLL)
1046  SetScrollInfo( hWnd, SB_HORZ, &si, FALSE );
1047  if (Wnd->style & WS_VSCROLL)
1048  SetScrollInfo( hWnd, SB_VERT, &si, FALSE );
1049  }
1050  }
1051 
1052  if (lParam)
1053  {
1055  /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
1056  * may have child window IDs instead of window name */
1057  if (HIWORD(cs->lpszName))
1058  {
1059  DefSetText(hWnd, cs->lpszName, FALSE);
1060  }
1061  Result = 1;
1062  }
1063  break;
1064  }
1065 
1066  case WM_GETTEXTLENGTH:
1067  {
1068  PWSTR buf;
1069  ULONG len;
1070 
1071  if (Wnd != NULL && Wnd->strName.Length != 0)
1072  {
1074  if (buf != NULL &&
1076  buf,
1077  Wnd->strName.Length)))
1078  {
1079  Result = (LRESULT) (Wnd->strName.Length / sizeof(WCHAR));
1080  }
1081  }
1082  else Result = 0L;
1083 
1084  break;
1085  }
1086 
1087  case WM_GETTEXT:
1088  {
1089  PWSTR buf = NULL;
1090  PWSTR outbuf = (PWSTR)lParam;
1091 
1092  if (Wnd != NULL && wParam != 0)
1093  {
1094  if (Wnd->strName.Buffer != NULL)
1096  else
1097  outbuf[0] = L'\0';
1098 
1099  if (buf != NULL)
1100  {
1101  if (Wnd->strName.Length != 0)
1102  {
1103  Result = min(Wnd->strName.Length / sizeof(WCHAR), wParam - 1);
1104  RtlCopyMemory(outbuf,
1105  buf,
1106  Result * sizeof(WCHAR));
1107  outbuf[Result] = L'\0';
1108  }
1109  else
1110  outbuf[0] = L'\0';
1111  }
1112  }
1113  break;
1114  }
1115 
1116  case WM_SETTEXT:
1117  {
1119 
1121  UserPaintCaption(Wnd, DC_TEXT);
1122  Result = 1;
1123  break;
1124  }
1125 
1126  case WM_IME_CHAR:
1127  {
1129  Result = 0;
1130  break;
1131  }
1132 
1133  case WM_IME_KEYDOWN:
1134  {
1136  break;
1137  }
1138 
1139  case WM_IME_KEYUP:
1140  {
1142  break;
1143  }
1144 
1145  case WM_IME_COMPOSITION:
1146  if (lParam & GCS_RESULTSTR)
1147  {
1148  LONG size, i;
1149  WCHAR *buf = NULL;
1150  HIMC himc = ImmGetContext( hWnd );
1151 
1152  if (himc)
1153  {
1154  if ((size = ImmGetCompositionStringW( himc, GCS_RESULTSTR, NULL, 0 )))
1155  {
1156  if (!(buf = HeapAlloc( GetProcessHeap(), 0, size * sizeof(WCHAR) ))) size = 0;
1157  else size = ImmGetCompositionStringW( himc, GCS_RESULTSTR, buf, size * sizeof(WCHAR) );
1158  }
1159  ImmReleaseContext( hWnd, himc );
1160 
1161  for (i = 0; i < size / sizeof(WCHAR); i++)
1162  SendMessageW( hWnd, WM_IME_CHAR, buf[i], 1 );
1163  HeapFree( GetProcessHeap(), 0, buf );
1164  }
1165  }
1166  /* fall through */
1167  case WM_IME_STARTCOMPOSITION:
1168  case WM_IME_ENDCOMPOSITION:
1169  case WM_IME_SELECT:
1170  case WM_IME_NOTIFY:
1171  case WM_IME_CONTROL:
1172  {
1173  HWND hwndIME;
1174 
1175  hwndIME = ImmGetDefaultIMEWnd(hWnd);
1176  if (hwndIME)
1177  Result = SendMessageW(hwndIME, Msg, wParam, lParam);
1178  break;
1179  }
1180 
1181  case WM_IME_SETCONTEXT:
1182  {
1183  HWND hwndIME;
1184 
1185  hwndIME = ImmGetDefaultIMEWnd(hWnd);
1186  if (hwndIME)
1187  Result = ImmIsUIMessageW(hwndIME, Msg, wParam, lParam);
1188  break;
1189  }
1190 
1191  default:
1193  }
1195 
1196  return Result;
1197 }
#define WM_GETTEXTLENGTH
Definition: winuser.h:1601
#define WM_IME_KEYUP
Definition: winuser.h:1821
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define WM_IME_NOTIFY
Definition: winuser.h:1812
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define WM_IME_KEYDOWN
Definition: winuser.h:1820
#define WM_CHAR
Definition: winuser.h:1699
#define WM_IME_CHAR
Definition: winuser.h:1816
#define SB_VERT
Definition: winuser.h:553
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define TRUE
Definition: types.h:120
#define WM_CTLCOLORDLG
Definition: winuser.h:1752
uint16_t * PWSTR
Definition: typedefs.h:56
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1754
#define WM_GETTEXT
Definition: winuser.h:1600
#define SB_HORZ
Definition: winuser.h:552
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToMultiByteSize(PULONG MbSize, PCWCH UnicodeString, ULONG UnicodeSize)
HWND hWnd
Definition: settings.c:17
#define WM_IME_SELECT
Definition: winuser.h:1815
PSBINFO pSBInfo
Definition: ntuser.h:690
struct @1610 Msg[]
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define WM_NCCREATE
Definition: winuser.h:1665
void SPY_ExitMessage(INT iFlag, HWND hwnd, UINT msg, LRESULT lReturn, WPARAM wParam, LPARAM lParam)
Definition: spy.c:2648
WPARAM wParam
Definition: combotst.c:138
#define SPY_DEFWNDPROC
Definition: user32p.h:70
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:1746
static __inline PVOID DesktopPtrToUser(PVOID Ptr)
Definition: user_x.h:12
#define WM_CTLCOLORBTN
Definition: winuser.h:1751
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define GCS_RESULTSTR
Definition: imm.h:369
_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
#define WM_KEYDOWN
Definition: winuser.h:1697
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1748
DWORD HIMC
Definition: dimm.idl:75
#define WM_SETTEXT
Definition: winuser.h:1599
LARGE_UNICODE_STRING strName
Definition: ntuser.h:700
#define WS_CAPTION
Definition: pedump.c:624
BOOL FASTCALL DefSetText(HWND hWnd, PCWSTR String, BOOL Ansi)
Definition: defwnd.c:64
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define WM_IME_SETCONTEXT
Definition: winuser.h:1811
LONG WINAPI ImmGetCompositionStringW(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
Definition: imm.c:1499
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1526
#define WM_IME_CONTROL
Definition: winuser.h:1813
#define WM_KEYUP
Definition: winuser.h:1698
void SPY_EnterMessage(INT iFlag, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: spy.c:2593
#define WS_HSCROLL
Definition: pedump.c:628
static const WCHAR L[]
Definition: oid.c:1250
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
GLenum GLsizei len
Definition: glext.h:6722
#define LRESULT
Definition: ole.h:14
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:2283
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:657
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
struct tagCREATESTRUCTW * LPCREATESTRUCTW
#define min(a, b)
Definition: monoChain.cc:55
#define SPY_RESULT_DEFWND
Definition: user32p.h:73
BOOL UserPaintCaption(PWND pWnd, INT Flags)
Definition: defwnd.c:396
#define WS_VSCROLL
Definition: pedump.c:627
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI User32DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
Definition: defwnd.c:316
#define HIWORD(l)
Definition: typedefs.h:247
unsigned int ULONG
Definition: retypes.h:1
LONG_PTR LRESULT
Definition: windef.h:209
BOOL WINAPI ImmIsUIMessageW(HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: imm.c:2176
LPARAM lParam
Definition: combotst.c:139
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
#define HeapFree(x, y, z)
Definition: compat.h:594
#define DC_TEXT
Definition: winuser.h:430
#define SIF_ALL
Definition: winuser.h:1218
DWORD style
Definition: ntuser.h:670

Referenced by DefWindowProcW(), and ResetUserApiHook().

◆ SetSysColors()

BOOL WINAPI SetSysColors ( int  cElements,
CONST INT lpaElements,
CONST COLORREF lpaRgbValues 
)

Definition at line 54 of file defwnd.c.

58 {
59  return NtUserSetSysColors(cElements, lpaElements, lpaRgbValues, 0);
60 }
BOOL NTAPI NtUserSetSysColors(int cElements, IN CONST INT *lpaElements, IN CONST COLORREF *lpaRgbValues, FLONG Flags)
Definition: ntstubs.c:311

◆ User32DefWindowProc()

LRESULT WINAPI User32DefWindowProc ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam,
BOOL  bUnicode 
)

Definition at line 316 of file defwnd.c.

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)
342  LOWORD(lParam), HIWORD(lParam), 0, hWnd, NULL);
343  return 0;
344  }
345 
346  case WM_RBUTTONUP:
347  {
348  POINT Pt;
349  Pt.x = GET_X_LPARAM(lParam);
350  Pt.y = GET_Y_LPARAM(lParam);
351  ClientToScreen(hWnd, &Pt);
352  lParam = MAKELPARAM(Pt.x, Pt.y);
353  if (bUnicode)
354  {
356  }
357  else
358  {
360  }
361  break;
362  }
363 
364  case WM_NCRBUTTONUP:
365  /*
366  * FIXME : we must NOT send WM_CONTEXTMENU on a WM_NCRBUTTONUP (checked
367  * in Windows), but what _should_ we do? According to MSDN :
368  * "If it is appropriate to do so, the system sends the WM_SYSCOMMAND
369  * message to the window". When is it appropriate?
370  */
371  ERR("WM_NCRBUTTONUP\n");
372  break;
373 
374  case WM_XBUTTONUP:
375  case WM_NCXBUTTONUP:
376  if (HIWORD(wParam) == XBUTTON1 || HIWORD(wParam) == XBUTTON2)
377  {
379  MAKELPARAM(LOWORD(wParam), FAPPCOMMAND_MOUSE | HIWORD(wParam)));
380  }
381  break;
382 
383  case WM_CONTEXTMENU:
384  {
386  {
387  if (bUnicode)
388  {
390  }
391  else
392  {
394  }
395  }
396  else
397  {
398  goto GoSS;
399  }
400  break;
401  }
402 
403  case WM_CLOSE:
405  return (0);
406 
407  case WM_MOUSEACTIVATE:
409  {
411  if (Ret) return (Ret);
412  }
414 
415  case WM_ACTIVATE:
416  /* The default action in Windows is to set the keyboard focus to
417  * the window, if it's being activated and not minimized */
418  if (LOWORD(wParam) != WA_INACTIVE &&
420  {
421  //ERR("WM_ACTIVATE %p\n",hWnd);
422  SetFocus(hWnd);
423  }
424  break;
425 
426  case WM_MOUSEWHEEL:
429  break;
430 
431  case WM_ERASEBKGND:
432  case WM_ICONERASEBKGND:
433  {
434  RECT Rect;
435  HBRUSH hBrush = (HBRUSH)GetClassLongPtrW(hWnd, GCL_HBRBACKGROUND);
436 
437  if (NULL == hBrush)
438  {
439  return 0;
440  }
442  {
443  /* can't use GetClipBox with a parent DC or we fill the whole parent */
445  DPtoLP((HDC)wParam, (LPPOINT)&Rect, 2);
446  }
447  else
448  {
450  }
451  FillRect((HDC)wParam, &Rect, hBrush);
452  return (1);
453  }
454 
455  case WM_CTLCOLORMSGBOX:
456  case WM_CTLCOLOREDIT:
457  case WM_CTLCOLORLISTBOX:
458  case WM_CTLCOLORBTN:
459  case WM_CTLCOLORDLG:
460  case WM_CTLCOLORSTATIC:
463 
464  case WM_CTLCOLOR:
466 
467  case WM_SYSCOMMAND:
469 
470  case WM_VKEYTOITEM:
471  case WM_CHARTOITEM:
472  return (-1);
473 /*
474  case WM_DROPOBJECT:
475  return DRAG_FILE;
476 */
477  case WM_QUERYDROPOBJECT:
478  {
480  {
481  return(1);
482  }
483  break;
484  }
485 
486  case WM_QUERYDRAGICON:
487  {
488  UINT Len;
489  HICON hIcon;
490 
492  if (hIcon)
493  {
494  return ((LRESULT)hIcon);
495  }
496  for (Len = 1; Len < 64; Len++)
497  {
499  {
500  return((LRESULT)hIcon);
501  }
502  }
503  return ((LRESULT)LoadIconW(0, IDI_APPLICATION));
504  }
505 
506  case WM_ISACTIVEICON:
507  {
508  BOOL isai;
509  isai = (pWnd->state & WNDS_ACTIVEFRAME) != 0;
510  return isai;
511  }
512 
513  case WM_NOTIFYFORMAT:
514  {
515  if (lParam == NF_QUERY)
517  break;
518  }
519 
520  case WM_GETICON:
521  {
522  return DefWndGetIcon(pWnd, wParam, lParam);
523  }
524 
525  case WM_HELP:
526  {
527  if (bUnicode)
528  {
530  }
531  else
532  {
534  }
535  break;
536  }
537 
538  case WM_QUERYOPEN:
539  case WM_QUERYENDSESSION:
540  {
541  return (1);
542  }
543 
544  case WM_INPUTLANGCHANGEREQUEST:
545  {
546  HKL NewHkl;
547 
548  if(wParam & INPUTLANGCHANGE_BACKWARD
549  && wParam & INPUTLANGCHANGE_FORWARD)
550  {
551  return FALSE;
552  }
553 
554  //FIXME: What to do with INPUTLANGCHANGE_SYSCHARSET ?
555 
556  if(wParam & INPUTLANGCHANGE_BACKWARD) NewHkl = (HKL) HKL_PREV;
557  else if(wParam & INPUTLANGCHANGE_FORWARD) NewHkl = (HKL) HKL_NEXT;
558  else NewHkl = (HKL) lParam;
559 
560  NtUserActivateKeyboardLayout(NewHkl, 0);
561 
562  return TRUE;
563  }
564 
565  case WM_INPUTLANGCHANGE:
566  {
567  int count = 0;
568  HWND *win_array = WIN_ListChildren( hWnd );
569 
570  if (!win_array)
571  break;
572  while (win_array[count])
573  SendMessageW( win_array[count++], WM_INPUTLANGCHANGE, wParam, lParam);
574  HeapFree(GetProcessHeap(),0,win_array);
575  break;
576  }
577 
578  case WM_QUERYUISTATE:
579  {
580  LRESULT Ret = 0;
581  PWND Wnd = ValidateHwnd(hWnd);
582  if (Wnd != NULL)
583  {
584  if (Wnd->HideFocus)
585  Ret |= UISF_HIDEFOCUS;
586  if (Wnd->HideAccel)
587  Ret |= UISF_HIDEACCEL;
588  }
589  return Ret;
590  }
591 
592  case WM_CHANGEUISTATE:
593  {
594  BOOL AlwaysShowCues = FALSE;
596  WORD Flags = HIWORD(wParam);
597  PWND Wnd;
598 
599  SystemParametersInfoW(SPI_GETKEYBOARDCUES, 0, &AlwaysShowCues, 0);
600  if (AlwaysShowCues)
601  break;
602 
603  Wnd= ValidateHwnd(hWnd);
604  if (!Wnd || lParam != 0)
605  break;
606 
607  if (Flags & ~(UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE))
608  break;
609 
610  if (Flags & UISF_ACTIVE)
611  {
612  WARN("WM_CHANGEUISTATE does not yet support UISF_ACTIVE!\n");
613  }
614 
615  if (Action == UIS_INITIALIZE)
616  {
618  if (Desk == NULL)
619  break;
620 
621  Action = Desk->LastInputWasKbd ? UIS_CLEAR : UIS_SET;
622  Flags = UISF_HIDEFOCUS | UISF_HIDEACCEL;
623 
624  /* We need to update wParam in case we need to send out messages */
626  }
627 
628  switch (Action)
629  {
630  case UIS_SET:
631  /* See if we actually need to change something */
632  if ((Flags & UISF_HIDEFOCUS) && !Wnd->HideFocus)
633  break;
634  if ((Flags & UISF_HIDEACCEL) && !Wnd->HideAccel)
635  break;
636 
637  /* Don't need to do anything... */
638  return 0;
639 
640  case UIS_CLEAR:
641  /* See if we actually need to change something */
642  if ((Flags & UISF_HIDEFOCUS) && Wnd->HideFocus)
643  break;
644  if ((Flags & UISF_HIDEACCEL) && Wnd->HideAccel)
645  break;
646 
647  /* Don't need to do anything... */
648  return 0;
649 
650  default:
651  WARN("WM_CHANGEUISTATE: Unsupported Action 0x%x\n", Action);
652  break;
653  }
654 
655  if ((Wnd->style & WS_CHILD) && Wnd->spwndParent != NULL)
656  {
657  /* We're a child window and we need to pass this message down until
658  we reach the root */
660  }
661  else
662  {
663  /* We're a top level window, we need to change the UI state */
664  Msg = WM_UPDATEUISTATE;
665  }
666 
667  if (bUnicode)
668  return SendMessageW(hWnd, Msg, wParam, lParam);
669  else
670  return SendMessageA(hWnd, Msg, wParam, lParam);
671  }
672 
673  case WM_UPDATEUISTATE:
674  {
675  BOOL Change = TRUE;
676  BOOL AlwaysShowCues = FALSE;
678  WORD Flags = HIWORD(wParam);
679  PWND Wnd;
680 
681  SystemParametersInfoW(SPI_GETKEYBOARDCUES, 0, &AlwaysShowCues, 0);
682  if (AlwaysShowCues)
683  break;
684 
685  Wnd = ValidateHwnd(hWnd);
686  if (!Wnd || lParam != 0)
687  break;
688 
689  if (Flags & ~(UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE))
690  break;
691 
692  if (Flags & UISF_ACTIVE)
693  {
694  WARN("WM_UPDATEUISTATE does not yet support UISF_ACTIVE!\n");
695  }
696 
697  if (Action == UIS_INITIALIZE)
698  {
700  if (Desk == NULL)
701  break;
702 
703  Action = Desk->LastInputWasKbd ? UIS_CLEAR : UIS_SET;
704  Flags = UISF_HIDEFOCUS | UISF_HIDEACCEL;
705 
706  /* We need to update wParam for broadcasting the update */
708  }
709 
710  switch (Action)
711  {
712  case UIS_SET:
713  /* See if we actually need to change something */
714  if ((Flags & UISF_HIDEFOCUS) && !Wnd->HideFocus)
715  break;
716  if ((Flags & UISF_HIDEACCEL) && !Wnd->HideAccel)
717  break;
718 
719  /* Don't need to do anything... */
720  Change = FALSE;
721  break;
722 
723  case UIS_CLEAR:
724  /* See if we actually need to change something */
725  if ((Flags & UISF_HIDEFOCUS) && Wnd->HideFocus)
726  break;
727  if ((Flags & UISF_HIDEACCEL) && Wnd->HideAccel)
728  break;
729 
730  /* Don't need to do anything... */
731  Change = FALSE;
732  break;
733 
734  default:
735  WARN("WM_UPDATEUISTATE: Unsupported Action 0x%x\n", Action);
736  return 0;
737  }
738 
739  /* Pack the information and call win32k */
740  if (Change)
741  {
742  if (!NtUserxUpdateUiState(hWnd, Flags | ((DWORD)Action << 3)))
743  break;
744  }
745 
746  /* Always broadcast the update to all children */
749  (LPARAM)wParam);
750 
751  break;
752  }
753 
754  case WM_COPYGLOBALDATA:
755  {
756  TRACE("WM_COPYGLOBALDATA hGlobal %p Size %d Flags 0x%x\n",lParam,wParam,GlobalFlags((HGLOBAL)lParam));
757  return lParam;
758  }
759 
760 /* Move to Win32k !*/
761  case WM_SHOWWINDOW:
762  if (!lParam) break; // Call when it is necessary.
763  case WM_LBUTTONDOWN:
764  case WM_RBUTTONDOWN:
765  case WM_MBUTTONDOWN:
766  case WM_NCLBUTTONDOWN:
767  case WM_NCRBUTTONDOWN:
768  case WM_LBUTTONDBLCLK:
769  case WM_NCLBUTTONDBLCLK:
770  case WM_KEYF1:
771  case WM_KEYUP:
772  case WM_SYSKEYUP:
773  case WM_KEYDOWN:
774  case WM_SYSKEYDOWN:
775  case WM_SYSCHAR:
776  case WM_CANCELMODE:
777  case WM_PAINTICON:
778  case WM_PAINT:
779  case WM_PRINT:
780  case WM_SETICON:
781  case WM_SYSCOLORCHANGE:
782  case WM_NCUAHDRAWCAPTION:
783  case WM_NCUAHDRAWFRAME:
784  case WM_NCPAINT:
785  case WM_NCACTIVATE:
786  case WM_NCCALCSIZE:
787  case WM_NCHITTEST:
788  case WM_SYNCPAINT:
789  case WM_SETREDRAW:
790  case WM_CLIENTSHUTDOWN:
791  case WM_GETHOTKEY:
792  case WM_SETHOTKEY:
794  case WM_WINDOWPOSCHANGED:
795  case WM_APPCOMMAND:
796  case WM_SETCURSOR:
797 GoSS:
798  {
799  LRESULT lResult;
800  NtUserMessageCall( hWnd, Msg, wParam, lParam, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, !bUnicode);
801  return lResult;
802  }
803  }
804  return 0;
805 }
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1674
#define WM_SYNCPAINT
Definition: winuser.h:1672
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
#define WM_SETHOTKEY
Definition: winuser.h:1634
#define WM_PAINTICON
Definition: winuser.h:1623
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1608
static HICON
Definition: imagelist.c:84
#define MAKEWPARAM(l, h)
Definition: winuser.h:3984
UINT HideFocus
Definition: ntuser.h:722
long y
Definition: polytest.cpp:48
#define WM_CONTEXTMENU
Definition: richedit.h:64
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
long x
Definition: polytest.cpp:48
#define TPM_SYSTEM_MENU
Definition: undocuser.h:71
HKL NTAPI NtUserActivateKeyboardLayout(HKL hKl, ULONG Flags)
Definition: kbdlayout.c:705
#define TRUE
Definition: types.h:120
#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)
#define WM_CLIENTSHUTDOWN
Definition: undocuser.h:35
#define WM_MOUSEWHEEL
Definition: treelist.c:96
#define WM_NCCALCSIZE
Definition: winuser.h:1667
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1754
UINT NTAPI GlobalFlags(HGLOBAL hMem)
Definition: heapmem.c:520
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:3983
#define WM_QUERYENDSESSION
Definition: winuser.h:1604
static HDC
Definition: imagelist.c:92
#define WM_SETREDRAW
Definition: winuser.h:1598
HWND hWnd
Definition: settings.c:17
#define GET_X_LPARAM(lp)
Definition: windowsx.h:274
#define FNID_DEFWINDOWPROC
Definition: ntuser.h:825
#define MA_ACTIVATE
Definition: winuser.h:2476
#define WM_SHOWWINDOW
Definition: winuser.h:1610
#define GWL_EXSTYLE
Definition: winuser.h:845
#define WM_NCRBUTTONDOWN
Definition: winuser.h:1677
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WM_CTLCOLOR
Definition: windowsx.h:4
#define WM_NCHITTEST
Definition: winuser.h:1668
struct @1610 Msg[]
#define IDI_APPLICATION
Definition: winuser.h:699
UINT_PTR WPARAM
Definition: windef.h:207
#define WS_CHILD
Definition: pedump.c:617
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define WM_CTLCOLORLISTBOX
Definition: winuser.h:1750
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI DPtoLP(_In_ HDC hdc, _Inout_updates_(c) LPPOINT lppt, _In_ int c)
LRESULT FASTCALL DefWndGetIcon(PWND pWnd, WPARAM wParam, LPARAM lParam)
Definition: defwnd.c:472
WPARAM wParam
Definition: combotst.c:138
#define WM_QUERYDROPOBJECT
Definition: undocuser.h:54
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define WM_NCPAINT
Definition: winuser.h:1669
#define GCL_STYLE
Definition: winuser.h:665
#define WM_QUERYDRAGICON
Definition: winuser.h:1636
#define TPM_RIGHTBUTTON
Definition: winuser.h:2355
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define WM_CHARTOITEM
Definition: winuser.h:1631
static __inline PVOID DesktopPtrToUser(PVOID Ptr)
Definition: user_x.h:12
#define WM_CTLCOLORBTN
Definition: winuser.h:1751
#define FALSE
Definition: types.h:117
#define WM_NCACTIVATE
Definition: winuser.h:1670
#define WS_MINIMIZE
Definition: pedump.c:622
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_POPUPSYSTEMMENU
Definition: undocuser.h:59
long LONG
Definition: pedump.c:60
#define WM_NCRBUTTONUP
Definition: winuser.h:1678
#define WM_SETCURSOR
Definition: winuser.h:1618
#define WM_CTLCOLORSCROLLBAR
Definition: winuser.h:1753
#define WM_SYSCHAR
Definition: winuser.h:1703
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 WM_KEYDOWN
Definition: winuser.h:1697
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1748
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_MOUSEACTIVATE
Definition: winuser.h:1619
BOOL WINAPI IsWindowUnicode(_In_ HWND)
UINT HideAccel
Definition: ntuser.h:723
#define WM_RBUTTONDOWN
Definition: winuser.h:1761
#define WM_APPCOMMAND
Definition: winuser.h:1864
#define UserHMGetHandle(obj)
Definition: ntuser.h:208
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
#define NFR_UNICODE
Definition: winuser.h:2434
#define WM_NCUAHDRAWCAPTION
Definition: undocuser.h:45
_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 WM_KEYUP
Definition: winuser.h:1698
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 WM_RBUTTONUP
Definition: winuser.h:1762
#define WM_PRINT
Definition: winuser.h:1862
#define WM_PAINT
Definition: winuser.h:1602
static BOOL CALLBACK UserSendUiUpdateMsg(HWND hwnd, LPARAM lParam)
Definition: defwnd.c:248
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
#define WM_CANCELMODE
Definition: winuser.h:1617
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1760
#define WNDS_ACTIVEFRAME
Definition: ntuser.h:579
#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:2486
#define WM_COPYGLOBALDATA
Definition: undocuser.h:36
#define WM_ISACTIVEICON
Definition: undocuser.h:33
#define NF_QUERY
Definition: winuser.h:2435
#define ERR(fmt,...)
Definition: debug.h:110
#define HTCAPTION
Definition: winuser.h:2451
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:657
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
#define GCL_HICON
Definition: winuser.h:661
#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
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_MBUTTONDOWN
Definition: winuser.h:1764
DWORD state
Definition: ntuser.h:665
unsigned int UINT
Definition: ndis.h:50
#define HKL_PREV
Definition: winuser.h:110
#define GCL_HBRBACKGROUND
Definition: winuser.h:659
UINT LastInputWasKbd
Definition: ntuser.h:153
#define WM_DEVICECHANGE
Definition: winuser.h:1793
#define NFR_ANSI
Definition: winuser.h:2433
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:275
HWND * WIN_ListChildren(HWND hWndparent)
Definition: mdi.c:140
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1644
#define WM_NCUAHDRAWFRAME
Definition: undocuser.h:46
#define WM_SYSKEYDOWN
Definition: winuser.h:1701
#define TPM_LEFTBUTTON
Definition: winuser.h:2354
struct _WND * spwndParent
Definition: ntuser.h:677
#define HIWORD(l)
Definition: typedefs.h:247
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define WA_INACTIVE
Definition: winuser.h:2597
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#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)
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
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
#define HeapFree(x, y, z)
Definition: compat.h:594
#define GetClassLongPtrW
Definition: winuser.h:4539
#define CS_PARENTDC
Definition: winuser.h:651
#define WM_KEYF1
Definition: msg.c:47
struct Rect Rect
EXTINLINE BOOL NtUserxUpdateUiState(HWND hWnd, DWORD Param)
Definition: ntwrapper.h:686
#define WM_NCLBUTTONDBLCLK
Definition: winuser.h:1676
DWORD style
Definition: ntuser.h:670

Referenced by RealDefWindowProcA(), RealDefWindowProcW(), and RegisterClientPFN().

◆ UserPaintCaption()

static void UserPaintCaption ( PWND  pwnd,
INT  Flags 
)
static

Definition at line 258 of file defwnd.c.

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 }
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
#define QUERY_WINDOW_FOREGROUND
Definition: ntuser.h:2808
static HDC
Definition: imagelist.c:92
#define DCX_USESTYLE
Definition: GetDCEx.c:10
PSERVERINFO gpsi
Definition: main.c:27
#define DCX_WINDOW
Definition: winuser.h:2095
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:3929
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
DWORD dwSRVIFlags
Definition: ntuser.h:1004
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
#define DC_ACTIVE
Definition: winuser.h:427
#define UserHMGetHandle(obj)
Definition: ntuser.h:208
#define WS_CAPTION
Definition: pedump.c:624
#define WM_NCUAHDRAWCAPTION
Definition: undocuser.h:45
#define SRVINFO_APIHOOK
Definition: ntuser.h:911
static HDC hDC
Definition: 3dtext.c:33
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
DWORD state
Definition: ntuser.h:665
#define WS_VISIBLE
Definition: pedump.c:620
BOOL NTAPI NtUserDrawCaption(HWND hWnd, HDC hDc, LPCRECT lpRc, UINT uFlags)
Definition: painting.c:2447
#define WNDS_HASCAPTION
Definition: ntuser.h:576
#define DC_DRAWCAPTIONMD
Definition: undocuser.h:149
DWORD style
Definition: ntuser.h:670

◆ UserSendUiUpdateMsg()

static BOOL CALLBACK UserSendUiUpdateMsg ( HWND  hwnd,
LPARAM  lParam 
)
static

Definition at line 248 of file defwnd.c.

249 {
250  SendMessageW(hwnd, WM_UPDATEUISTATE, (WPARAM)lParam, 0);
251  return TRUE;
252 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
UINT_PTR WPARAM
Definition: windef.h:207
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPARAM lParam
Definition: combotst.c:139

Referenced by User32DefWindowProc().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( user32  )