Skip to main content
gamedev.net
🔒 Locked

VC++ Dialogs Question

Started by agent666 4 replies 850+ views
Original Post
agent666
agent666
Hi, i''m using a dialog to create an interface, but i need to know how to do three things: 1. Set the background color of the dialog and any controls on this dialog to what color i want 2. Set the forecolor of the dialog and any controls on this dialog to what color i want. 3. Set the Dialogs Icon and set the icon that will be displayed on the exe in windows explorer I''v looked over the net and can''t find anything :/
SpreeTree
SpreeTree
Have you looked at www.codeproject.com

Spree
agent666
agent666
Sorry i can''t find any tutorials about setting control background colors, all they have is MFC stuff. I need WINAPI.
kuphryn
kuphryn
Check out the WM_ERASEBKGND message.

Kuphryn
Colin Jeanne
Colin Jeanne
Winprog


Thanks Salsa!Colin Jeanne | Invader''s Realm
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud
Endurion
Endurion
1) Handle WM_ERASEBKGND and fillrect the background in the color you want.

2) A dialog doesn''t have a forecolor. For controls with different colors, look into NM_CUSTOMDRAW, WM_CTLCOLOR or better forget it. In most cases it won''t work fine, usually it''s only feasible with buttons and listboxes/ctrls. Edit''s are a bitch to recolor. If it''s a more complicated control it''s easier to make a complete custom control.

3) WM_SETICON for the dialog/window, for the explorer the icon with the lowest id in the ressource will be chosen.
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.