Click here to Skip to main content
15,909,546 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to get flat button in CPropertySheet(C++V6)? Pin
Ryan Binns7-Feb-06 12:13
Ryan Binns7-Feb-06 12:13 
GeneralRe: How to get flat button in CPropertySheet(C++V6)? Pin
Pierre Couderc7-Feb-06 20:28
Pierre Couderc7-Feb-06 20:28 
QuestionHow to pass array as a parameter??? Pin
Ming Luo6-Feb-06 21:25
Ming Luo6-Feb-06 21:25 
AnswerRe: How to pass array as a parameter??? Pin
toxcct6-Feb-06 21:36
toxcct6-Feb-06 21:36 
AnswerRe: How to pass array as a parameter??? Pin
Russell'6-Feb-06 21:51
Russell'6-Feb-06 21:51 
GeneralRe: How to pass array as a parameter??? Pin
Ming Luo6-Feb-06 23:16
Ming Luo6-Feb-06 23:16 
GeneralRe: How to pass array as a parameter??? Pin
Russell'6-Feb-06 23:27
Russell'6-Feb-06 23:27 
AnswerRe: How to pass array as a parameter??? Pin
David Crow7-Feb-06 3:00
David Crow7-Feb-06 3:00 
QuestionUsage Count of a dll Pin
SanjaySMK6-Feb-06 20:20
SanjaySMK6-Feb-06 20:20 
AnswerRe: Usage Count of a dll Pin
Bob Stanneveld6-Feb-06 21:09
Bob Stanneveld6-Feb-06 21:09 
AnswerRe: Usage Count of a dll Pin
Stephen Hewitt6-Feb-06 23:32
Stephen Hewitt6-Feb-06 23:32 
QuestionDDX_Text(..) not getting generated by MFC?? Pin
aparnakishore6-Feb-06 19:42
aparnakishore6-Feb-06 19:42 
AnswerRe: DDX_Text(..) not getting generated by MFC?? Pin
-Dy7-Feb-06 4:02
-Dy7-Feb-06 4:02 
GeneralRe: DDX_Text(..) not getting generated by MFC?? Pin
aparnakishore7-Feb-06 18:35
aparnakishore7-Feb-06 18:35 
AnswerRe: DDX_Text(..) not getting generated by MFC?? Pin
Blake Miller7-Feb-06 6:20
Blake Miller7-Feb-06 6:20 
GeneralRe: DDX_Text(..) not getting generated by MFC?? Pin
aparnakishore7-Feb-06 18:38
aparnakishore7-Feb-06 18:38 
AnswerRe: DDX_Text(..) not getting generated by MFC?? Pin
aparnakishore7-Feb-06 19:07
aparnakishore7-Feb-06 19:07 
Questionchild windows (destroying controls in main window) Pin
nedimbakic6-Feb-06 19:33
nedimbakic6-Feb-06 19:33 
AnswerRe: child windows (destroying controls in main window) Pin
nedimbakic6-Feb-06 19:36
nedimbakic6-Feb-06 19:36 
AnswerRe: child windows (destroying controls in main window) Pin
Owner drawn6-Feb-06 19:42
Owner drawn6-Feb-06 19:42 
GeneralRe: child windows (destroying controls in main window) Pin
nedimbakic7-Feb-06 1:53
nedimbakic7-Feb-06 1:53 
GeneralRe: child windows (destroying controls in main window) Pin
Owner drawn7-Feb-06 16:44
Owner drawn7-Feb-06 16:44 
GeneralRe: child windows (destroying controls in main window) Pin
nedimbakic7-Feb-06 17:13
nedimbakic7-Feb-06 17:13 
Owner drawn wrote:
If you want to destroy the button you have to get the handle of the button and then pass this handle to DestroyWindow to get it destroyed.


Yes, and that is what I do. My button's handle is hBtn1 which I use with DestroyWindow function as DestroyWindow(hBtn1), but nothing happens. Once created, button just sits in its place and I cannot destroy it untill I destroy the main window where it sits.

If I am not making this clear, maybe some code will explain. So here is how I create that button:
case WM_LBUTTONDOWN:
{
hBtn1 = CreateWindow("BUTTON","Picture 1", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,50,320,70,20,hWindow,(HMENU) 2, hInstGlobal, NULL);

......}

case WM_RBUTTONDOWN:
{
DestroyWindow(hBtn1);
......... }

And that is what I want. On left mouse click I want to create this button in the main window, and on right mouse click I want to get rid of it for good, don't need it any more!

Any ideas why this would not work? Why can't I just call DestroyWindow(hBtn1) and destroy this button?

Thanks! By the way, thanks for working on it Owner Drawn!


-- modified at 23:13 Tuesday 7th February, 2006
GeneralRe: child windows (destroying controls in main window) Pin
Owner drawn7-Feb-06 17:16
Owner drawn7-Feb-06 17:16 
GeneralRe: child windows (destroying controls in main window) Pin
nedimbakic8-Feb-06 1:39
nedimbakic8-Feb-06 1:39 

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.