|
I feel embarassed
This is indeed the right solution.
Ignore my post please [which is the most round about way to do this ]
Nish
Bow wow wow,
Yippee yo yippee yay,
My miniputt high,
Is now 30 yay.
|
|
|
|
|
Use EnumWindows to enumerate all top level windows.
For each HWND do a GetWindowThreadProcessId to get the thread ID. Now compare with the dwThreadId you got from your PROCESS_INFORMATION struct that you passed to CreateProcess. If they match post a WM_CLOSE to that window
Nish
Bow wow wow,
Yippee yo yippee yay,
My miniputt high,
Is now 30 yay.
|
|
|
|
|
I try to destroy a modal dialog box on exiting a MFC application.
To do this, i use DestroyWindow on the dialog window's handle; as a result it allways generates a runtime error.
If you know how to handle it, please let me know.
rechi
|
|
|
|
|
I reckon the problem is it's trying to destroy it after you've already done so. If it's a modal dialog, it must be the main one, right ? The framework deals with this for you.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
No, it's not the main one; on debugging the problem seems to be a WM_KICKIDLE SendMessage for the - indeed - destroyed window's handle.
Unfortunately, i can't let the framework to do the job for me; i really have to destroy it "by hand".
rechi
|
|
|
|
|
For modal dialogs I think you must call EndDialog and not DestroyWindow
Nish
Bow wow wow,
Yippee yo yippee yay,
My miniputt high,
Is now 30 yay.
|
|
|
|
|
That's the answer (also for the modeless dialogs)!
Thanks.
rechi
|
|
|
|
|
bogdan_rechi wrote:
That's the answer (also for the modeless dialogs)!
Thanks.
For modeless dialogs don't call EndDialog. You must call DestroyWindow for modeless dialogs and EndDialog for modal dialogs
Nish
Bow wow wow,
Yippee yo yippee yay,
My miniputt high,
Is now 30 yay.
|
|
|
|
|
Is this true for HWNDs only? Because i call CDialog.EndDialog for modeless dialogs and it looks ok.
rechi
|
|
|
|
|
bogdan_rechi wrote:
Because i call CDialog.EndDialog for modeless dialogs and it looks ok.
EndDialog makes the dialog box invisible but does not actually destroy it. This won't have too many problems always. But sometimes, it will result in leaks. If you know what I mean
Nish
Bow wow wow,
Yippee yo yippee yay,
My miniputt high,
Is now 30 yay.
|
|
|
|
|
Ok. Now the problem is solved 100%.
Thanks.
rechi
|
|
|
|
|
When you create a Modal Dialog, windows creates its own message pump to handle the messages for your modal dialog. That means that the messages do not go through your message pump. MFC emmulates the modal message pump, but the effect is the same.
It is important that you call EndDialog for the modal dialog only, because it shuts down the modal message pump, and allows the execution to drop back into your normal application.
You need to call DestroyWindow on a modeless dialog because all that this window is, is a regular window created as a dialog class.
|
|
|
|
|
hello everybody!
huang chun shen
|
|
|
|
|
Are you trying to be funny?
If yes: Then "Rant and Rave (Unmoderated)" section is the right place to write stuff like this...
If no: What's your problem dude?
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Chill out a little Rickard!
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Yeah, I perhaps overeacted...
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Well, this makes a change from people asking questions in the lounge.
The lounge is the place to introduce yourself, but as you've done it here - hello
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
The lounge is the place to introduce yourself
well, you've just asked a programming question in the lounge regarding XSL,
so you don't do what you're saying...
|
|
|
|
|
You're right, I was just too lazy to go to the XML/XSL forum to ask ( hint: there isn't one )
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
you're not too lazy when you reply to someone posting PROGRAMMING question in the lounge which is STRONGLY prohibit
STOP using it or STOP reply
|
|
|
|
|
What the hell is your problem ? Take your medication, sit down and shut up.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
this is the confirm you're simply a fatty jerk
|
|
|
|
|
I certainly appreciate the intelligence and wit that was required to point this out to me. It's also nice to see you have the courage to attach your name to your inbred, half witted opinions.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
if I attach my name what are you gonna do ?
ps: my name is attached, poor thing
|
|
|
|
|
I worked out that you had a valid email address attached to your anonymous posts, I just don't understand in that case why you don't set up an account ?
It's not a case of what I will do, it's a case of why do you use this site but not set up an account ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|