Page 1 of 1

get active window

Posted: Sat Apr 08, 2006 3:45 pm
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

Posted: Sat Apr 08, 2006 8:43 pm
by Deeem2031
Try GetForegroundWindow_().