/* Display Applet */ static LONG APIENTRY UsrmgrApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) { PROPSHEETPAGE psp[2]; PROPSHEETHEADER psh; TCHAR Caption[1024]; UNREFERENCED_PARAMETER(lParam); UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(uMsg); LoadString(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR)); ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK; psh.hwndParent = hwnd; psh.hInstance = hApplet; psh.pszIcon = MAKEINTRESOURCEW(IDI_USRMGR_ICON); psh.pszCaption = Caption; psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); psh.nStartPage = 0; psh.ppsp = psp; psh.pfnCallback = PropSheetProc; InitPropSheetPage(&psp[0], IDD_USERS, UsersPageProc); InitPropSheetPage(&psp[1], IDD_GROUPS, GroupsPageProc); /* InitPropSheetPage(&psp[2], IDD_EXTRA, ExtraPageProc); */ return (LONG)(PropertySheet(&psh) != -1); }
VOID DisplayTrayProperties(IN HWND hwndOwner) { PROPSHEET_INFO propInfo; PROPSHEETHEADER psh; PROPSHEETPAGE psp[5]; TCHAR szCaption[256]; if (!LoadString(hExplorerInstance, IDS_TASKBAR_STARTMENU_PROP_CAPTION, szCaption, sizeof(szCaption) / sizeof(szCaption[0]))) { return; } ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE; psh.hwndParent = hwndOwner; psh.hInstance = hExplorerInstance; psh.hIcon = NULL; psh.pszCaption = szCaption; psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); psh.nStartPage = 0; psh.ppsp = psp; InitPropSheetPage(&psp[0], IDD_TASKBARPROP_TASKBAR, TaskbarPageProc, (LPARAM)&propInfo); InitPropSheetPage(&psp[1], IDD_TASKBARPROP_STARTMENU, StartMenuPageProc, (LPARAM)&propInfo); InitPropSheetPage(&psp[2], IDD_TASKBARPROP_NOTIFICATION, NotificationPageProc, (LPARAM)&propInfo); InitPropSheetPage(&psp[3], IDD_TASKBARPROP_TOOLBARS, ToolbarsPageProc, (LPARAM)&propInfo); InitPropSheetPage(&psp[4], IDD_TASKBARPROP_ADVANCED, AdvancedSettingsPageProc, (LPARAM)&propInfo); PropertySheet(&psh); }
static LONG APIENTRY Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) { PROPSHEETPAGE psp[3]; PROPSHEETHEADER psh; TCHAR Caption[BUFFERSIZE]; if (OpenSetupInf()) { ParseSetupInf(); } LoadString(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR)); ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE; psh.hwndParent = hCPLWindow; psh.hInstance = hApplet; psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON)); psh.pszCaption = Caption; psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); psh.nStartPage = 0; psh.ppsp = psp; InitPropSheetPage(&psp[0], IDD_GENERALPAGE, GeneralPageProc); InitPropSheetPage(&psp[1], IDD_LANGUAGESPAGE, LanguagesPageProc); InitPropSheetPage(&psp[2], IDD_ADVANCEDPAGE, AdvancedPageProc); return (LONG)(PropertySheet(&psh) != -1); }
/* First Applet */ static LONG CALLBACK SystemApplet(VOID) { PROPSHEETPAGEW page[2]; PROPSHEETHEADERW header; WCHAR szCaption[MAX_STR_LEN]; LoadStringW(hApplet, IDS_CPLSYSTEMNAME, szCaption, ARRAYSIZE(szCaption)); ZeroMemory(&header, sizeof(header)); header.dwSize = sizeof(header); header.dwFlags = PSH_PROPSHEETPAGE; header.hwndParent = hCPLWindow; header.hInstance = hApplet; header.hIcon = LoadIconW(hApplet, MAKEINTRESOURCEW(IDI_CPLSYSTEM)); header.pszCaption = szCaption; header.nPages = ARRAYSIZE(page); header.nStartPage = 0; header.ppsp = page; header.pfnCallback = NULL; /* Settings */ InitPropSheetPage(&page[0], IDD_PROPPAGESETTINGS, SettingsPageProc); /* Advanced Settings */ InitPropSheetPage(&page[1], IDD_PROPPAGEADVANCEDSETTINGS, AdvancedSettingsPageProc); return (LONG)(PropertySheetW(&header) != -1); }
/* First Applet */ static LONG APIENTRY Applet1(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) { HPROPSHEETPAGE hpsp[MAX_POWER_PAGES]; PROPSHEETHEADER psh; HPSXA hpsxa = NULL; TCHAR Caption[1024]; SYSTEM_POWER_CAPABILITIES spc; LONG ret; UNREFERENCED_PARAMETER(uMsg); UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(lParam); memset(Caption, 0x0, sizeof(Caption)); LoadString(hApplet, IDS_CPLNAME_1, Caption, sizeof(Caption) / sizeof(TCHAR)); ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_PROPTITLE; psh.hwndParent = hwnd; psh.hInstance = hApplet; psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON_1)); psh.pszCaption = Caption; psh.nPages = 0; psh.nStartPage = 0; psh.phpage = hpsp; InitPropSheetPage(&psh, IDD_PROPPAGEPOWERSHEMES, (DLGPROC)PowerSchemesDlgProc); if (GetPwrCapabilities(&spc)) { if (spc.SystemBatteriesPresent) { InitPropSheetPage(&psh, IDD_PROPPAGEALARMS, (DLGPROC)AlarmsDlgProc); } } InitPropSheetPage(&psh, IDD_PROPPAGEADVANCED, (DLGPROC)AdvancedDlgProc); InitPropSheetPage(&psh, IDD_PROPPAGEHIBERNATE, (DLGPROC)HibernateDlgProc); /* Load additional pages provided by shell extensions */ hpsxa = SHCreatePropSheetExtArray(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\Power"), MAX_POWER_PAGES - psh.nPages); if (hpsxa != NULL) SHAddFromPropSheetExtArray(hpsxa, PropSheetAddPage, (LPARAM)&psh); ret = (LONG)(PropertySheet(&psh) != -1); if (hpsxa != NULL) SHDestroyPropSheetExtArray(hpsxa); return ret; }
/* First Applet */ LONG CALLBACK SystemApplet(VOID) { HPROPSHEETPAGE hpsp[MAX_SYSTEM_PAGES]; PROPSHEETHEADER psh; HMODULE hNetIdDll; HPSXA hpsxa = NULL; LONG Ret; static INITCOMMONCONTROLSEX icc = {sizeof(INITCOMMONCONTROLSEX), ICC_LINK_CLASS}; if (!InitCommonControlsEx(&icc)) return 0; ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_PROPTITLE; psh.hwndParent = hCPLWindow; psh.hInstance = hApplet; psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM)); psh.pszCaption = MAKEINTRESOURCE(IDS_CPLSYSTEMNAME); psh.nPages = 0; psh.nStartPage = 0; psh.phpage = hpsp; psh.pfnCallback = NULL; InitPropSheetPage(&psh, IDD_PROPPAGEGENERAL, (DLGPROC) GeneralPageProc); hNetIdDll = AddNetIdPage(&psh); InitPropSheetPage(&psh, IDD_PROPPAGEHARDWARE, (DLGPROC) HardwarePageProc); InitPropSheetPage(&psh, IDD_PROPPAGEADVANCED, (DLGPROC) AdvancedPageProc); /* Load additional pages provided by shell extensions */ hpsxa = SHCreatePropSheetExtArray(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\System"), MAX_SYSTEM_PAGES - psh.nPages); if (hpsxa != NULL) { SHAddFromPropSheetExtArray(hpsxa, PropSheetAddPage, (LPARAM)&psh); } Ret = (LONG)(PropertySheet(&psh) != -1); if (hpsxa != NULL) { SHDestroyPropSheetExtArray(hpsxa); } if (hNetIdDll != NULL) FreeLibrary(hNetIdDll); return Ret; }
LONG CALLBACK SystemApplet(VOID) { PGLOBAL_DATA pGlobalData; PROPSHEETPAGE psp[5]; PROPSHEETHEADER psh; TCHAR Caption[1024]; INT ret; LoadString(hApplet, IDS_CPLSYSTEMNAME, Caption, sizeof(Caption) / sizeof(TCHAR)); pGlobalData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GLOBAL_DATA)); if (pGlobalData == NULL) return 0; if (!ReadSettings(pGlobalData)) { HeapFree(GetProcessHeap(), 0, pGlobalData); return 0; } ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK; psh.hwndParent = hCPLWindow; psh.hInstance = hApplet; psh.pszIcon = MAKEINTRESOURCEW(IDI_CPLACCESS); psh.pszCaption = Caption; psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); psh.nStartPage = 0; psh.ppsp = psp; psh.pfnCallback = PropSheetProc; InitPropSheetPage(&psp[0], IDD_PROPPAGEKEYBOARD, KeyboardPageProc, pGlobalData); InitPropSheetPage(&psp[1], IDD_PROPPAGESOUND, SoundPageProc, pGlobalData); InitPropSheetPage(&psp[2], IDD_PROPPAGEDISPLAY, DisplayPageProc, pGlobalData); InitPropSheetPage(&psp[3], IDD_PROPPAGEMOUSE, MousePageProc, pGlobalData); InitPropSheetPage(&psp[4], IDD_PROPPAGEGENERAL, GeneralPageProc, pGlobalData); ret = PropertySheet(&psh); HeapFree(GetProcessHeap(), 0, pGlobalData); return (LONG)(ret != -1); }
/* Display Applet */ static LONG APIENTRY DisplayApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) { HPROPSHEETPAGE hpsp[MAX_DESK_PAGES]; PROPSHEETHEADER psh; HPSXA hpsxa; TCHAR Caption[1024]; LONG ret; UINT i; UNREFERENCED_PARAMETER(lParam); UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(uMsg); UNREFERENCED_PARAMETER(hwnd); g_GlobalData.desktop_color = GetSysColor(COLOR_DESKTOP); LoadString(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR)); ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_USECALLBACK | PSH_PROPTITLE; psh.hwndParent = hCPLWindow; psh.hInstance = hApplet; psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_DESK_ICON)); psh.pszCaption = Caption; psh.nPages = 0; psh.nStartPage = 0; psh.phpage = hpsp; /* Allow shell extensions to replace the background page */ hpsxa = SHCreatePropSheetExtArray(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\Desk"), MAX_DESK_PAGES - psh.nPages); for (i = 0; i != sizeof(PropPages) / sizeof(PropPages[0]); i++) { /* Override the background page if requested by a shell extension */ if (PropPages[i].idDlg == IDD_BACKGROUND && hpsxa != NULL && SHReplaceFromPropSheetExtArray(hpsxa, CPLPAGE_DISPLAY_BACKGROUND, PropSheetAddPage, (LPARAM)&psh) != 0) { /* The shell extension added one or more pages to replace the background page. Don't create the built-in page anymore! */ continue; } InitPropSheetPage(&psh, PropPages[i].idDlg, PropPages[i].DlgProc, PropPages[i].Callback); } /* NOTE: Don't call SHAddFromPropSheetExtArray here because this applet only allows replacing the background page but not extending the applet by more pages */ ret = (LONG)(PropertySheet(&psh) != -1); if (hpsxa != NULL) SHDestroyPropSheetExtArray(hpsxa); return ret; }
static LONG APIENTRY Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) { PROPSHEETHEADER psh; PROPSHEETPAGEW psp[3]; WCHAR Caption[256]; LONG Ret = 0; UNREFERENCED_PARAMETER(uMsg); UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(lParam); if (RegisterMonthCalControl(hApplet) && RegisterClockControl()) { LoadStringW(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(WCHAR)); ZeroMemory(&psh, sizeof(PROPSHEETHEADERW)); psh.dwSize = sizeof(PROPSHEETHEADERW); psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE; psh.hwndParent = hwnd; psh.hInstance = hApplet; psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCEW(IDC_CPLICON)); psh.pszCaption = Caption; psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGEW); psh.nStartPage = 0; psh.ppsp = psp; InitPropSheetPage(&psp[0], IDD_DATETIMEPAGE, (DLGPROC) DateTimePageProc); InitPropSheetPage(&psp[1], IDD_TIMEZONEPAGE, (DLGPROC) TimeZonePageProc); InitPropSheetPage(&psp[2], IDD_INETTIMEPAGE, (DLGPROC) InetTimePageProc); Ret = (LONG)(PropertySheetW(&psh) != -1); UnregisterMonthCalControl(hApplet); UnregisterClockControl(); } return Ret; }
LONG APIENTRY MmSysApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) { PROPSHEETPAGE psp[5]; PROPSHEETHEADER psh; // = { 0 }; TCHAR Caption[256]; UNREFERENCED_PARAMETER(lParam); UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(uMsg); LoadString(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE; psh.hwndParent = hwnd; psh.hInstance = hApplet; psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLICON)); psh.pszCaption = Caption; psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); psh.nStartPage = 0; psh.ppsp = psp; InitPropSheetPage(&psp[0], IDD_VOLUME,VolumeDlgProc); InitPropSheetPage(&psp[1], IDD_SOUNDS,SoundsDlgProc); InitPropSheetPage(&psp[2], IDD_AUDIO,AudioDlgProc); InitPropSheetPage(&psp[3], IDD_VOICE,VoiceDlgProc); InitPropSheetPage(&psp[4], IDD_HARDWARE,HardwareDlgProc); return (LONG)(PropertySheet(&psh) != -1); }
BOOL UserProperties(HWND hwndDlg) { PROPSHEETPAGE psp[3]; PROPSHEETHEADER psh; TCHAR szUserName[UNLEN]; INT nItem; HWND hwndLV; hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST); nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED); if (nItem == -1) return FALSE; /* Get the new user name */ ListView_GetItemText(hwndLV, nItem, 0, szUserName, UNLEN); ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE; psh.hwndParent = hwndDlg; psh.hInstance = hApplet; psh.hIcon = NULL; psh.pszCaption = szUserName; psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); psh.nStartPage = 0; psh.ppsp = psp; InitPropSheetPage(&psp[0], IDD_USER_GENERAL, (DLGPROC)UserGeneralPageProc, szUserName); InitPropSheetPage(&psp[1], IDD_USER_MEMBERSHIP, (DLGPROC)UserMembershipPageProc, szUserName); InitPropSheetPage(&psp[2], IDD_USER_PROFILE, (DLGPROC)UserProfilePageProc, szUserName); return (PropertySheet(&psh) == IDOK); }
/* First Applet */ LONG APIENTRY InitApplet(HWND hWnd, UINT uMsg, LPARAM wParam, LPARAM lParam) { HANDLE hSection = (HANDLE)wParam; BOOL GuiTermInfo = FALSE; PCONSOLE_PROPS pSharedInfo; PCONSOLE_PROPS pConInfo; WCHAR szTitle[MAX_PATH + 1]; PROPSHEETPAGE psp[4]; PROPSHEETHEADER psh; INT i = 0; UNREFERENCED_PARAMETER(uMsg); /* * CONSOLE.DLL shares information with CONSRV with wParam: * wParam is a handle to a shared section holding a CONSOLE_PROPS struct. * * NOTE: lParam is not used. */ /* Allocate a local buffer to hold console information */ pConInfo = AllocConsoleInfo(); if (!pConInfo) return 0; /* Map the shared section */ pSharedInfo = MapViewOfFile(hSection, FILE_MAP_READ, 0, 0, 0); if (pSharedInfo == NULL) { HeapFree(GetProcessHeap(), 0, pConInfo); return 0; } /* Find the console window and whether we must use default parameters */ pConInfo->hConsoleWindow = pSharedInfo->hConsoleWindow; pConInfo->ShowDefaultParams = pSharedInfo->ShowDefaultParams; /* Check that we are going to modify GUI terminal information */ GuiTermInfo = ( pSharedInfo->TerminalInfo.Size == sizeof(GUI_CONSOLE_INFO) && pSharedInfo->TerminalInfo.TermInfo != 0 ); if (pConInfo->ShowDefaultParams || !GuiTermInfo) { /* Use defaults */ InitConsoleDefaults(pConInfo); } else { /* * Copy the shared data into our allocated buffer, and * de-offsetize the address of terminal-specific information. */ RtlCopyMemory(pConInfo, pSharedInfo, sizeof(CONSOLE_PROPS) + sizeof(GUI_CONSOLE_INFO)); pConInfo->TerminalInfo.TermInfo = (PVOID)((ULONG_PTR)pConInfo + (ULONG_PTR)pConInfo->TerminalInfo.TermInfo); } /* Close the section */ UnmapViewOfFile(pSharedInfo); CloseHandle(hSection); /* Initialize the property sheet structure */ ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE | /* PSH_USEHICON */ PSH_USEICONID | PSH_NOAPPLYNOW; if (pConInfo->ci.ConsoleTitle[0] != L'\0') { wcsncpy(szTitle, L"\"", sizeof(szTitle) / sizeof(szTitle[0])); wcsncat(szTitle, pConInfo->ci.ConsoleTitle, sizeof(szTitle) / sizeof(szTitle[0])); wcsncat(szTitle, L"\"", sizeof(szTitle) / sizeof(szTitle[0])); } else { wcscpy(szTitle, L"ReactOS Console"); } psh.pszCaption = szTitle; psh.hwndParent = pConInfo->hConsoleWindow; psh.hInstance = hApplet; // psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON)); psh.pszIcon = MAKEINTRESOURCE(IDC_CPLICON); psh.nPages = 4; psh.nStartPage = 0; psh.ppsp = psp; InitPropSheetPage(&psp[i++], IDD_PROPPAGEOPTIONS, (DLGPROC) OptionsProc, (LPARAM)pConInfo); InitPropSheetPage(&psp[i++], IDD_PROPPAGEFONT, (DLGPROC) FontProc, (LPARAM)pConInfo); InitPropSheetPage(&psp[i++], IDD_PROPPAGELAYOUT, (DLGPROC) LayoutProc, (LPARAM)pConInfo); InitPropSheetPage(&psp[i++], IDD_PROPPAGECOLORS, (DLGPROC) ColorsProc, (LPARAM)pConInfo); return (PropertySheet(&psh) != -1); }