ReactOS  0.4.14-dev-1279-gc1464a4
main.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <wingdi.h>
#include <wincon.h>
#include <devguid.h>
#include <shlobj.h>
#include <cpl.h>
#include <regstr.h>
#include "resource.h"
Include dependency graph for main.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _APPLET
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define MAX_CPL_PAGES   32
 

Typedefs

typedef enum HWPAGE_DISPLAYMODEPHWPAGE_DISPLAYMODE
 
typedef struct _APPLET APPLET
 
typedef struct _APPLETPAPPLET
 

Enumerations

enum  HWPAGE_DISPLAYMODE {
  HWPD_STANDARDLIST = 0, HWPD_LARGELIST, HWPD_MAX = HWPD_LARGELIST, HWPD_STANDARDLIST = 0,
  HWPD_LARGELIST, HWPD_MAX = HWPD_LARGELIST, HWPD_STANDARDLIST = 0, HWPD_LARGELIST,
  HWPD_MAX = HWPD_LARGELIST, HWPD_STANDARDLIST = 0, HWPD_LARGELIST, HWPD_MAX = HWPD_LARGELIST
}
 

Functions

HWND WINAPI DeviceCreateHardwarePageEx (HWND hWndParent, LPGUID lpGuids, UINT uNumberOfGuids, HWPAGE_DISPLAYMODE DisplayMode)
 
