blitzplus1.44 hDC for dll??

BlitzPlus Forums/BlitzPlus Programming/blitzplus1.44 hDC for dll??

TomG(Posted 2007) [#1]
hello I has blitzplus 1.44

and needs the equipment context "hDC" from the active window, how I get?



i need for a "dll" that paints on the screen


sorry for my bad english ;-)


b32(Posted 2007) [#2]
I'm not sure, but I believe that if you have the hwnd, (using SystemProperty$("apphwnd") or api_GetActiveWindow), you can use api_GetDC to retreive the HDC. You might need to get the user32.decls.


TomG(Posted 2007) [#3]
hi,


thanks for the answer but...

when i enter the blitzcode

test%=SystemProperty$ ("apphwnd")
DebugLog test%

is test% = 0

that does not run ;-(


you say
"api_GetActiveWindow), you can use api_GetDC"

have you or other here one example code for this ?


Tom

p.s.
sorry for my bad english ;-)


TomG(Posted 2007) [#4]
the solution ;-)

---- namexyz.decls ---
.lib "user32.dll"
GetDC%(hwnd%):"GetDC"
ReleaseDC%(hwnd%, hdc%):"ReleaseDC"
----------------------------

in blitz+
window1=CREATEWINDOW("Win1",150,150,600,600,0,9)
hDC% = GetDC(QueryObject(window1,1))

DebugLog hDC%

Tom


Andy_A(Posted 2007) [#5]
TomG

Have you considered posting your code in the "Code Archives". It makes the solution available to everyone who want to perform a floodfill in Blitz+ using the API call.


TomG(Posted 2007) [#6]
;-)

ok