home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softwarová Záchrana 3
/
Softwarova-zachrana-3.bin
/
pserv.cpl
/
pserv-2.4.exe
/
source
/
pserv.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2005-01-05
|
1KB
|
44 lines
#include "precomp.h"
#include "resource.h"
#include "stdio.h"
#include "stdlib.h"
#include "stdarg.h"
extern "C" LONG APIENTRY CPlApplet( HWND hwndCPl, UINT uMsg, LONG lParam1, LONG lParam2 )
{
if( uMsg == CPL_DBLCLK )
{
CHAR szDefaultPath[512] = "C:\\Program Files\\p-nand-q.com\\pserv.cpl";
HKEY hkKey;
if( RegOpenKeyEx( HKEY_CURRENT_USER, "Software\\p-nand-q.com\\pserv.cpl", 0, KEY_READ, &hkKey ) == NO_ERROR )
{
DWORD dwSize = sizeof(szDefaultPath) / sizeof(CHAR), dwType;
RegQueryValueEx( hkKey, "Install_Dir", 0, &dwType, (LPBYTE)szDefaultPath, &dwSize );
RegCloseKey(hkKey);
}
CHAR szDefaultFile[512];
sprintf( szDefaultFile, "%s\\pserv2.exe", szDefaultPath );
ShellExecute(hwndCPl, "open", szDefaultFile, "", szDefaultPath, SW_SHOW );
}
else if( uMsg == CPL_INQUIRE )
{
LPCPLINFO lpInfo = (LPCPLINFO) lParam2;
lpInfo->idIcon = IDI_ICON1;
lpInfo->idName = IDS_NAME;
lpInfo->idInfo = IDS_INFO;
lpInfo->lData = 0;
}
else if( uMsg == CPL_INIT )
{
return 1;
}
else if( uMsg == CPL_GETCOUNT )
{
return 1;
}
return 0;
}