ReactOS  0.4.14-dev-608-gd495a4f
regcontrol.c File Reference
#include <user32.h>
Include dependency graph for regcontrol.c:

Go to the source code of this file.

Functions

HRGN set_control_clipping (HDC hdc, const RECT *rect)
 
BOOL WINAPI RegisterSystemControls (VOID)
 
LRESULT WINAPI MsgWindowProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI DialogWndProc_common (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
 
BOOL WINAPI RegisterClientPFN (VOID)
 

Variables

DWORD RegisterDefaultClasses = FALSE
 
static PFNCLIENT pfnClientA
 
static PFNCLIENT pfnClientW
 
static PFNCLIENTWORKER pfnClientWorker
 
struct {
   const struct builtin_class_descr *   desc
 
   WORD   fnid
 
   WORD   ClsId
 
g_SysClasses []
 

Function Documentation

◆ DialogWndProc_common()

LRESULT WINAPI DialogWndProc_common ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL  unicode 
)

Definition at line 136 of file regcontrol.c.

137 {
138  if (unicode)
139  return DefDlgProcW( hwnd, uMsg, wParam, lParam);
140  return DefDlgProcA( hwnd, uMsg, wParam, lParam);
141 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT WINAPI DefDlgProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefDlgProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPARAM lParam
Definition: combotst.c:139

Referenced by RegisterClientPFN().

◆ MsgWindowProc()

LRESULT WINAPI MsgWindowProc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 113 of file regcontrol.c.

114 {
115  PWND pWnd;
116 
117  pWnd = ValidateHwnd(hwnd);
118  if (pWnd)
119  {
120  if (!pWnd->fnid)
121  {
123  }
124  }
125 
126  if (message == WM_NCCREATE) return TRUE;
127 
128  if (message == WM_DESTROY)
130 
131  return DefWindowProc(hwnd, message, wParam, lParam );
132 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
#define FNID_DESTROY
Definition: ntuser.h:859
#define WM_NCCREATE
Definition: winuser.h:1665
WPARAM wParam
Definition: combotst.c:138
#define FNID_MESSAGEWND
Definition: ntuser.h:826
DWORD fnid
Definition: ntuser.h:673
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1591
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
Definition: ntuser.h:657
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
Definition: window.c:4126
LPARAM lParam
Definition: combotst.c:139

Referenced by RegisterClientPFN().

◆ RegisterClientPFN()

BOOL WINAPI RegisterClientPFN ( VOID  )

Definition at line 143 of file regcontrol.c.

144 {
146 
193 
205 
207  &pfnClientW,
210 
211  return NT_SUCCESS(Status) ? TRUE : FALSE;
212 }
LRESULT WINAPI ListBoxWndProc_common(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: listbox.c:2600
LRESULT WINAPI DesktopWndProcW(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: desktop.c:33
#define TRUE
Definition: types.h:120
WNDPROC pfnStaticWndProc
Definition: ntuser.h:772
LRESULT WINAPI ListBoxWndProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: listbox.c:3274
WNDPROC pfnGhostWndProc
Definition: ntuser.h:774
WNDPROC pfnEditWndProc
Definition: ntuser.h:769
LRESULT WINAPI SwitchWndProcA(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: appswitch.c:837
LRESULT WINAPI DefDlgProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI MsgWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: regcontrol.c:113
WNDPROC_EX pfnStaticWndProc
Definition: ntuser.h:805
WNDPROC pfnDefWindowProc
Definition: ntuser.h:762
LONG NTSTATUS
Definition: precomp.h:26
WNDPROC pfnMessageWindowProc
Definition: ntuser.h:763
WNDPROC pfnDialogWndProc
Definition: ntuser.h:768
LRESULT WINAPI PopupMenuWndProcW(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: menu.c:305
LRESULT WINAPI MDIClientWndProc_common(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: mdi.c:1101
WNDPROC pfnComboListBoxProc
Definition: ntuser.h:767
LRESULT WINAPI GhostWndProc_common(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: ghost.c:515
HINSTANCE User32Instance
Definition: dllmain.c:27
NTSTATUS NTAPI NtUserInitializeClientPfnArrays(PPFNCLIENT pfnClientA, PPFNCLIENT pfnClientW, PPFNCLIENTWORKER pfnClientWorker, HINSTANCE hmodUser)
Definition: ntstubs.c:124
LRESULT WINAPI ScrollBarWndProcW(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: scrollbar.c:1427
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WNDPROC_EX pfnMDIClientWndProc
Definition: ntuser.h:804
WNDPROC pfnComboBoxWndProc
Definition: ntuser.h:766
WNDPROC pfnListBoxWndProc
Definition: ntuser.h:770
LRESULT CALLBACK GhostWndProcW(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: ghost.c:610
WNDPROC_EX pfnButtonWndProc
Definition: ntuser.h:798
WNDPROC pfnDispatchDefWindowProc
Definition: ntuser.h:778
WNDPROC_EX pfnComboListBoxProc
Definition: ntuser.h:800
WNDPROC pfnMenuWndProc
Definition: ntuser.h:760
WNDPROC_EX pfnListBoxWndProc
Definition: ntuser.h:803
WNDPROC_EX pfnEditWndProc
Definition: ntuser.h:802
LRESULT WINAPI ImeWndProcW(HWND, UINT, WPARAM, LPARAM)
Definition: imm.c:280
LRESULT WINAPI StaticWndProcA(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: static.c:576
LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: button.c:243
LRESULT WINAPI IconTitleWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: icontitle.c:184
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
LRESULT WINAPI User32DefWindowProc(HWND, UINT, WPARAM, LPARAM, BOOL)
Definition: defwnd.c:316
LRESULT CALLBACK GhostWndProcA(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: ghost.c:604
LRESULT WINAPI ImeWndProcA(HWND, UINT, WPARAM, LPARAM)
Definition: imm.c:275
LRESULT WINAPI ImeWndProc_common(HWND, UINT, WPARAM, LPARAM, BOOL)
Definition: imm.c:224
LRESULT WINAPI MDIClientWndProcW(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: mdi.c:1364
WNDPROC pfnHkINLPCWPSTRUCT
Definition: ntuser.h:775
WNDPROC pfnScrollBarWndProc
Definition: ntuser.h:758
LRESULT WINAPI ComboWndProc_common(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: combo.c:1822
LRESULT WINAPI EditWndProc_common(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: edit.c:4743
LRESULT WINAPI DefDlgProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI StaticWndProc_common(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: static.c:337
WNDPROC_EX pfnComboBoxWndProc
Definition: ntuser.h:799
LRESULT WINAPI SwitchWndProcW(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: appswitch.c:842
LRESULT WINAPI DialogWndProc_common(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: regcontrol.c:136
WNDPROC pfnDesktopWndProc
Definition: ntuser.h:761
WNDPROC_EX pfnImeWndProc
Definition: ntuser.h:806
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI MDIClientWndProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: mdi.c:1355
static PFNCLIENT pfnClientA
Definition: regcontrol.c:15
Status
Definition: gdiplustypes.h:24
LRESULT WINAPI StaticWndProcW(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: static.c:585
WNDPROC pfnImeWndProc
Definition: ntuser.h:773
WNDPROC_EX pfnGhostWndProc
Definition: ntuser.h:807
WNDPROC pfnSwitchWindowProc
Definition: ntuser.h:764
LRESULT WINAPI PopupMenuWndProcA(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
Definition: menu.c:376
static PFNCLIENTWORKER pfnClientWorker
Definition: regcontrol.c:17
LRESULT WINAPI EditWndProcA(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI EditWndProcW(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI ListBoxWndProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: listbox.c:3266
WNDPROC_EX pfnCtfHookProc
Definition: ntuser.h:808
LRESULT WINAPI ButtonWndProcW(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
WNDPROC_EX pfnDialogWndProc
Definition: ntuser.h:801
LRESULT WINAPI ButtonWndProcA(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI ScrollBarWndProcA(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: scrollbar.c:1433
WNDPROC pfnDispatchHook
Definition: ntuser.h:777
LRESULT WINAPI DesktopWndProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: message.c:1306
LRESULT WINAPI ComboWndProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
WNDPROC pfnDispatchMessage
Definition: ntuser.h:779
WNDPROC pfnButtonWndProc
Definition: ntuser.h:765
static PFNCLIENT pfnClientW
Definition: regcontrol.c:16
WNDPROC pfnHkINLPCWPRETSTRUCT
Definition: ntuser.h:776
WNDPROC pfnTitleWndProc
Definition: ntuser.h:759
WNDPROC pfnMDIClientWndProc
Definition: ntuser.h:771
LRESULT WINAPI ComboWndProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
WNDPROC pfnMDIActivateDlgProc
Definition: ntuser.h:780

Referenced by ClientThreadSetupHelper().

◆ RegisterSystemControls()

BOOL WINAPI RegisterSystemControls ( VOID  )

Definition at line 70 of file regcontrol.c.

71 {
73  UINT i;
74  ATOM atom;
75 
76  if (RegisterDefaultClasses) return TRUE;
77 
78  ZeroMemory(&WndClass, sizeof(WndClass));
79 
80  WndClass.cbSize = sizeof(WndClass);
81 
82  for (i = 0; i != sizeof(g_SysClasses) / sizeof(g_SysClasses[0]); i++)
83  {
84  WndClass.lpszClassName = g_SysClasses[i].desc->name;
85 
86  // Set Global bit!
87  WndClass.style = g_SysClasses[i].desc->style|CS_GLOBALCLASS;
88  WndClass.lpfnWndProc = g_SysClasses[i].desc->procW;
89  WndClass.cbWndExtra = g_SysClasses[i].desc->extra;
90  WndClass.hCursor = LoadCursorW(NULL, g_SysClasses[i].desc->cursor);
91  WndClass.hbrBackground= g_SysClasses[i].desc->brush;
92 
94  0,
96  0,
97  FALSE);
98  if (atom)
100  }
101 
102  if ( //gpsi->dwSRVIFlags & SRVINFO_IMM32 && Not supported yet, need NlsMbCodePageTag working in Win32k.
103  !(RegisterDefaultClasses & ICLASS_TO_MASK(ICLS_IME))) // So, work like XP.
104  {
106  }
107 
108  return TRUE;
109 }
#define TRUE
Definition: types.h:120
WORD ClsId
Definition: regcontrol.c:50
WORD ATOM
Definition: dimm.idl:113
#define ZeroMemory
Definition: winbase.h:1642
ATOM WINAPI RegisterClassExWOWW(WNDCLASSEXW *, LPDWORD, WORD, DWORD, BOOL)
Definition: class.c:1411
static const struct @4160 g_SysClasses[]
WORD fnid
Definition: regcontrol.c:49
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
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
smooth NULL
Definition: ftsmooth.c:416
#define CS_GLOBALCLASS
Definition: winuser.h:647
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define ICLS_IME
Definition: ntuser.h:888
BOOL WINAPI RegisterIMEClass(VOID)
Definition: imm.c:313
unsigned int UINT
Definition: ndis.h:50
#define ICLASS_TO_MASK(iCls)
Definition: ntuser.h:863
DWORD RegisterDefaultClasses
Definition: regcontrol.c:13
WCHAR WndClass[]
Definition: capicon.c:23

Referenced by CreateWindowExA(), CreateWindowExW(), GetClassInfoExA(), GetClassInfoExW(), RegisterClassExWOWW(), and User32CreateWindowEx().

◆ set_control_clipping()

HRGN set_control_clipping ( HDC  hdc,
const RECT rect 
)

Definition at line 26 of file regcontrol.c.

27 {
28  RECT rc = *rect;
29  HRGN hrgn = CreateRectRgn( 0, 0, 0, 0 );
30 
31  if (GetClipRgn( hdc, hrgn ) != 1)
32  {
33  DeleteObject( hrgn );
34  hrgn = 0;
35  }
36  DPtoLP( hdc, (POINT *)&rc, 2 );
37  if (GetLayout( hdc ) & LAYOUT_RTL) /* compensate for the shifting done by IntersectClipRect */
38  {
39  rc.left++;
40  rc.right++;
41  }
42  IntersectClipRect( hdc, rc.left, rc.top, rc.right, rc.bottom );
43  return hrgn;
44 }
#define LAYOUT_RTL
Definition: wingdi.h:1370
LONG top
Definition: windef.h:307
int WINAPI IntersectClipRect(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
BOOL WINAPI DPtoLP(_In_ HDC hdc, _Inout_updates_(c) LPPOINT lppt, _In_ int c)
& rect
Definition: startmenu.cpp:1413
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
DWORD WINAPI GetLayout(_In_ HDC hdc)
Definition: coord.c:741
LONG bottom
Definition: windef.h:309
int WINAPI GetClipRgn(_In_ HDC, _In_ HRGN)

Variable Documentation

◆ ClsId

WORD ClsId

Definition at line 50 of file regcontrol.c.

Referenced by RegisterSystemControls().

◆ desc

Definition at line 48 of file regcontrol.c.

Referenced by RegisterSystemControls().

◆ fnid

WORD fnid

Definition at line 49 of file regcontrol.c.

Referenced by RegisterSystemControls().

◆ g_SysClasses

const { ... } g_SysClasses[]
Initial value:
=
{
}
#define FNID_EDIT
Definition: ntuser.h:832
#define ICLS_MDICLIENT
Definition: ntuser.h:879
#define FNID_COMBOBOX
Definition: ntuser.h:829
const struct builtin_class_descr EDIT_builtin_class
Definition: edit.c:5363
const struct builtin_class_descr BUTTON_builtin_class
Definition: button.c:142
#define ICLS_EDIT
Definition: ntuser.h:874
#define ICLS_DIALOG
Definition: ntuser.h:891
#define ICLS_LISTBOX
Definition: ntuser.h:876
#define FNID_DIALOG
Definition: ntuser.h:831
const struct builtin_class_descr MDICLIENT_builtin_class
Definition: mdi.c:213
#define ICLS_GHOST
Definition: ntuser.h:889
#define FNID_MDICLIENT
Definition: ntuser.h:834
#define ICLS_STATIC
Definition: ntuser.h:875
const struct builtin_class_descr COMBO_builtin_class
Definition: combo.c:67
const struct builtin_class_descr DIALOG_builtin_class
Definition: dialog.c:111
#define FNID_COMBOLBOX
Definition: ntuser.h:830
#define FNID_LISTBOX
Definition: ntuser.h:833
#define ICLS_COMBOLBOX
Definition: ntuser.h:880
#define FNID_GHOST
Definition: ntuser.h:837
const struct builtin_class_descr STATIC_builtin_class
Definition: static.c:81
#define FNID_BUTTON
Definition: ntuser.h:828
const struct builtin_class_descr COMBOLBOX_builtin_class
Definition: listbox.c:142
#define ICLS_BUTTON
Definition: ntuser.h:873
const struct builtin_class_descr LISTBOX_builtin_class
Definition: listbox.c:126
#define FNID_STATIC
Definition: ntuser.h:835
const struct builtin_class_descr GHOST_builtin_class
Definition: ghost.c:17
#define ICLS_COMBOBOX
Definition: ntuser.h:878

Referenced by RegisterSystemControls().

◆ pfnClientA

PFNCLIENT pfnClientA
static

Definition at line 15 of file regcontrol.c.

Referenced by NtUserInitializeClientPfnArrays(), and RegisterClientPFN().

◆ pfnClientW

PFNCLIENT pfnClientW
static

Definition at line 16 of file regcontrol.c.

Referenced by NtUserInitializeClientPfnArrays(), and RegisterClientPFN().

◆ pfnClientWorker

PFNCLIENTWORKER pfnClientWorker
static

Definition at line 17 of file regcontrol.c.

Referenced by NtUserInitializeClientPfnArrays(), and RegisterClientPFN().

◆ RegisterDefaultClasses