ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

usrmgr.c
Go to the documentation of this file.
00001 /* $Id$
00002  *
00003  * COPYRIGHT:       See COPYING in the top level directory
00004  * PROJECT:         ReactOS User Manager Control Panel
00005  * FILE:            dll/cpl/usrmgr/usrmgr.c
00006  * PURPOSE:         Main functions
00007  *
00008  * PROGRAMMERS:     Eric Kohl
00009  */
00010 
00011 #include "usrmgr.h"
00012 
00013 #define NUM_APPLETS 1
00014 
00015 static LONG APIENTRY UsrmgrApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam);
00016 
00017 HINSTANCE hApplet = 0;
00018 
00019 /* Applets */
00020 APPLET Applets[NUM_APPLETS] =
00021 {
00022     {
00023         IDI_USRMGR_ICON,
00024         IDS_CPLNAME,
00025         IDS_CPLDESCRIPTION,
00026         UsrmgrApplet
00027     }
00028 };
00029 
00030 
00031 static VOID
00032 InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
00033 {
00034     ZeroMemory(psp, sizeof(PROPSHEETPAGE));
00035     psp->dwSize = sizeof(PROPSHEETPAGE);
00036     psp->dwFlags = PSP_DEFAULT;
00037     psp->hInstance = hApplet;
00038     psp->pszTemplate = MAKEINTRESOURCE(idDlg);
00039     psp->pfnDlgProc = DlgProc;
00040 }
00041 
00042 
00043 /* Display Applet */
00044 static LONG APIENTRY
00045 UsrmgrApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
00046 {
00047     PROPSHEETPAGE psp[3];
00048     PROPSHEETHEADER psh;
00049     TCHAR Caption[1024];
00050 
00051     UNREFERENCED_PARAMETER(lParam);
00052     UNREFERENCED_PARAMETER(wParam);
00053     UNREFERENCED_PARAMETER(uMsg);
00054 
00055     LoadString(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
00056 
00057     ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
00058     psh.dwSize = sizeof(PROPSHEETHEADER);
00059     psh.dwFlags =  PSH_PROPSHEETPAGE;
00060     psh.hwndParent = hwnd;
00061     psh.hInstance = hApplet;
00062     psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_USRMGR_ICON));
00063     psh.pszCaption = Caption;
00064     psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
00065     psh.nStartPage = 0;
00066     psh.ppsp = psp;
00067 
00068     InitPropSheetPage(&psp[0], IDD_USERS, (DLGPROC)UsersPageProc);
00069     InitPropSheetPage(&psp[1], IDD_GROUPS, (DLGPROC)GroupsPageProc);
00070     InitPropSheetPage(&psp[2], IDD_EXTRA, (DLGPROC)ExtraPageProc);
00071 
00072     return (LONG)(PropertySheet(&psh) != -1);
00073 }
00074 
00075 
00076 /* Control Panel Callback */
00077 LONG CALLBACK
00078 CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
00079 {
00080     int i = (int)lParam1;
00081 
00082     switch (uMsg)
00083     {
00084         case CPL_INIT:
00085             return TRUE;
00086 
00087         case CPL_GETCOUNT:
00088             return NUM_APPLETS;
00089 
00090         case CPL_INQUIRE:
00091             {
00092                 CPLINFO *CPlInfo = (CPLINFO*)lParam2;
00093                 CPlInfo->lData = 0;
00094                 CPlInfo->idIcon = Applets[i].idIcon;
00095                 CPlInfo->idName = Applets[i].idName;
00096                 CPlInfo->idInfo = Applets[i].idDescription;
00097             }
00098             break;
00099 
00100         case CPL_DBLCLK:
00101             Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
00102             break;
00103     }
00104 
00105     return FALSE;
00106 }
00107 
00108 
00109 BOOL WINAPI
00110 DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
00111 {
00112     UNREFERENCED_PARAMETER(lpvReserved);
00113 
00114     switch (dwReason)
00115     {
00116         case DLL_PROCESS_ATTACH:
00117             hApplet = hinstDLL;
00118             break;
00119     }
00120 
00121     return TRUE;
00122 }

Generated on Sat May 26 2012 04:19:48 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.