Click here to Skip to main content
15,894,540 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Hiding a CPropertyPage at runtime Pin
laiju3-Jun-05 11:22
laiju3-Jun-05 11:22 
GeneralRe: Hiding a CPropertyPage at runtime Pin
David Crow3-Jun-05 16:37
David Crow3-Jun-05 16:37 
GeneralRe: Hiding a CPropertyPage at runtime Pin
PJ Arends4-Jun-05 9:49
professionalPJ Arends4-Jun-05 9:49 
GeneralRe: Hiding a CPropertyPage at runtime Pin
laiju4-Jun-05 9:55
laiju4-Jun-05 9:55 
GeneralCWnd refresh Pin
jamesrgoodwin1-Jun-05 0:41
jamesrgoodwin1-Jun-05 0:41 
GeneralRe: CWnd refresh Pin
ThatsAlok1-Jun-05 0:53
ThatsAlok1-Jun-05 0:53 
GeneralRe: CWnd refresh Pin
jamesrgoodwin1-Jun-05 1:04
jamesrgoodwin1-Jun-05 1:04 
Generalpush button Pin
ask_you31-May-05 23:48
ask_you31-May-05 23:48 
i have created a push button using Create Window. Now
1. how do i write text on the button?
2. how do i handle the button WM_COMMAND?

the code snippet is:

WNDCLASS wc;
memset(&wc, 0, sizeof(WNDCLASS));
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = (WNDPROC) WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = GetModuleHandle(NULL);
wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); wc.lpszClassName = "WndClassName";

if(!RegisterClass(&wc))
{
MessageBox(NULL,"Failed To Register The Window class.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return (NULL);
}


HWND hWindow = CreateWindowEx(NULL, "WndClassName","DialogClassSample",WS_OVERLAPPEDWINDOW | WS_VISIBLE,0, 0, 320, 200, NULL, NULL, GetModuleHandle(NULL), NULL);

HWND ButtonWindow = CreateWindow("BUTTON",NULL, BS_TEXT|BS_PUSHBUTTON|WS_VISIBLE|WS_CHILD,50,50,30,20,hWindow,NULL,NULL,NULL);

MSG msg;
BOOL bDone = FALSE;
while(!bDone)
{
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
if (msg.message==WM_QUIT)
{
bDone = TRUE;
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}

GeneralRe: push button Pin
Nilesh K.31-May-05 23:56
Nilesh K.31-May-05 23:56 
GeneralRe: push button Pin
ask_you1-Jun-05 0:12
ask_you1-Jun-05 0:12 
GeneralRe: push button Pin
Nilesh K.1-Jun-05 0:20
Nilesh K.1-Jun-05 0:20 
GeneralRe: push button Pin
ask_you1-Jun-05 0:35
ask_you1-Jun-05 0:35 
GeneralRe: push button Pin
Nilesh K.1-Jun-05 16:20
Nilesh K.1-Jun-05 16:20 
QuestionHow CreateFile can fail??? Pin
Dimitris Vikeloudas31-May-05 23:16
Dimitris Vikeloudas31-May-05 23:16 
AnswerRe: How CreateFile can fail??? Pin
Cedric Moonen31-May-05 23:36
Cedric Moonen31-May-05 23:36 
GeneralRe: How CreateFile can fail??? Pin
Nilesh K.31-May-05 23:51
Nilesh K.31-May-05 23:51 
GeneralThanks but not what I am actually looking for... Pin
Dimitris Vikeloudas1-Jun-05 0:36
Dimitris Vikeloudas1-Jun-05 0:36 
GeneralRe: Thanks but not what I am actually looking for... Pin
geo_m1-Jun-05 1:36
geo_m1-Jun-05 1:36 
AnswerRe: How CreateFile can fail??? Pin
Ravi Bhavnani1-Jun-05 11:43
professionalRavi Bhavnani1-Jun-05 11:43 
AnswerRe: How CreateFile can fail??? Pin
Ravi Bhavnani1-Jun-05 11:45
professionalRavi Bhavnani1-Jun-05 11:45 
Questionntohl() in eVC pocketpc application? Pin
zuschauer198031-May-05 23:13
zuschauer198031-May-05 23:13 
GeneralPrinting Pin
sirtimid31-May-05 23:01
sirtimid31-May-05 23:01 
GeneralRe: Printing Pin
PJ Arends31-May-05 23:10
professionalPJ Arends31-May-05 23:10 
GeneralRe: Printing Pin
Nilesh K.1-Jun-05 0:01
Nilesh K.1-Jun-05 0:01 
GeneralProblem receiving UDP packets Pin
ilgale31-May-05 22:48
ilgale31-May-05 22:48 

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.