LONG APIENTRY KeyboardApplet (HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
 
BOOL InitPropSheetPage (PROPSHEETHEADER *ppsh, WORD idDlg, DLGPROC DlgProc)
 
BOOL CALLBACK PropSheetAddPage (HPROPSHEETPAGE hpage, LPARAM lParam)
 
LONG APIENTRY MouseApplet (HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
 

Variables

HINSTANCE hApplet
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 7 of file main.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 8 of file main.h.

◆ MAX_CPL_PAGES

#define MAX_CPL_PAGES   32

Definition at line 47 of file main.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 6 of file main.h.

Typedef Documentation

◆ APPLET

◆ PAPPLET

typedef struct _APPLET * PAPPLET

◆ PHWPAGE_DISPLAYMODE

Enumeration Type Documentation

◆ HWPAGE_DISPLAYMODE

Enumerator
HWPD_STANDARDLIST 
HWPD_LARGELIST 
HWPD_MAX 
HWPD_STANDARDLIST 
HWPD_LARGELIST 
HWPD_MAX 
HWPD_STANDARDLIST 
HWPD_LARGELIST 
HWPD_MAX 
HWPD_STANDARDLIST 
HWPD_LARGELIST 
HWPD_MAX 

Definition at line 22 of file main.h.

23 {
enum HWPAGE_DISPLAYMODE * PHWPAGE_DISPLAYMODE
HWPAGE_DISPLAYMODE
Definition: main.h:22
Definition: main.h:26

Function Documentation

◆ DeviceCreateHardwarePageEx()

HWND WINAPI DeviceCreateHardwarePageEx ( HWND  hWndParent,
LPGUID  lpGuids,
UINT  uNumberOfGuids,
HWPAGE_DISPLAYMODE  DisplayMode 
)

◆ InitPropSheetPage()

BOOL InitPropSheetPage ( PROPSHEETHEADER ppsh,
WORD  idDlg,
DLGPROC  DlgProc 
)

Definition at line 45 of file main.c.

46 {
47  HPROPSHEETPAGE hPage;
48  PROPSHEETPAGE psp;
49 
50  if (ppsh->nPages < MAX_CPL_PAGES)
51  {
52  ZeroMemory(&psp, sizeof(psp));
53  psp.dwSize = sizeof(psp);
54  psp.dwFlags = PSP_DEFAULT;
55  psp.hInstance = hApplet;
56  psp.pszTemplate = MAKEINTRESOURCE(idDlg);
57  psp.pfnDlgProc = DlgProc;
58 
59  hPage = CreatePropertySheetPage(&psp);
60  if (hPage != NULL)
61  {
62  return PropSheetAddPage(hPage, (LPARAM)ppsh);
63  }
64  }
65 
66  return FALSE;
67 }
WORD idDlg
Definition: desk.c:110
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define ZeroMemory
Definition: winbase.h:1648
#define MAX_CPL_PAGES
Definition: main.h:47
HINSTANCE hApplet
Definition: main.c:33
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define CreatePropertySheetPage
Definition: prsht.h:399
#define PSP_DEFAULT
Definition: prsht.h:22
BOOL CALLBACK PropSheetAddPage(HPROPSHEETPAGE hpage, LPARAM lParam)
Definition: main.c:70
BOOL CALLBACK DlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: main.c:93
#define PROPSHEETPAGE
Definition: prsht.h:389

◆ KeyboardApplet()

LONG APIENTRY KeyboardApplet ( HWND  hwnd,
UINT  uMsg,
LPARAM  wParam,
LPARAM  lParam 
)

Definition at line 303 of file keyboard.c.

304 {
306  PROPSHEETHEADER psh;
307  HPSXA hpsxa;
308  TCHAR szCaption[256];
309  INT nPage = 0;
310  LONG ret;
311 
316 
317  if (uMsg == CPL_STARTWPARMSW && lParam != 0)
318  nPage = _wtoi((PWSTR)lParam);
319 
320  LoadString(hApplet, IDS_CPLNAME_2, szCaption, sizeof(szCaption) / sizeof(TCHAR));
321 
322  ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
323  psh.dwSize = sizeof(PROPSHEETHEADER);
324  psh.dwFlags = PSH_PROPTITLE | PSH_USEICONID | PSH_USECALLBACK;
325  psh.hwndParent = hwnd;
326  psh.hInstance = hApplet;
327  psh.pszIcon = MAKEINTRESOURCE(IDC_CPLICON_2);
328  psh.pszCaption = szCaption;
329  psh.nStartPage = 0;
330  psh.phpage = hpsp;
331  psh.pfnCallback = PropSheetProc;
332 
333  /* Load additional pages provided by shell extensions */
335 
336  /* NOTE: The speed page (CPLPAGE_KEYBOARD_SPEED) cannot be replaced by
337  shell extensions since Win2k! */
340 
341  if (hpsxa != NULL)
343 
344  if (nPage != 0 && nPage <= psh.nPages)
345  psh.nStartPage = nPage;
346 
347  ret = (LONG)(PropertySheet(&psh) != -1);
348 
349  if (hpsxa != NULL)
351 
352  return ret;
353 }
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:2048
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
Definition: shellord.c:1870
uint16_t * PWSTR
Definition: typedefs.h:55
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
#define REGSTR_PATH_CONTROLSFOLDER
Definition: regstr.h:76
#define ZeroMemory
Definition: winbase.h:1648
HINSTANCE hApplet
Definition: access.c:17
#define PSH_USECALLBACK
Definition: prsht.h:48
int32_t INT
Definition: typedefs.h:57
WPARAM wParam
Definition: combotst.c:138
#define MAX_CPL_PAGES
Definition: main.h:47
#define PSH_USEICONID
Definition: prsht.h:42
long LONG
Definition: pedump.c:60
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
static INT_PTR CALLBACK KeyboardSpeedProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: keyboard.c:44
smooth NULL
Definition: ftsmooth.c:416
#define PROPSHEETHEADER
Definition: prsht.h:392
LONG_PTR LPARAM
Definition: windef.h:208
#define IDS_CPLNAME_2
Definition: resource.h:36
#define IDD_KEYBSPEED
Definition: resource.h:29
char TCHAR
Definition: xmlstorage.h:189
#define PSH_PROPTITLE
Definition: prsht.h:40
#define IDD_HARDWARE
Definition: resource.h:28
#define IDC_CPLICON_2
Definition: resource.h:6
#define CPL_STARTWPARMSW
Definition: cpl.h:21
int ret
static VOID InitPropSheetPage(PROPSHEETPAGE *psp, PSERVICEPROPSHEET dlgInfo, WORD idDlg, DLGPROC DlgProc)
Definition: propsheet.c:15
static BOOL CALLBACK PropSheetAddPage(HPROPSHEETPAGE hpage, LPARAM lParam)
Definition: advmon.c:13
#define TEXT(s)
Definition: k32.h:26
#define PropertySheet
Definition: prsht.h:400
HPSXA WINAPI SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface)
Definition: shellord.c:1900
LPARAM lParam
Definition: combotst.c:139
#define LoadString
Definition: winuser.h:5794
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: keyboard.c:286
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
static INT_PTR CALLBACK KeybHardwareProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: keyboard.c:260

◆ MouseApplet()

LONG APIENTRY MouseApplet ( HWND  hwnd,
UINT  uMsg,
LPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1829 of file mouse.c.

1830 {
1832  PROPSHEETHEADER psh;
1833  HPSXA hpsxa;
1834  TCHAR Caption[256];
1835  UINT i;
1836  INT nPage = 0;
1837  LONG ret;
1838 
1839  UNREFERENCED_PARAMETER(lParam1);
1840  UNREFERENCED_PARAMETER(lParam2);
1841  UNREFERENCED_PARAMETER(uMsg);
1843 
1844  if (uMsg == CPL_STARTWPARMSW && lParam2 != 0)
1845  nPage = _wtoi((PWSTR)lParam2);
1846 
1847  LoadString(hApplet, IDS_CPLNAME_1, Caption, sizeof(Caption) / sizeof(TCHAR));
1848 
1849  ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
1850  psh.dwSize = sizeof(PROPSHEETHEADER);
1851  psh.dwFlags = PSH_PROPTITLE | PSH_USEICONID | PSH_USECALLBACK;
1852  psh.hwndParent = hwnd;
1853  psh.hInstance = hApplet;
1854  psh.pszIcon = MAKEINTRESOURCEW(IDC_CPLICON_1);
1855  psh.pszCaption = Caption;
1856  psh.nStartPage = 0;
1857  psh.phpage = hpsp;
1858  psh.pfnCallback = PropSheetProc;
1859 
1860  /* Load additional pages provided by shell extensions */
1862 
1863  for (i = 0; i != sizeof(PropPages) / sizeof(PropPages[0]); i++)
1864  {
1865  /* Override the background page if requested by a shell extension */
1866  if (PropPages[i].uiReplaceWith != 0 && hpsxa != NULL &&
1868  {
1869  /* The shell extension added one or more pages to replace a page.
1870  Don't create the built-in page anymore! */
1871  continue;
1872  }
1873 
1875  }
1876 
1877  if (hpsxa != NULL)
1879 
1880  if (nPage != 0 && nPage <= psh.nPages)
1881  psh.nStartPage = nPage;
1882 
1883  ret = (LONG)(PropertySheet(&psh) != -1);
1884 
1885  if (hpsxa != NULL)
1887 
1888  return ret;
1889 }
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:2048
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
Definition: shellord.c:1870
uint16_t * PWSTR
Definition: typedefs.h:55
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
#define REGSTR_PATH_CONTROLSFOLDER
Definition: regstr.h:76
#define ZeroMemory
Definition: winbase.h:1648
HINSTANCE hApplet
Definition: access.c:17
UINT uiReplaceWith
Definition: mouse.c:1818
#define PSH_USECALLBACK
Definition: prsht.h:48
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: mouse.c:1798
int32_t INT
Definition: typedefs.h:57
#define MAX_CPL_PAGES
Definition: main.h:47
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
#define PSH_USEICONID
Definition: prsht.h:42
long LONG
Definition: pedump.c:60
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
smooth NULL
Definition: ftsmooth.c:416
WORD idDlg
Definition: mouse.c:1816
#define PROPSHEETHEADER
Definition: prsht.h:392
LONG_PTR LPARAM
Definition: windef.h:208
#define IDS_CPLNAME_1
Definition: resource.h:6
char TCHAR
Definition: xmlstorage.h:189
#define PSH_PROPTITLE
Definition: prsht.h:40
static const struct @213 PropPages[]
#define CPL_STARTWPARMSW
Definition: cpl.h:21
DLGPROC DlgProc
Definition: mouse.c:1817
int ret
static VOID InitPropSheetPage(PROPSHEETPAGE *psp, PSERVICEPROPSHEET dlgInfo, WORD idDlg, DLGPROC DlgProc)
Definition: propsheet.c:15
static BOOL CALLBACK PropSheetAddPage(HPROPSHEETPAGE hpage, LPARAM lParam)
Definition: advmon.c:13
#define TEXT(s)
Definition: k32.h:26
unsigned int UINT
Definition: ndis.h:50
UINT WINAPI SHReplaceFromPropSheetExtArray(HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam)
Definition: shellord.c:2017
#define PropertySheet
Definition: prsht.h:400
#define IDC_CPLICON_1
Definition: resource.h:4
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HPSXA WINAPI SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface)
Definition: shellord.c:1900
#define LoadString
Definition: winuser.h:5794
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

◆ PropSheetAddPage()

BOOL CALLBACK PropSheetAddPage ( HPROPSHEETPAGE  hpage,
LPARAM  lParam 
)

Definition at line 70 of file main.c.

71 {
73  if (ppsh != NULL && ppsh->nPages < MAX_CPL_PAGES)
74  {
75  ppsh->phpage[ppsh->nPages++] = hpage;
76  return TRUE;
77  }
78 
79  return FALSE;
80 }
#define TRUE
Definition: types.h:120
#define MAX_CPL_PAGES
Definition: main.h:47
smooth NULL
Definition: ftsmooth.c:416
#define PROPSHEETHEADER
Definition: prsht.h:392
LPARAM lParam
Definition: combotst.c:139

Referenced by InitPropSheetPage().

Variable Documentation

◆ hApplet

HINSTANCE hApplet

Definition at line 17 of file access.c.