How can translate const char to const wchar_t? I have already climbed a lot of sites, have not found an answer ...
#include "windows.h" #include "tlhelp32.h" #define dllx extern "C" __declspec(dllexport) //--------------------------------------------------------------------------- // find is process processName running? bool _IsProcessRun( const char * processName ) { HANDLE hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); PROCESSENTRY32 pe; pe.dwSize = sizeof( PROCESSENTRY32 ); Process32First( hSnapshot, &pe ); while( true ) { if( wcscpy( pe.szExeFile, processName ) == 0 ) return true; if( !Process32Next( hSnapshot, &pe ) ) return false; } } // return value to gml dllx double IsProcessRun( char *process ) { return (int) _IsProcessRun( process ); }
wcscmpinstead ofwcscpyin this function? - Maxim Timakov