現在のウィンドウ タイトルをコンソールやファイルに書き込みたいのですが、LPWSTR
tochar *
またはconst char *
. 私のコードは次のとおりです。
LPWSTR title = new WCHAR();
HWND handle = GetForegroundWindow();
GetWindowText(handle, title, GetWindowTextLength( handle )+1);
/*Problem is here */
char * CSTitle ???<??? title
std::cout << CSTitle;
FILE *file;
file=fopen("file.txt","a+");
fputs(CSTitle,file);
fclose(file);