Is there a way to tell if the Foreground Window is graphical or Commandline?

Viewed 133

I am currently making a program that will behave differently depending if the Foreground Window is CMD-like or GUI. How would I go about getting this information though?

win32gui.GetWindowType(win32gui.GetForegroundWindow())

or something similar is what I'm looking for.

1 Answers

This was stated in the comments, but figured I'd put it in the answers tab too.

win32gui.GetClassName(win32gui.GetForegroundWindow()) == "ConsoleWindowClass"
Related