16,472
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <windows.h>
#define cht_code "0404" //BIG5编码
int main(int, char**)
{
char* lpCmdline = ::GetCommandLine();
if ((lpCmdline == NULL) || (strcmp(lpCmdline, cht_code) != 0))
{
::SetEnvironmentVariable("__COMPAT_LAYER", "#APPLICATIONLOCALE");
::SetEnvironmentVariable("AppLocaleID", cht_code);
char strPath[MAX_PATH] = {0}, strDir[MAX_PATH] = {0};
::GetModuleFileName(NULL, strPath, sizeof(strPath));
strcpy(strDir, strPath);
char* pFind = ::strrchr(strDir, '\\');
if (pFind) *pFind = '\0';
STARTUPINFO si = {0};
si.cb = sizeof(si);
PROCESS_INFORMATION pi = {0};
::CreateProcess(strPath, cht_code, NULL, NULL, FALSE, 0, NULL, strDir, &si, &pi);
::CloseHandle(pi.hProcess);
}
else
MessageBox(NULL, "羉砰", "Empty", MB_OK);
return 0;
}
setlocale(LC_ALL, "cht");
_setmbcp(_MB_CP_LOCALE);
MessageBox(NULL, "羉砰", "Empty", MB_OK);