-
Apr 13th, 2006, 01:10 PM
#1
Thread Starter
Hyperactive Member
VB6 - Backcolor of a window?
Hey there,
Does anyone know if there is a function that will allow me to set and get the background colour of a window outside my application, like explorer etc
Thanks
KAZAR
The Law Of Programming:
As the Number of Lines of code increases, the number of bugs generated by fixing a bug increases exponentially.
__________________________________
www.startingqbasic.co.uk
-
Apr 14th, 2006, 01:31 PM
#2
Frenzied Member
Re: VB6 - Backcolor of a window?
you might wanna try GetBkColor()
-
Apr 15th, 2006, 11:44 AM
#3
Thread Starter
Hyperactive Member
Re: VB6 - Backcolor of a window?
Yeah i tried that, but when i used GetBkColor(GetDC(FindWindow(vbNullString,InputBox("Enter Window Title"))), whatever the background colour was, the number that came out would always remain the same.
Any idea why?
KAZAR
The Law Of Programming:
As the Number of Lines of code increases, the number of bugs generated by fixing a bug increases exponentially.
__________________________________
www.startingqbasic.co.uk
-
Apr 15th, 2006, 04:09 PM
#4
Re: VB6 - Backcolor of a window?
Try it with GetWindowDC instead of GetDC... not sure if it will work, but it would make more sense to get the DC of the actual window and not the client area of the window...
GetWindowDC is actually in the same set of "Painting and Drawing Functions" on MSDN as GetBkColor, when GetDC is not...
http://msdn.microsoft.com/library/de...tdraw_4fua.asp
Last edited by gigemboy; Apr 15th, 2006 at 04:12 PM.
-
Apr 16th, 2006, 04:17 AM
#5
Thread Starter
Hyperactive Member
Re: VB6 - Backcolor of a window?
Thanks for that!
KAZAR
The Law Of Programming:
As the Number of Lines of code increases, the number of bugs generated by fixing a bug increases exponentially.
__________________________________
www.startingqbasic.co.uk
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
|