Chapter 7 — Programming
CN2B Mobile Computer User’s Manual 137
BOOL IsProcessRunning( TCHAR * pname )
{
HANDLE hProcList;
PROCESSENTRY32 peProcess;
DWORD thDeviceProcessID;
TCHAR lpname[MAX_PATH];
if ( !pname || !*pname ) return FALSE;
_tcscpy( lpname, pname );
_tcslwr( lpname );
hProcList = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
if ( hProcList == INVALID_HANDLE_VALUE ) {
return FALSE;
} // end if
memset( &peProcess, 0, sizeof(peProcess) );
peProcess.dwSize = sizeof(peProcess);
if ( !Process32First( hProcList, &peProcess ) ) {
CloseToolhelp32Snapshot( hProcList );
return FALSE;
} // end if
thDeviceProcessID = 0;
do {
_tcslwr( peProcess.szExeFile );
if ( _tcsstr( peProcess.szExeFile, lpname ) ) {
thDeviceProcessID = peProcess.th32ProcessID;
break;
} // end if
} while ( Process32Next( hProcList, &peProcess ) );
if ( ( GetLastError() == ERROR_NO_MORE_FILES ) && ( thDeviceProcessID == 0 ) )
{
CloseToolhelp32Snapshot( hProcList );
return FALSE;
} // end if
CloseToolhelp32Snapshot( hProcList );
return TRUE;
} // IsProcessRunning
codeINSTALL_INIT Install_Init(
HWND hwndParent,
BOOL fFirstCall,
BOOL fPreviouslyInstalled,
LPCTSTR pszInstallDir )
{
return codeINSTALL_INIT_CONTINUE;
}
codeINSTALL_EXIT Install_Exit (
HWND hwndParent,
LPCTSTR pszInstallDir,
Komentáře k této Příručce