I need to know how many arguments to pass in user32 and kernel32 functions for example :
windll.kernel32.GetConsoleTitle()
I get Error :
:ValueError: Procedure probably called with not enough arguments (4 bytes missing)
I need to know how many arguments to pass in user32 and kernel32 functions for example :
windll.kernel32.GetConsoleTitle()
I get Error :
:ValueError: Procedure probably called with not enough arguments (4 bytes missing)
You should read the API decscription. Here's the link for GetConsoleTitle: https://learn.microsoft.com/en-us/windows/console/getconsoletitle
DWORD WINAPI GetConsoleTitle(
_Out_ LPTSTR lpConsoleTitle,
_In_ DWORD nSize
);
Update: Here's a short demo of getting console window title:
import ctypes
MAX_BUFFER = 260
title_text_buffer = (ctypes.c_char * MAX_BUFFER)()
res = ctypes.windll.kernel32.GetConsoleTitleA(title_text_buffer, MAX_BUFFER)
title_text = title_text_buffer.value
print title_text