mirror of
https://github.com/reactos/reactos.git
synced 2025-05-28 13:38:19 +00:00
[ACCESS] Select a property page by command line, for example 'control access.cpl,,2'
This commit is contained in:
parent
c6ed215eef
commit
62721aefe5
2 changed files with 16 additions and 9 deletions
|
@ -13,9 +13,8 @@
|
||||||
|
|
||||||
#define NUM_APPLETS (1)
|
#define NUM_APPLETS (1)
|
||||||
|
|
||||||
LONG CALLBACK SystemApplet(VOID);
|
static LONG CALLBACK SystemApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam);
|
||||||
HINSTANCE hApplet = 0;
|
HINSTANCE hApplet = 0;
|
||||||
HWND hCPLWindow;
|
|
||||||
|
|
||||||
/* Applets */
|
/* Applets */
|
||||||
APPLET Applets[NUM_APPLETS] =
|
APPLET Applets[NUM_APPLETS] =
|
||||||
|
@ -185,14 +184,18 @@ PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
|
||||||
/* First Applet */
|
/* First Applet */
|
||||||
|
|
||||||
LONG CALLBACK
|
LONG CALLBACK
|
||||||
SystemApplet(VOID)
|
SystemApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
PGLOBAL_DATA pGlobalData;
|
PGLOBAL_DATA pGlobalData;
|
||||||
PROPSHEETPAGE psp[5];
|
PROPSHEETPAGE psp[5];
|
||||||
PROPSHEETHEADER psh;
|
PROPSHEETHEADER psh;
|
||||||
TCHAR Caption[1024];
|
TCHAR Caption[1024];
|
||||||
|
INT nPage = 0;
|
||||||
INT ret;
|
INT ret;
|
||||||
|
|
||||||
|
if (uMsg == CPL_STARTWPARMSW && lParam != 0)
|
||||||
|
nPage = _wtoi((PWSTR)lParam);
|
||||||
|
|
||||||
LoadString(hApplet, IDS_CPLSYSTEMNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
|
LoadString(hApplet, IDS_CPLSYSTEMNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
|
||||||
|
|
||||||
pGlobalData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GLOBAL_DATA));
|
pGlobalData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GLOBAL_DATA));
|
||||||
|
@ -208,7 +211,7 @@ SystemApplet(VOID)
|
||||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||||
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK;
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK;
|
||||||
psh.hwndParent = hCPLWindow;
|
psh.hwndParent = hwnd;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
psh.pszIcon = MAKEINTRESOURCEW(IDI_CPLACCESS);
|
psh.pszIcon = MAKEINTRESOURCEW(IDI_CPLACCESS);
|
||||||
psh.pszCaption = Caption;
|
psh.pszCaption = Caption;
|
||||||
|
@ -223,6 +226,9 @@ SystemApplet(VOID)
|
||||||
InitPropSheetPage(&psp[3], IDD_PROPPAGEMOUSE, MousePageProc, pGlobalData);
|
InitPropSheetPage(&psp[3], IDD_PROPPAGEMOUSE, MousePageProc, pGlobalData);
|
||||||
InitPropSheetPage(&psp[4], IDD_PROPPAGEGENERAL, GeneralPageProc, pGlobalData);
|
InitPropSheetPage(&psp[4], IDD_PROPPAGEGENERAL, GeneralPageProc, pGlobalData);
|
||||||
|
|
||||||
|
if (nPage != 0 && nPage <= psh.nPages)
|
||||||
|
psh.nStartPage = nPage;
|
||||||
|
|
||||||
ret = PropertySheet(&psh);
|
ret = PropertySheet(&psh);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, pGlobalData);
|
HeapFree(GetProcessHeap(), 0, pGlobalData);
|
||||||
|
@ -258,9 +264,11 @@ CPlApplet(HWND hwndCPl,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CPL_DBLCLK:
|
case CPL_DBLCLK:
|
||||||
hCPLWindow = hwndCPl;
|
Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
|
||||||
Applets[i].AppletProc();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CPL_STARTWPARMSW:
|
||||||
|
return Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -10,17 +10,16 @@
|
||||||
#include <winuser.h>
|
#include <winuser.h>
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
|
#include <cpl.h>
|
||||||
|
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
typedef LONG (CALLBACK *APPLET_INITPROC)(VOID);
|
|
||||||
|
|
||||||
typedef struct _APPLET
|
typedef struct _APPLET
|
||||||
{
|
{
|
||||||
INT idIcon;
|
INT idIcon;
|
||||||
INT idName;
|
INT idName;
|
||||||
INT idDescription;
|
INT idDescription;
|
||||||
APPLET_INITPROC AppletProc;
|
APPLET_PROC AppletProc;
|
||||||
} APPLET, *PAPPLET;
|
} APPLET, *PAPPLET;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue