21 int size = WideCharToMultiByte(CP_UTF8, 0, str, wcslen(str),
nullptr, 0,
nullptr,
nullptr);
23 WideCharToMultiByte(CP_UTF8, 0, str, wcslen(str), str8, size,
nullptr,
nullptr);
35int APIENTRY
_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine,
41 TCHAR exename[1024], *
next;
42 int exenameLen = GetModuleFileName(
nullptr, exename, std::size(exename));
46 TCHAR* arg = _tcstok_s(lpCmdLine, _T(
" "), &
next);
47 while (arg !=
nullptr) {
49 arg = _tcstok_s(
nullptr, _T(
" "), &
next);
52 for (
int i = 0; i < argc; ++i) {
static char * tchar_to_utf8(const TCHAR *str)
static int main_common(HINSTANCE hInstance, int show, int argc, char **argv)
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)