Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: do-while did not work in eclipse c\c++ IDE ? Pin
David Crow26-Nov-12 10:37
David Crow26-Nov-12 10:37 
GeneralRe: do-while did not work in eclipse c\c++ IDE ? Pin
ho_khalaf26-Nov-12 10:45
ho_khalaf26-Nov-12 10:45 
GeneralRe: do-while did not work in eclipse c\c++ IDE ? Pin
ho_khalaf26-Nov-12 12:02
ho_khalaf26-Nov-12 12:02 
GeneralRe: do-while did not work in eclipse c\c++ IDE ? Pin
David Crow26-Nov-12 16:39
David Crow26-Nov-12 16:39 
GeneralRe: do-while did not work in eclipse c\c++ IDE ? Pin
ho_khalaf26-Nov-12 19:26
ho_khalaf26-Nov-12 19:26 
QuestionC++: CreateProcess() launching child applications with UAC dialog for once Pin
Farrukhw25-Nov-12 23:58
Farrukhw25-Nov-12 23:58 
AnswerRe: C++: CreateProcess() launching child applications with UAC dialog for once Pin
chaau26-Nov-12 12:21
chaau26-Nov-12 12:21 
QuestionHow to use NTGraph3D Activex Control in Visual Studio 2010. Pin
DhrumilS23-Nov-12 0:48
DhrumilS23-Nov-12 0:48 
AnswerRe: How to use NTGraph3D Activex Control in Visual Studio 2010. Pin
Richard MacCutchan23-Nov-12 1:43
mveRichard MacCutchan23-Nov-12 1:43 
QuestionHow to get a ip address from system name Pin
D.Manivelan22-Nov-12 22:20
D.Manivelan22-Nov-12 22:20 
AnswerRe: How to get a ip address from system name Pin
msr_codeproject22-Nov-12 23:23
msr_codeproject22-Nov-12 23:23 
AnswerRe: How to get a ip address from system name Pin
Rolf Kristensen23-Nov-12 0:41
Rolf Kristensen23-Nov-12 0:41 
QuestionHeap corruption problem after AfxBeginThread? Pin
bosfan22-Nov-12 21:14
bosfan22-Nov-12 21:14 
AnswerRe: Heap corruption problem after AfxBeginThread? Pin
Sivaraman Dhamodharan22-Nov-12 22:13
Sivaraman Dhamodharan22-Nov-12 22:13 
AnswerRe: Heap corruption problem after AfxBeginThread? Pin
Richard MacCutchan22-Nov-12 23:40
mveRichard MacCutchan22-Nov-12 23:40 
GeneralRe: Heap corruption problem after AfxBeginThread? Pin
bosfan22-Nov-12 23:44
bosfan22-Nov-12 23:44 
AnswerRe: Heap corruption problem after AfxBeginThread? Pin
WebMaster23-Nov-12 4:49
WebMaster23-Nov-12 4:49 
AnswerRe: Heap corruption problem after AfxBeginThread? Pin
Stephen Hewitt25-Nov-12 7:04
Stephen Hewitt25-Nov-12 7:04 
QuestionWhat are the steps required, i will connect to the SQL named instance server using the "CDatabase::OpenEx" by using the DNS Name? Pin
lucky_122122-Nov-12 0:41
lucky_122122-Nov-12 0:41 
AnswerRe: What are the steps required, i will connect to the SQL named instance server using the "CDatabase::OpenEx" by using the DNS Name? Pin
Richard MacCutchan22-Nov-12 3:38
mveRichard MacCutchan22-Nov-12 3:38 
QuestionChanging Dialog Button Color at runTime Pin
002comp20-Nov-12 23:07
002comp20-Nov-12 23:07 
AnswerRe: Changing Dialog Button Color at runTime Pin
manoranjan21-Nov-12 0:05
manoranjan21-Nov-12 0:05 
GeneralRe: Changing Dialog Button Color at runTime Pin
002comp21-Nov-12 0:37
002comp21-Nov-12 0:37 
GeneralRe: Changing Dialog Button Color at runTime Pin
manoranjan21-Nov-12 1:12
manoranjan21-Nov-12 1:12 
GeneralRe: Changing Dialog Button Color at runTime Pin
002comp21-Nov-12 18:56
002comp21-Nov-12 18:56 
I took HBRUSH as Global variable and then how it will be responsible for drawing all buttons and with different color.

C++
Here is WM_DRAWITEM:
case WM_DRAWITEM:
        {
           
			 LPDRAWITEMSTRUCT lpDrawItemStruct = (DRAWITEMSTRUCT*)lParam;
			 switch (lpDrawItemStruct->itemAction)
			{
               	case ODA_DRAWENTIRE:
				case ODA_SELECT:
				{
					
			        int ndxColor = 0 ;
					switch (lpDrawItemStruct->CtlID)
					{
					  case  IDC_btnPantone1 : ndxColor = 0 ; break ; 
					  case  IDC_btnPantone2 : ndxColor = 1 ; break ; 
					  case  IDC_btnPantone3 : ndxColor = 2 ; break ; 
					  case  IDC_btnPantone4 : ndxColor = 3 ; break ; 
					  case  IDC_btnPantone5 : ndxColor = 4 ; break ; 
					  case  IDC_btnPantone6 : ndxColor = 5 ; break ; 
					  case  IDC_btnPantone7 : ndxColor = 6 ; break ; 
					  default : break ;
					}
					switch (lpDrawItemStruct->CtlID)
					{
					  case  IDC_btnPantone1 :  
					  case  IDC_btnPantone2 : 
					  case  IDC_btnPantone3 : 
					  case  IDC_btnPantone4 : 
					  case  IDC_btnPantone5 : 
					  case  IDC_btnPantone6 : 
					  case  IDC_btnPantone7 : 
								DrawButtonColor (ndxColor, lpDrawItemStruct) ; 
								break ;
					  default : break ;
					}
					
				  }
				default:
					return DefWindowProc (hwndDlg, msg, wParam, lParam);
				  break;
                break;
			 } 
			 return TRUE;
        }

                       case WM_CTLCOLORBTN :
			{
			      SetBkColor((HDC)wParam, RGB(0,0,255));
					return (BOOL)g_hBrush;
				
			}

it is not changing .
Or m wrong somewhere ?

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.