Click here to Skip to main content
15,920,632 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to correctly see order of controls in design time, in a CDialog ? Pin
vgrigor8-Jan-04 4:31
vgrigor8-Jan-04 4:31 
AnswerRe: How to correctly see order of controls in design time, in a CDialog ? Pin
John R. Shaw8-Jan-04 4:46
John R. Shaw8-Jan-04 4:46 
GeneralRe: How to correctly see order of controls in design time, in a CDialog ? Pin
vgrigor8-Jan-04 4:49
vgrigor8-Jan-04 4:49 
GeneralRe: How to correctly see order of controls in design time, in a CDialog ? Pin
John R. Shaw8-Jan-04 5:24
John R. Shaw8-Jan-04 5:24 
GeneralRe: How to correctly see order of controls in design time, in a CDialog ? Pin
vgrigor8-Jan-04 5:32
vgrigor8-Jan-04 5:32 
GeneralRe: How to correctly see order of controls in design time, in a CDialog ? Pin
John R. Shaw8-Jan-04 6:21
John R. Shaw8-Jan-04 6:21 
GeneralRe: How to correctly see order of controls in design time, in a CDialog ? Pin
vgrigor9-Jan-04 5:16
vgrigor9-Jan-04 5:16 
GeneralProblem with slider-control and NM_CUSTOMDRAW Pin
Member 7988338-Jan-04 4:25
Member 7988338-Jan-04 4:25 
Hi folks!

I want to have an ownerdrawn trackbar (Slider) control. Therefore I check for a WM_NOTIFY event with NM_CUSTOMDRAW in the code member of the NMHDR-structure. Let me give a short code example



code:



case WM_NOTIFY:
lpNotify = (LPNMHDR)lParam;
switch(lpNotify->idFrom)
{
case IDC_SLIDER1:
switch(lpNotify->code)
{
case NM_CUSTOMDRAW:
lpDraw = (LPNMCUSTOMDRAW)lParam;
switch(lpDraw->dwDrawStage)
{
case CDDS_PREPAINT:
return CDRF_NOTIFYITEMDRAW;
case CDDS_ITEMPREPAINT:
switch(lpDraw->dwItemSpec)
{
case TBCD_CHANNEL:
FillRect(lpDraw->hdc,&lpDraw->rc,(HBRUSH)GetStockObject(BLACK_BRUSH));
return CDRF_SKIPDEFAULT;

case TBCD_THUMB:
FillRect(lpDraw->hdc,&lpDraw->rc,(HBRUSH)GetStockObject(WHITE_BRUSH));
return CDRF_SKIPDEFAULT;
}
break;
}
break;
}
break;
}
break;



Well, this works fine up to the CDDS_PREPAINT part, where I request an interaction into the control's drawing procedure.
But I never reach the most important part of CDDS_ITEMREPAINT where I acutally paint the control. I've read tons of documentations of this function and all describe it this way.

Does anyone know why it doesn't work for my example?

thanks in advance

Starik

P.S. Environment: VC++ 6.0 SP5
CommCtl. Version: 5.81.4704.1100
GeneralRe: Problem with slider-control and NM_CUSTOMDRAW Pin
KaЯl8-Jan-04 4:47
KaЯl8-Jan-04 4:47 
GeneralRe: Problem with slider-control and NM_CUSTOMDRAW Pin
Member 7988338-Jan-04 6:53
Member 7988338-Jan-04 6:53 
GeneralMouse Highlighting Pin
Anthony98878-Jan-04 3:44
Anthony98878-Jan-04 3:44 
GeneralRe: Mouse Highlighting Pin
Maximilien8-Jan-04 4:05
Maximilien8-Jan-04 4:05 
GeneralHelp for Toggling toolbar buttons Pin
Ruchit Sharma8-Jan-04 1:29
Ruchit Sharma8-Jan-04 1:29 
GeneralHelp for Toggling toolbar buttons Pin
Ruchit Sharma8-Jan-04 1:29
Ruchit Sharma8-Jan-04 1:29 
GeneralRe: Help for Toggling toolbar buttons Pin
Monty28-Jan-04 1:40
Monty28-Jan-04 1:40 
GeneralMDI Problem! Pin
skylonely8-Jan-04 1:25
skylonely8-Jan-04 1:25 
GeneralDeclaring a global variable of a template type Pin
tguzella8-Jan-04 1:21
tguzella8-Jan-04 1:21 
GeneralRe: Declaring a global variable of a template type Pin
Johnny ²8-Jan-04 5:23
Johnny ²8-Jan-04 5:23 
GeneralRe: Declaring a global variable of a template type Pin
tguzella11-Jan-04 13:21
tguzella11-Jan-04 13:21 
GeneralCreate transparent objects Pin
swarnamanoo8-Jan-04 1:00
swarnamanoo8-Jan-04 1:00 
GeneralRe: Create transparent objects Pin
Selvam R8-Jan-04 1:57
professionalSelvam R8-Jan-04 1:57 
GeneralRe: Create transparent objects Pin
Anonymous8-Jan-04 6:17
Anonymous8-Jan-04 6:17 
GeneralSaving ColeServerDoc Pin
kevcs28-Jan-04 0:58
kevcs28-Jan-04 0:58 
GeneralRe: Saving ColeServerDoc Pin
Selvam R8-Jan-04 1:53
professionalSelvam R8-Jan-04 1:53 
GeneralDirectSound - Window Handle problem Pin
elza8-Jan-04 0:31
elza8-Jan-04 0:31 

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.