Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

executable program

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
2001
Hi,

I have downloaded a visual basic .exe program from the internet.
The program works perfect after installation. However the
interface color is green. I can see the .dat files and more. Is
it possible to change the color to blue.

//David
 
David -

Probably not. If the author had used the system default colors for his controls, you could change them by changing your Windows system-color settings. But it looks like he explicitly chose those colors, so I think you're stuck with them.

There is a chance of changing the colors by sending each control a windows message (WM_COLOR), but it'll be pretty complex -- you will have to recursively descend through the parent-client relationships of all that applications windows. And if you're running on Windows 2000 that is destined to fail due to the tighter security in that release of Windows.

For all intents and purposes, you're stuck with what he chose.

Chip H.
 
Chip,
Ouch! Changing the colors using the Event Queue would be a pain and I'm used to using the Event Queue. Although in all honesty, I did not realize that you could chage colors by sending a message.
I have to agree with your first comment . . . if the app had the colors hardcoded in, your stuck with them. - Jeff Marler B-)
 
I did some more research into how controls are painted --

It seems that each type of control sends a message to it's parent just before it's drawn. WM_CTLCOLORBTN in the case of a button. The parent supplies a Brush for the control to use in painting itself. I don't know how a button handles the colors for it's various parts (surface, highlited edge, shadowed edge, etc) -- maybe it sends multiple requests???

The bad news is that buttons created with the window style of BS_PUSHBUTTON (which I think most VB buttons have) don't send this message -- they get their color information elsewhere.

So I think David is *really* of out luck on this one.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top