mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
added an initial mmsys.cpl. not added to the build system because w32api lacks a devguid.h
svn path=/trunk/; revision=19508
This commit is contained in:
parent
67d7a1aea3
commit
d5879d411b
9 changed files with 284 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
<property name="BASEADDRESS_REGTESTS" value="0x07000000" />
|
||||
<property name="BASEADDRESS_NOTIFYHOOK" value="0x08000000" />
|
||||
<property name="BASEADDRESS_DEVENUM" value="0x35680000" />
|
||||
<property name="BASEADDRESS_MMSYS" value="0x588A0000" />
|
||||
<property name="BASEADDRESS_UXTHEME" value="0x5AD70000" />
|
||||
<property name="BASEADDRESS_VDMDBG" value="0x5B0D0000" />
|
||||
<property name="BASEADDRESS_OBJSEL" value="0x5B400000" />
|
||||
|
|
14
reactos/lib/cpl/mmsys/En.rc
Normal file
14
reactos/lib/cpl/mmsys/En.rc
Normal file
|
@ -0,0 +1,14 @@
|
|||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
IDD_HARDWARE DIALOGEX 0, 0, 246, 228
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "Hardware"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_CPLNAME "Sound and Audio Devices"
|
||||
IDS_CPLDESCRIPTION "Changes the sound scheme for your computer, or configure the settings for your speakers and recording devices."
|
||||
END
|
187
reactos/lib/cpl/mmsys/mmsys.c
Normal file
187
reactos/lib/cpl/mmsys/mmsys.c
Normal file
|
@ -0,0 +1,187 @@
|
|||
/*
|
||||
* ReactOS
|
||||
* Copyright (C) 2005 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: main.c 12852 2005-01-06 13:58:04Z mf $
|
||||
*
|
||||
* PROJECT: ReactOS Multimedia Control Panel
|
||||
* FILE: lib/cpl/mmsys/mmsys.c
|
||||
* PURPOSE: ReactOS Multimedia Control Panel
|
||||
* PROGRAMMER: Thoams Weidenmueller <w3seek@reactos.com>
|
||||
* UPDATE HISTORY:
|
||||
* 2005/11/23 Created
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <initguid.h>
|
||||
#include <cfgmgr32.h>
|
||||
#include <setupapi.h>
|
||||
#include <devguid.h>
|
||||
#include <cpl.h>
|
||||
|
||||
#include "mmsys.h"
|
||||
#include "resource.h"
|
||||
|
||||
HWND WINAPI
|
||||
DeviceCreateHardwarePageEx(HWND hWndParent,
|
||||
LPGUID lpGuids,
|
||||
UINT uNumberOfGuids,
|
||||
UINT Unknown);
|
||||
|
||||
#define NUM_APPLETS (1)
|
||||
|
||||
|
||||
HINSTANCE hApplet = 0;
|
||||
|
||||
/* Applets */
|
||||
const APPLET Applets[NUM_APPLETS] =
|
||||
{
|
||||
{IDI_CPLICON, IDS_CPLNAME, IDS_CPLDESCRIPTION, MmSysApplet},
|
||||
};
|
||||
|
||||
/* Hardware property page dialog callback */
|
||||
static INT_PTR CALLBACK
|
||||
HardwareDlgProc(HWND hwndDlg,
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
GUID Guids[] = {
|
||||
GUID_DEVCLASS_CDROM,
|
||||
GUID_DEVCLASS_MEDIA,
|
||||
};
|
||||
|
||||
/* create the hardware page */
|
||||
DeviceCreateHardwarePageEx(hwndDlg,
|
||||
Guids,
|
||||
sizeof(Guids) / sizeof(Guids[0]),
|
||||
1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LONG APIENTRY
|
||||
MmSysApplet(HWND hwnd,
|
||||
UINT uMsg,
|
||||
LONG wParam,
|
||||
LONG lParam)
|
||||
{
|
||||
PROPSHEETPAGE psp[1];
|
||||
PROPSHEETHEADER psh = {0};
|
||||
TCHAR Caption[256];
|
||||
|
||||
LoadString(hApplet,
|
||||
IDS_CPLNAME,
|
||||
Caption,
|
||||
sizeof(Caption) / sizeof(TCHAR));
|
||||
|
||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
|
||||
psh.hwndParent = NULL;
|
||||
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_HARDWARE,
|
||||
HardwareDlgProc);
|
||||
|
||||
return (LONG)(PropertySheet(&psh) != -1);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
/* Control Panel Callback */
|
||||
LONG CALLBACK
|
||||
CPlApplet(HWND hwndCpl,
|
||||
UINT uMsg,
|
||||
LPARAM lParam1,
|
||||
LPARAM lParam2)
|
||||
{
|
||||
switch(uMsg)
|
||||
{
|
||||
case CPL_INIT:
|
||||
return TRUE;
|
||||
|
||||
case CPL_GETCOUNT:
|
||||
return NUM_APPLETS;
|
||||
|
||||
case CPL_INQUIRE:
|
||||
{
|
||||
CPLINFO *CPlInfo = (CPLINFO*)lParam2;
|
||||
UINT uAppIndex = (UINT)lParam1;
|
||||
|
||||
CPlInfo->lData = 0;
|
||||
CPlInfo->idIcon = Applets[uAppIndex].idIcon;
|
||||
CPlInfo->idName = Applets[uAppIndex].idName;
|
||||
CPlInfo->idInfo = Applets[uAppIndex].idDescription;
|
||||
break;
|
||||
}
|
||||
|
||||
case CPL_DBLCLK:
|
||||
{
|
||||
UINT uAppIndex = (UINT)lParam1;
|
||||
Applets[uAppIndex].AppletProc(hwndCpl,
|
||||
uMsg,
|
||||
lParam1,
|
||||
lParam2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
BOOL STDCALL
|
||||
DllMain(HINSTANCE hinstDLL,
|
||||
DWORD dwReason,
|
||||
LPVOID lpReserved)
|
||||
{
|
||||
switch(dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
hApplet = hinstDLL;
|
||||
DisableThreadLibraryCalls(hinstDLL);
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
6
reactos/lib/cpl/mmsys/mmsys.def
Normal file
6
reactos/lib/cpl/mmsys/mmsys.def
Normal file
|
@ -0,0 +1,6 @@
|
|||
LIBRARY mmsys.cpl
|
||||
|
||||
EXPORTS
|
||||
CPlApplet@16
|
||||
|
||||
; EOF
|
32
reactos/lib/cpl/mmsys/mmsys.h
Normal file
32
reactos/lib/cpl/mmsys/mmsys.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
#ifndef __CPL_MMSYS_H
|
||||
#define __CPL_MMSYS_H
|
||||
|
||||
//typedef LONG (CALLBACK *APPLET_PROC)(VOID);
|
||||
|
||||
typedef struct _APPLET
|
||||
{
|
||||
UINT idIcon;
|
||||
UINT idName;
|
||||
UINT idDescription;
|
||||
APPLET_PROC AppletProc;
|
||||
} APPLET, *PAPPLET;
|
||||
|
||||
extern HINSTANCE hApplet;
|
||||
|
||||
|
||||
/* main.c */
|
||||
|
||||
VOID
|
||||
InitPropSheetPage(PROPSHEETPAGE *psp,
|
||||
WORD idDlg,
|
||||
DLGPROC DlgProc);
|
||||
|
||||
LONG APIENTRY
|
||||
MmSysApplet(HWND hwnd,
|
||||
UINT uMsg,
|
||||
LONG wParam,
|
||||
LONG lParam);
|
||||
|
||||
#endif /* __CPL_MMSYS_H */
|
||||
|
||||
/* EOF */
|
13
reactos/lib/cpl/mmsys/mmsys.rc
Normal file
13
reactos/lib/cpl/mmsys/mmsys.rc
Normal file
|
@ -0,0 +1,13 @@
|
|||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
|
||||
#define REACTOS_VERSION_DLL
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Multimedia Control Panel\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "mmsys\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "mmsys.cpl\0"
|
||||
#include <reactos/version.rc>
|
||||
|
||||
|
||||
IDI_CPLICON ICON "resources/mmsys.ico"
|
||||
|
||||
#include "En.rc"
|
16
reactos/lib/cpl/mmsys/mmsys.xml
Normal file
16
reactos/lib/cpl/mmsys/mmsys.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<module name="mmsys" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_MMSYS}" installbase="system32" installname="mmsys.cpl">
|
||||
<importlibrary definition="mmsys.def" />
|
||||
<include base="mmsys">.</include>
|
||||
<define name="UNICODE" />
|
||||
<define name="_UNICODE" />
|
||||
<define name="__REACTOS__" />
|
||||
<define name="__USE_W32API" />
|
||||
<define name="_WIN32_IE">0x600</define>
|
||||
<define name="_WIN32_WINNT">0x501</define>
|
||||
<library>kernel32</library>
|
||||
<library>user32</library>
|
||||
<library>comctl32</library>
|
||||
<library>devmgr</library>
|
||||
<file>mmsys.c</file>
|
||||
<file>mmsys.rc</file>
|
||||
</module>
|
15
reactos/lib/cpl/mmsys/resource.h
Normal file
15
reactos/lib/cpl/mmsys/resource.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
#ifndef __CPL_RESOURCE_H
|
||||
#define __CPL_RESOURCE_H
|
||||
|
||||
|
||||
#define IDI_CPLICON 1
|
||||
|
||||
#define IDD_HARDWARE 100
|
||||
|
||||
#define IDS_CPLNAME 1000
|
||||
#define IDS_CPLDESCRIPTION 1001
|
||||
|
||||
|
||||
#endif /* __CPL_RESOURCE_H */
|
||||
|
||||
/* EOF */
|
BIN
reactos/lib/cpl/mmsys/resources/mmsys.ico
Normal file
BIN
reactos/lib/cpl/mmsys/resources/mmsys.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in a new issue