Answer the question
In order to leave comments, you need to log in
What is CreateWindowExA lpszClassName on the console?
Hello everyone, when I ran the code in the form
#include <windows.h>
#include <stdio.h>
int main() {
LPWSTR className = NULL;
GetClassNameW(GetActiveWindow(), className, 255);
wprintf(L"%s", className);
}
Answer the question
In order to leave comments, you need to log in
I have not dealt with WinApi for a long time, but it seems that for console applications another function is needed instead of GetActiveWindow (). At the same time, fix the error with the lack of a buffer under className, as pointed out by 15432
WCHAR className[255];
GetClassNameW(GetConsoleWindow(), className, 255);
wprintf(L"%s", className);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question