mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
delete cplsample, we have no reason to have a cpl applet shell in our tree
svn path=/trunk/; revision=26335
This commit is contained in:
@@ -1,224 +0,0 @@
|
||||
/*
|
||||
* ReactOS
|
||||
* Copyright (C) 2004 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.
|
||||
*/
|
||||
/* $Id$
|
||||
*
|
||||
* PROJECT: ReactOS Sample Control Panel
|
||||
* FILE: lib/cpl/cplsample/cplsample.c
|
||||
* PURPOSE: ReactOS Sample Control Panel
|
||||
* PROGRAMMER: Thomas Weidenmueller ([email protected])
|
||||
* UPDATE HISTORY:
|
||||
* 05-01-2004 Created
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <cpl.h>
|
||||
|
||||
#include "resource.h"
|
||||
#include "cplsample.h"
|
||||
|
||||
#define NUM_APPLETS (1)
|
||||
|
||||
LONG APIENTRY Applet1(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam);
|
||||
HINSTANCE hApplet = 0;
|
||||
|
||||
/* Applets */
|
||||
APPLET Applets[NUM_APPLETS] =
|
||||
{
|
||||
{IDC_CPLICON_1, IDS_CPLNAME_1, IDS_CPLDESCRIPTION_1, Applet1}
|
||||
};
|
||||
|
||||
static void
|
||||
InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
|
||||
{
|
||||
ZeroMemory(psp, sizeof(PROPSHEETPAGE));
|
||||
psp->dwSize = sizeof(PROPSHEETPAGE);
|
||||
psp->dwFlags = PSP_DEFAULT;
|
||||
psp->hInstance = hApplet;
|
||||
psp->pszTemplate = MAKEINTRESOURCE(idDlg);
|
||||
psp->pfnDlgProc = DlgProc;
|
||||
}
|
||||
|
||||
/* Property page dialog callback */
|
||||
INT_PTR CALLBACK
|
||||
Page1Proc(
|
||||
HWND hwndDlg,
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam
|
||||
)
|
||||
{
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Property page dialog callback */
|
||||
INT_PTR CALLBACK
|
||||
Page2Proc(
|
||||
HWND hwndDlg,
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam
|
||||
)
|
||||
{
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Property page dialog callback */
|
||||
INT_PTR CALLBACK
|
||||
Page3Proc(
|
||||
HWND hwndDlg,
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam
|
||||
)
|
||||
{
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Property Sheet Callback */
|
||||
int CALLBACK
|
||||
PropSheetProc(
|
||||
HWND hwndDlg,
|
||||
UINT uMsg,
|
||||
LPARAM lParam
|
||||
)
|
||||
{
|
||||
switch(uMsg)
|
||||
{
|
||||
case PSCB_BUTTONPRESSED:
|
||||
switch(lParam)
|
||||
{
|
||||
case PSBTN_OK: /* OK */
|
||||
break;
|
||||
case PSBTN_CANCEL: /* Cancel */
|
||||
break;
|
||||
case PSBTN_APPLYNOW: /* Apply now */
|
||||
break;
|
||||
case PSBTN_FINISH: /* Close */
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PSCB_INITIALIZED:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* First Applet */
|
||||
|
||||
LONG APIENTRY
|
||||
Applet1(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam)
|
||||
{
|
||||
PROPSHEETPAGE psp[3];
|
||||
PROPSHEETHEADER psh;
|
||||
TCHAR Caption[1024];
|
||||
|
||||
LoadString(hApplet, IDS_CPLNAME_1, Caption, sizeof(Caption) / sizeof(TCHAR));
|
||||
|
||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USECALLBACK | PSH_PROPTITLE;
|
||||
psh.hwndParent = NULL;
|
||||
psh.hInstance = hApplet;
|
||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON_1));
|
||||
psh.pszCaption = Caption;
|
||||
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
||||
psh.nStartPage = 0;
|
||||
psh.ppsp = psp;
|
||||
psh.pfnCallback = PropSheetProc;
|
||||
|
||||
InitPropSheetPage(&psp[0], IDD_PROPPAGE1, Page1Proc);
|
||||
InitPropSheetPage(&psp[1], IDD_PROPPAGE2, Page2Proc);
|
||||
InitPropSheetPage(&psp[2], IDD_PROPPAGE3, Page3Proc);
|
||||
|
||||
return (LONG)(PropertySheet(&psh) != -1);
|
||||
}
|
||||
|
||||
/* Control Panel Callback */
|
||||
LONG CALLBACK
|
||||
CPlApplet(
|
||||
HWND hwndCPl,
|
||||
UINT uMsg,
|
||||
LPARAM lParam1,
|
||||
LPARAM lParam2)
|
||||
{
|
||||
int i = (int)lParam1;
|
||||
|
||||
switch(uMsg)
|
||||
{
|
||||
case CPL_INIT:
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
case CPL_GETCOUNT:
|
||||
{
|
||||
return NUM_APPLETS;
|
||||
}
|
||||
case CPL_INQUIRE:
|
||||
{
|
||||
CPLINFO *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(hwndCPl, uMsg, lParam1, lParam2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
BOOL STDCALL
|
||||
DllMain(
|
||||
HINSTANCE hinstDLL,
|
||||
DWORD dwReason,
|
||||
LPVOID lpvReserved)
|
||||
{
|
||||
switch(dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
hApplet = hinstDLL;
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
LIBRARY cplsample.cpl
|
||||
|
||||
EXPORTS
|
||||
CPlApplet
|
||||
|
||||
; EOF
|
||||
@@ -1,16 +0,0 @@
|
||||
#ifndef __CPL_SAMPLE_H
|
||||
#define __CPL_SAMPLE_H
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int idIcon;
|
||||
int idName;
|
||||
int idDescription;
|
||||
APPLET_PROC AppletProc;
|
||||
} APPLET, *PAPPLET;
|
||||
|
||||
extern HINSTANCE hApplet;
|
||||
|
||||
#endif /* __CPL_SAMPLE_H */
|
||||
|
||||
/* EOF */
|
||||
@@ -1,44 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
|
||||
#define REACTOS_VERSION_DLL
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Sample Control Panel\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "cplsample\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "cplsample.cpl\0"
|
||||
#include <reactos/version.rc>
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
IDC_CPLICON_1 ICON "resources/cpl_icon1.ico"
|
||||
|
||||
IDD_PROPPAGE1 DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "Property Page 1"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "Property Page 1",-1,73,74,90,8
|
||||
END
|
||||
|
||||
IDD_PROPPAGE2 DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "Property Page 2"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "Property Page 2",-1,73,74,90,8
|
||||
END
|
||||
|
||||
IDD_PROPPAGE3 DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "Property Page 3"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "Property Page 3",-1,73,74,90,8
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_CPLNAME_1 "Sample Control Panel"
|
||||
IDS_CPLDESCRIPTION_1 "This is a sample control panel."
|
||||
END
|
||||
@@ -1,25 +0,0 @@
|
||||
#ifndef __CPL_RESOURCE_H
|
||||
#define __CPL_RESOURCE_H
|
||||
|
||||
/* metrics */
|
||||
#define PROPSHEETWIDTH 246
|
||||
#define PROPSHEETHEIGHT 228
|
||||
#define PROPSHEETPADDING 6
|
||||
#define SYSTEM_COLUMN (18 * PROPSHEETPADDING)
|
||||
#define LABELLINE(x) (((PROPSHEETPADDING + 2) * x) + (x + 2))
|
||||
#define ICONSIZE 16
|
||||
|
||||
/* ids */
|
||||
|
||||
#define IDC_CPLICON_1 1
|
||||
|
||||
#define IDD_PROPPAGE1 100
|
||||
#define IDD_PROPPAGE2 101
|
||||
#define IDD_PROPPAGE3 102
|
||||
|
||||
#define IDS_CPLNAME_1 1001
|
||||
#define IDS_CPLDESCRIPTION_1 2001
|
||||
|
||||
#endif /* __CPL_RESOURCE_H */
|
||||
|
||||
/* EOF */
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB |
Reference in New Issue
Block a user