Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygencmicpl.cpp
Go to the documentation of this file.
00001 /* 00002 Copyright (c) 2006-2007 dogbert <dogber1@gmail.com> 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without 00006 modification, are permitted provided that the following conditions 00007 are met: 00008 1. Redistributions of source code must retain the above copyright 00009 notice, this list of conditions and the following disclaimer. 00010 2. Redistributions in binary form must reproduce the above copyright 00011 notice, this list of conditions and the following disclaimer in the 00012 documentation and/or other materials provided with the distribution. 00013 3. The name of the author may not be used to endorse or promote products 00014 derived from this software without specific prior written permission. 00015 00016 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 00017 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00018 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00019 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 00020 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00021 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00022 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00023 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00024 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00025 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 */ 00027 00028 #include <windows.h> 00029 #include <shellapi.h> 00030 #include <tchar.h> 00031 #include <cpl.h> 00032 #include "resource.h" 00033 00034 BOOL APIENTRY DllMain (HANDLE hModule, ULONG gna, LPVOID lpReserved) 00035 { 00036 return TRUE; 00037 } 00038 00039 BOOL execControlPanel() 00040 { 00041 TCHAR szSysDir[1024]; 00042 if (!GetSystemDirectory(szSysDir, sizeof(szSysDir) / sizeof(TCHAR))) { 00043 return FALSE; 00044 } 00045 _tcscat(szSysDir, _T("\\cmicontrol.exe")); //unsafe 00046 ShellExecute(NULL, _T("open"), szSysDir, NULL, NULL, SW_SHOWNORMAL); 00047 return TRUE; 00048 } 00049 00050 LONG APIENTRY CPlApplet (HWND hWnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2) 00051 { 00052 switch (uMsg) 00053 { 00054 case CPL_INIT: 00055 return TRUE; 00056 00057 case CPL_GETCOUNT: 00058 return 1; 00059 00060 case CPL_INQUIRE: 00061 { 00062 LPCPLINFO pCplInfo = (LPCPLINFO)lParam2; 00063 00064 if (!pCplInfo) { 00065 return TRUE; 00066 } 00067 00068 if ((UINT)lParam1 == 0) { 00069 pCplInfo->idIcon = IDI_CPLICON; 00070 pCplInfo->idName = IDS_CPLNAME; 00071 pCplInfo->idInfo = IDS_CPLINFO; 00072 } 00073 break; 00074 } 00075 00076 case CPL_NEWINQUIRE: 00077 break; 00078 00079 case CPL_DBLCLK: 00080 case CPL_STARTWPARMS: 00081 if ((UINT)lParam1 == 0) { 00082 if (!execControlPanel()) { 00083 return TRUE; 00084 } 00085 } 00086 break; 00087 case CPL_EXIT: 00088 break; 00089 00090 default: 00091 break; 00092 } 00093 00094 return 0; 00095 } 00096 Generated on Sun May 27 2012 04:28:38 for ReactOS by
1.7.6.1
|