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

input.c
Go to the documentation of this file.
00001 /*
00002  *
00003  * PROJECT:         input.dll
00004  * FILE:            dll/win32/input/input.c
00005  * PURPOSE:         input.dll
00006  * PROGRAMMER:      Dmitry Chapyshev (lentind@yandex.ru)
00007  *                  Colin Finck
00008  * UPDATE HISTORY:
00009  *      06-09-2007  Created
00010  */
00011 
00012 #include "input.h"
00013 
00014 #define NUM_APPLETS (1)
00015 
00016 LONG CALLBACK SystemApplet(VOID);
00017 HINSTANCE hApplet = 0;
00018 HANDLE hProcessHeap;
00019 HWND hCPLWindow;
00020 
00021 /* Applets */
00022 APPLET Applets[NUM_APPLETS] =
00023 {
00024     {IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApplet}
00025 };
00026 
00027 
00028 VOID
00029 InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
00030 {
00031     ZeroMemory(psp, sizeof(PROPSHEETPAGE));
00032     psp->dwSize = sizeof(PROPSHEETPAGE);
00033     psp->dwFlags = PSP_DEFAULT;
00034     psp->hInstance = hApplet;
00035     psp->pszTemplate = MAKEINTRESOURCE(idDlg);
00036     psp->pfnDlgProc = DlgProc;
00037 }
00038 
00039 
00040 /* First Applet */
00041 
00042 LONG CALLBACK
00043 SystemApplet(VOID)
00044 {
00045     PROPSHEETPAGE psp[1];
00046     PROPSHEETHEADER psh;
00047     TCHAR Caption[1024];
00048 
00049     LoadString(hApplet, IDS_CPLSYSTEMNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
00050 
00051     ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
00052     psh.dwSize = sizeof(PROPSHEETHEADER);
00053     psh.dwFlags =  PSH_PROPSHEETPAGE;
00054     psh.hwndParent = hCPLWindow;
00055     psh.hInstance = hApplet;
00056     psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM));
00057     psh.pszCaption = Caption;
00058     psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
00059     psh.nStartPage = 0;
00060     psh.ppsp = psp;
00061     psh.pfnCallback = NULL;
00062 
00063     InitPropSheetPage(&psp[0], IDD_PROPPAGESETTINGS, (DLGPROC) SettingPageProc);
00064 
00065     return (LONG)(PropertySheet(&psh) != -1);
00066 }
00067 
00068 
00069 /* Control Panel Callback */
00070 LONG CALLBACK
00071 CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
00072 {
00073     CPLINFO *CPlInfo;
00074     DWORD i;
00075 
00076     i = (DWORD)lParam1;
00077     switch (uMsg)
00078     {
00079         case CPL_INIT:
00080             return TRUE;
00081 
00082         case CPL_GETCOUNT:
00083             return NUM_APPLETS;
00084 
00085         case CPL_INQUIRE:
00086             CPlInfo = (CPLINFO*)lParam2;
00087             CPlInfo->lData = 0;
00088             CPlInfo->idIcon = Applets[i].idIcon;
00089             CPlInfo->idName = Applets[i].idName;
00090             CPlInfo->idInfo = Applets[i].idDescription;
00091             break;
00092 
00093         case CPL_DBLCLK:
00094             hCPLWindow = hwndCPl;
00095             Applets[i].AppletProc();
00096             break;
00097     }
00098 
00099     return FALSE;
00100 }
00101 
00102 
00103 BOOL WINAPI
00104 DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
00105 {
00106     UNREFERENCED_PARAMETER(lpvReserved);
00107 
00108     switch (dwReason)
00109     {
00110         case DLL_PROCESS_ATTACH:
00111         case DLL_THREAD_ATTACH:
00112             hApplet = hinstDLL;
00113             hProcessHeap = GetProcessHeap();
00114             break;
00115     }
00116 
00117     return TRUE;
00118 }
00119 
00120 /* EOF */

Generated on Sun May 27 2012 04:16:35 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.