|
-
Feb 3rd, 2003, 01:12 PM
#1
GetObjectAPI
VB Code:
Dim dBitmap As Long, dBMP As BITMAP, HDC As Long, ret As Long
HDC = GetForegroundWindow
dBitmap = GetCurrentObject(HDC, OBJ_BITMAP)
If dBitmap <> 0 Then
ret = GetObjectAPI(dBitmap, Len(dBMP), dBMP)
Debug.Print ret, dBMP.bmHeight, dBMP.bmWidth
' .... the rest of the ode...
The GetObjectAPI ALWAYS returns 0, and dBMP variables are 0 also, how come ?
-
Feb 3rd, 2003, 08:39 PM
#2
Frenzied Member
You get a hwnd from GetForegroundWindow...
Code:
Dim dBitmap As Long, dBMP As BITMAP, HDC As Long, ret As Long
HDC = GetForegroundWindow
HDC=GetDC(HDC)
dBitmap = GetCurrentObject(HDC, OBJ_BITMAP)
If dBitmap <> 0 Then
ret = GetObjectAPI(dBitmap, Len(dBMP), dBMP)
Debug.Print ret, dBMP.bmHeight, dBMP.bmWidth
-
Feb 3rd, 2003, 10:25 PM
#3
I just forgot to copy that line, when I copyed and pasted the code in this thread.
So, my question is the same: how come it's always 0 ?
-
Feb 3rd, 2003, 10:28 PM
#4
Actually, in this thread wich I posted in the general forum is more detailed
http://vbforums.com/showthread.php?s=&threadid=228589
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|