|
-
Mar 26th, 2000, 06:38 AM
#1
Thread Starter
Junior Member
Can it be done?
Is it possible (using only the class name and window text) to change the bitmap/picture in another program by using it's the API and the window's DC??
[Edited by OB1 on 03-26-2000 at 06:39 PM]
-
Mar 26th, 2000, 11:01 PM
#2
Frenzied Member
Yes, But not just yes, a little sprinkling of no too.
Yes and No, The API can't get at the bitmap in the form's background, it's something vb Does all by itself without telling windows,(it might be possible to find the process handle, set up a pipe etc but that's pretty much impossible even if it's possible.)
What you can do is Get the window handle and subclass the window, trap it's paint event and put your own bitmap there, This'd still be pretty hard but not quite as impossible as other methods.
In conclusion VB is a language of impossible contradiction.
hope this helps
-
Apr 14th, 2000, 05:48 AM
#3
Thread Starter
Junior Member
Thanks
Thanks. I think I got it.
-
Apr 14th, 2000, 06:38 AM
#4
Hyperactive Member
that's weird - VB ignores Windows normal painting methods?
so how does it do it behind the scenes?
cos in C++ its like:
GetWindowDC(hWnd)
BeginPaint(wnddc);
//draw..
EndPaint(wnddc);
or something
buzzwords are the language of fools
-
Apr 14th, 2000, 06:46 AM
#5
Frenzied Member
I don't think VB ignores them, It just overwrites them, If you set autoredraw to true and check the value of
Code:
CBool( (Object.hDC) = (GetWindowDC(Object.hWnd) )
It will return a false when you'd think It would always be true, If AutoRedraw is true then the hDC property is a handle to a Memory DC containing a persistant bitmap for the window, when VB recieves a WM_PAINT (ie just before it fires the paint event) it blits the persistant bitmap onto the window in question.
I hope this answers your question (It's quite a useful thing to know anyway)
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
|