mirror of
https://github.com/reactos/reactos.git
synced 2024-09-20 09:40:52 +00:00
122 lines
3 KiB
C
122 lines
3 KiB
C
|
/*
|
||
|
* ReactOS
|
||
|
* Copyright (C) 2007 ReactOS Team
|
||
|
*
|
||
|
* This program is free software; you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation; either version 2 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program; if not, write to the Free Software
|
||
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||
|
*/
|
||
|
/*
|
||
|
*
|
||
|
* PROJECT: ReactOS Software Control Panel
|
||
|
* FILE: dll/cpl/telephon/telephon.c
|
||
|
* PURPOSE: ReactOS Software Control Panel
|
||
|
* PROGRAMMER: Dmitry Chapyshev (lentind@yandex.ru)
|
||
|
* UPDATE HISTORY:
|
||
|
* 10-19-2007 Created
|
||
|
*/
|
||
|
|
||
|
#include "telephon.h"
|
||
|
|
||
|
#define NUM_APPLETS (1)
|
||
|
|
||
|
LONG CALLBACK SystemApplet(VOID);
|
||
|
HINSTANCE hApplet = 0;
|
||
|
|
||
|
/* Applets */
|
||
|
|
||
|
APPLET Applets[NUM_APPLETS] =
|
||
|
{
|
||
|
{IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApplet}
|
||
|
};
|
||
|
|
||
|
/* First Applet */
|
||
|
LONG CALLBACK
|
||
|
SystemApplet(VOID)
|
||
|
{
|
||
|
PROPSHEETPAGE psp[1];
|
||
|
PROPSHEETHEADER psh;
|
||
|
TCHAR Caption[1024];
|
||
|
|
||
|
LoadString(hApplet, IDS_CPLSYSTEMNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
|
||
|
|
||
|
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||
|
psh.dwFlags = PSH_PROPSHEETPAGE;
|
||
|
psh.hwndParent = NULL;
|
||
|
psh.hInstance = hApplet;
|
||
|
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM));
|
||
|
psh.pszCaption = Caption;
|
||
|
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
||
|
psh.nStartPage = 0;
|
||
|
psh.ppsp = psp;
|
||
|
psh.pfnCallback = NULL;
|
||
|
|
||
|
//InitPropSheetPage(&psp[0], IDD_PROPPAGE, (DLGPROC)PageProc);
|
||
|
|
||
|
return (LONG)(PropertySheet(&psh) != -1);
|
||
|
}
|
||
|
|
||
|
|
||
|
/* Control Panel Callback */
|
||
|
LONG CALLBACK
|
||
|
CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
|
||
|
{
|
||
|
CPLINFO *CPlInfo;
|
||
|
DWORD i;
|
||
|
|
||
|
UNREFERENCED_PARAMETER(hwndCPl);
|
||
|
|
||
|
i = (DWORD)lParam1;
|
||
|
switch (uMsg)
|
||
|
{
|
||
|
case CPL_INIT:
|
||
|
return TRUE;
|
||
|
|
||
|
case CPL_GETCOUNT:
|
||
|
return NUM_APPLETS;
|
||
|
|
||
|
case CPL_INQUIRE:
|
||
|
CPlInfo = (CPLINFO*)lParam2;
|
||
|
CPlInfo->lData = 0;
|
||
|
CPlInfo->idIcon = Applets[i].idIcon;
|
||
|
CPlInfo->idName = Applets[i].idName;
|
||
|
CPlInfo->idInfo = Applets[i].idDescription;
|
||
|
break;
|
||
|
|
||
|
case CPL_DBLCLK:
|
||
|
Applets[i].AppletProc();
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
return FALSE;
|
||
|
}
|
||
|
|
||
|
|
||
|
BOOL WINAPI
|
||
|
DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
|
||
|
{
|
||
|
UNREFERENCED_PARAMETER(lpvReserved);
|
||
|
|
||
|
switch (dwReason)
|
||
|
{
|
||
|
case DLL_PROCESS_ATTACH:
|
||
|
case DLL_THREAD_ATTACH:
|
||
|
CoInitialize(NULL);
|
||
|
hApplet = hinstDLL;
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
return TRUE;
|
||
|
}
|