ReactOS 0.4.15-dev-8408-g466a198
cmicpl.cpp File Reference
#include <windows.h>
#include <shellapi.h>
#include <tchar.h>
#include <cpl.h>
#include "resource.h"
Include dependency graph for cmicpl.cpp:

Go to the source code of this file.

Macros

#define WIN32_LEAN_AND_MEAN
 

Functions

BOOL APIENTRY DllMain (HANDLE hModule, ULONG gna, LPVOID lpReserved)
 
BOOL execControlPanel ()
 
LONG APIENTRY CPlApplet (HWND hWnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
 

Macro Definition Documentation

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

Definition at line 28 of file cmicpl.cpp.

Function Documentation

◆ CPlApplet()

LONG APIENTRY CPlApplet ( HWND  hWnd,
UINT  uMsg,
LPARAM  lParam1,
LPARAM  lParam2 
)

Definition at line 51 of file cmicpl.cpp.

52{
53 switch (uMsg)
54 {
55 case CPL_INIT:
56 return TRUE;
57
58 case CPL_GETCOUNT:
59 return 1;
60
61 case CPL_INQUIRE:
62 {
63 LPCPLINFO pCplInfo = (LPCPLINFO)lParam2;
64
65 if (!pCplInfo) {
66 return TRUE;
67 }
68
69 if ((UINT)lParam1 == 0) {
70 pCplInfo->idIcon = IDI_CPLICON;
71 pCplInfo->idName = IDS_CPLNAME;
72 pCplInfo->idInfo = IDS_CPLINFO;
73 }
74 break;
75 }
76
77 case CPL_NEWINQUIRE:
78 break;
79
80 case CPL_DBLCLK:
81 case CPL_STARTWPARMS:
82 if ((UINT)lParam1 == 0) {
83 if (!execControlPanel()) {
84 return TRUE;
85 }
86 }
87 break;
88 case CPL_EXIT:
89 break;
90
91 default:
92 break;
93 }
94
95 return 0;
96}
BOOL execControlPanel()
Definition: cmicpl.cpp:40
#define CPL_INQUIRE
Definition: cpl.h:14
#define CPL_DBLCLK
Definition: cpl.h:16
#define CPL_STARTWPARMS
Definition: cpl.h:54
#define CPL_INIT
Definition: cpl.h:12
#define CPL_EXIT
Definition: cpl.h:18
#define CPL_GETCOUNT
Definition: cpl.h:13
struct tagCPLINFO * LPCPLINFO
#define CPL_NEWINQUIRE
Definition: cpl.h:19
#define TRUE
Definition: types.h:120
#define IDS_CPLNAME
Definition: resource.h:8
#define IDI_CPLICON
Definition: resource.h:4
#define IDS_CPLINFO
Definition: resource.h:30
unsigned int UINT
Definition: ndis.h:50
Definition: cpl.h:24
int idName
Definition: cpl.h:26
int idInfo
Definition: cpl.h:27
int idIcon
Definition: cpl.h:25

◆ DllMain()

BOOL APIENTRY DllMain ( HANDLE  hModule,
ULONG  gna,
LPVOID  lpReserved 
)

Definition at line 35 of file cmicpl.cpp.

36{
37 return TRUE;
38}

◆ execControlPanel()

BOOL execControlPanel ( )

Definition at line 40 of file cmicpl.cpp.

41{
42 TCHAR szSysDir[1024];
43 if (!GetSystemDirectory(szSysDir, sizeof(szSysDir) / sizeof(TCHAR))) {
44 return FALSE;
45 }
46 _tcscat(szSysDir, _T("\\cmicontrol.exe")); //unsafe
47 ShellExecute(NULL, _T("open"), szSysDir, NULL, NULL, SW_SHOWNORMAL);
48 return TRUE;
49}
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define _tcscat
Definition: tchar.h:622
#define ShellExecute
Definition: shellapi.h:693
#define _T(x)
Definition: vfdio.h:22
#define GetSystemDirectory
Definition: winbase.h:3842
#define SW_SHOWNORMAL
Definition: winuser.h:770
char TCHAR
Definition: xmlstorage.h:189

Referenced by CPlApplet().