Click here to Skip to main content
16,007,472 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralBetter than the Startup folder Pin
Jason Hooper30-Oct-01 14:12
Jason Hooper30-Oct-01 14:12 
GeneralRe: Better than the Startup folder Pin
Christian Graus30-Oct-01 15:03
protectorChristian Graus30-Oct-01 15:03 
GeneralRe: Better than the Startup folder Pin
Michael Martin30-Oct-01 15:42
professionalMichael Martin30-Oct-01 15:42 
GeneralRe: Better than the Startup folder Pin
Nish Nishant30-Oct-01 16:18
sitebuilderNish Nishant30-Oct-01 16:18 
GeneralRe: Better than the Startup folder Pin
Jason Hooper30-Oct-01 23:32
Jason Hooper30-Oct-01 23:32 
GeneralRe: Better than the Startup folder Pin
solex30-Oct-01 23:37
solex30-Oct-01 23:37 
GeneralRe: Better than the Startup folder Pin
Rick Crone31-Oct-01 9:21
Rick Crone31-Oct-01 9:21 
GeneralStrange owner-draw CButton problem... Pin
Simon Walton30-Oct-01 13:39
Simon Walton30-Oct-01 13:39 
Not so much of a problem, since i've fixed it now with a workaround. But i am interested as to exactly why it happened.

I created a custom button, derived from cbutton (obviously). I overrode the drawitem function and a few others to do some mouseover effects. The button was drawn to look exactly the same as a standard windows 9x button. I wanted to create a highlight when the user clicked on the button. So, before drawing the rectangle for the border of the button, i created and selected a lighter grey brush for the highlight;
if(lpDrawItemStruct->itemState & ODS_SELECTED)
{
Create and select much lighter gray brush
Draw rectangle
Delete the brush
}

The problem is, when i release the mouse button, the lighter gray brush is still drawn, even though the button isn't selected. It stays there until the cursor moves out of the button's rectangle. Therefore, when drawitem is called, it can't be going through the above if since itemState is not going to contain ODS_SELECTED. I also checked this using TRACE. Anyone know why? It's probably blindingly obvious, but it's getting late and my head hurts. Dead | X|

My workaround was to invalidate the button during OnLButtonUp().

Simon
GeneralResizing Icon In CRichEditView Pin
Vinnie Drysdale30-Oct-01 12:18
Vinnie Drysdale30-Oct-01 12:18 
GeneralDebug symbols for WinXP Pin
Sam C30-Oct-01 11:00
Sam C30-Oct-01 11:00 
QuestionHow to get browser version? Pin
30-Oct-01 9:34
suss30-Oct-01 9:34 
AnswerRe: How to get browser version? Pin
Michael Dunn30-Oct-01 11:34
sitebuilderMichael Dunn30-Oct-01 11:34 
GeneralOpenGL Animation Pin
30-Oct-01 8:51
suss30-Oct-01 8:51 
GeneralRe: OpenGL Animation Pin
Todd Smith30-Oct-01 8:57
Todd Smith30-Oct-01 8:57 
GeneralRe: OpenGL Animation Pin
30-Oct-01 9:12
suss30-Oct-01 9:12 
GeneralRe: OpenGL Animation Pin
30-Oct-01 10:11
suss30-Oct-01 10:11 
Generaloverload operator... a begginner info Pin
Remi Morin30-Oct-01 8:31
Remi Morin30-Oct-01 8:31 
GeneralRe: overload operator... a begginner info Pin
Tomasz Sowinski30-Oct-01 10:08
Tomasz Sowinski30-Oct-01 10:08 
GeneralRe: overload operator... a begginner info Pin
Remi Morin30-Oct-01 10:26
Remi Morin30-Oct-01 10:26 
GeneralRe: overload operator... a begginner info Pin
Tomasz Sowinski30-Oct-01 10:39
Tomasz Sowinski30-Oct-01 10:39 
GeneralRe: overload operator... a begginner info Pin
Michael Dunn30-Oct-01 17:21
sitebuilderMichael Dunn30-Oct-01 17:21 
GeneralTaskbar and Systray Pin
30-Oct-01 7:49
suss30-Oct-01 7:49 
GeneralRe: Taskbar and Systray Pin
Michael P Butler30-Oct-01 8:47
Michael P Butler30-Oct-01 8:47 
GeneralRe: Taskbar and Systray Pin
Ravi Bhavnani30-Oct-01 8:51
professionalRavi Bhavnani30-Oct-01 8:51 
GeneralXML File Properties and ATL Pin
30-Oct-01 7:40
suss30-Oct-01 7: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.