Click here to Skip to main content
15,918,742 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: list of all users on Win OS Pin
Carlos Antollini27-Feb-02 3:31
Carlos Antollini27-Feb-02 3:31 
GeneralRe: list of all users on Win OS Pin
Carlos Antollini27-Feb-02 3:31
Carlos Antollini27-Feb-02 3:31 
GeneralNeed all the create users on that machine Pin
sanskypotov27-Feb-02 20:03
sanskypotov27-Feb-02 20:03 
GeneralRe: Need all the create users on that machine Pin
Carlos Antollini28-Feb-02 3:07
Carlos Antollini28-Feb-02 3:07 
QuestionA ready-made framework for Add-ins? Pin
Omer S.27-Feb-02 1:34
Omer S.27-Feb-02 1:34 
AnswerRe: A ready-made framework for Add-ins? Pin
Roger Allen27-Feb-02 4:26
Roger Allen27-Feb-02 4:26 
Generalproblem with XP Visual Styles API Pin
Konstantin S. Diguine27-Feb-02 0:27
Konstantin S. Diguine27-Feb-02 0:27 
GeneralRe: problem with XP Visual Styles API Pin
Paul A. Howes27-Feb-02 3:11
Paul A. Howes27-Feb-02 3:11 
I have to assume that the function "GetToolbarHTheme" is something that you wrote, because that is not a part of the Visual Theme API. I am on a Windows 2000 computer at the moment, so I have no way if the following code will work, but the way I would approach the problem is something like this:
//  Start the paint operation
PAINTSTRUCT ps;
BeginPaint( hWnd, &ps );
//  Retrieve a handle to the current theme
HTHEME hTheme = OpenThemeData( hWnd, L"TOOLBAR" );
//  This allows for alpha-blended, layered windows.
DrawThemeParentBackground( hWnd, ps.hdc, ps.rcPaint );
//  Draw the normal background for the window.
DrawThemeBackground( hTheme, ps.hdc, TP_BUTTON, TS_NORMAL, &ps.rcPaint, 0 );
/*  create your image list here.  */
//  Draw the button
DrawThemeIcon( hTheme, rc.hdc, TP_BUTTON, TS_NORMAL, &ps.rcPaint, himl, i );
/*  destroy the image list here.  */
//  End the painting operation.
EndPaint( hWnd, &ps );

I would also recommend creating the image list once, instead of creating it and destroying it every time you draw a button. That will allow you to preload the images, create different lists for different button states, etc. Also, you should use the defined constants (TP_BUTTON, etc.) instead of hard-coding the numbers into your function calls.

If at all possible, use the new Windows XP true-color icons. These icons have 32-bits per pixel, with 8-bits per channel, including the alpha channel. You can specify any pixel to be transparent this way. Image lists do support this in XP, so there's no reason not to use them.

--
Paul

"I drank... WHAT?"
GeneralRe: problem with XP Visual Styles API Pin
Konstantin S. Diguine27-Feb-02 3:32
Konstantin S. Diguine27-Feb-02 3:32 
GeneralRe: problem with XP Visual Styles API Pin
Paul A. Howes27-Feb-02 15:21
Paul A. Howes27-Feb-02 15:21 
GeneralFocus - problem Pin
Wizard_0127-Feb-02 0:06
Wizard_0127-Feb-02 0:06 
GeneralRe: Focus - problem Pin
Tim Smith27-Feb-02 2:19
Tim Smith27-Feb-02 2:19 
GeneralMainFrame Pin
26-Feb-02 23:17
suss26-Feb-02 23:17 
GeneralRe: MainFrame Pin
Michael P Butler26-Feb-02 23:30
Michael P Butler26-Feb-02 23:30 
GeneralRe: MainFrame Pin
Mazdak26-Feb-02 23:30
Mazdak26-Feb-02 23:30 
GeneralMFC Smart Pointers not dual interfaces... Pin
Braulio Dez26-Feb-02 23:14
Braulio Dez26-Feb-02 23:14 
GeneralRe: MFC Smart Pointers not dual interfaces... Pin
peterchen27-Feb-02 5:59
peterchen27-Feb-02 5:59 
GeneralRe: MFC Smart Pointers not dual interfaces... Pin
Braulio Dez3-Mar-02 21:33
Braulio Dez3-Mar-02 21:33 
GeneralRe: MFC Smart Pointers not dual interfaces... Pin
peterchen4-Mar-02 0:52
peterchen4-Mar-02 0:52 
GeneralRe: MFC Smart Pointers not dual interfaces... Pin
Braulio Dez4-Mar-02 2:54
Braulio Dez4-Mar-02 2:54 
GeneralRe: MFC Smart Pointers not dual interfaces... Pin
peterchen4-Mar-02 6:35
peterchen4-Mar-02 6:35 
GeneralRe: MFC Smart Pointers not dual interfaces... Pin
Braulio Dez4-Mar-02 21:11
Braulio Dez4-Mar-02 21:11 
GeneralRe: MFC Smart Pointers not dual interfaces... Pin
peterchen4-Mar-02 23:39
peterchen4-Mar-02 23:39 
GeneralRe: MFC Smart Pointers not dual interfaces... Pin
Braulio Dez5-Mar-02 0:00
Braulio Dez5-Mar-02 0:00 
QuestionIs this possible? Pin
moliate26-Feb-02 22:40
moliate26-Feb-02 22:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.