General FreeBASIC programming questions.
5 posts • Page 1 of 1
Is there a way to check if the program is the active window? And also too for graphics mode?
Something like this?
Code: Select all
Dim As HANDLE processhandle, hwnd
Dim As ULong PID
Dim As ZString*MAX_PATH filename
hwnd = GetActiveWindow()
If hwnd Then
processHandle = OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, FALSE, PID)
GetModuleFileNameEx(processHandle, NULL, filename, MAX_PATH)
If filename = Command(0) Then
Print "no active window"
On Windows, check the difference between GetActiveWindow, GetForegroundWindow and GetFocus.
Who is online
Users browsing this forum: No registered users and 13 guests