get active window

Windows specific forum
BabyBacon
New User
New User
Posts: 8
Joined: Wed Feb 01, 2006 11:47 pm
Location: Sweden

get active window

Post by BabyBacon »

Hi!

Im pretty new to the whole world of api. I want to make a program that capture the screen of the active window, but it not always active, so I figured, why not push F12 when Im over the window I want to capture so I know which one is active.

Now to my problem, it wont work, all I get from the getactivewindow_() command is 0!

Code: Select all

hWnd = GetActiveWindow_() ;if I use debug hwnd it say 0
...
GetWindowRect_(hWnd,@re.RECT) ;geting the size of the window
CreateImage(...)
;later I use a funktion to capture the screen, with the cordinats from  getwindowrect_().
How come this aint working, am I missing something importen? :cry:

// BabyBacon
User avatar
Deeem2031
Enthusiast
Enthusiast
Posts: 216
Joined: Sat Sep 20, 2003 3:57 pm
Location: Germany
Contact:

Post by Deeem2031 »

Try GetForegroundWindow_().
irc://irc.freenode.org/#purebasic
Post Reply