How to close dialog box if it doesnt hav OK and CANCEL Button in windows programming.the dialog box is shown with DoModal which inturn calls onInitDialog().But how to close it ?does EndDialog hepls and how ?where to call EndDialog?
risa
0
Light Poster
Recommended Answers
Jump to Postyou could set a timer and close the dialog box in the OnTimer() event handler. There may be a couple other options: (1) send a WM_CLOSE message from another window or (2) click the X button in the upper-right corner, assuming you have not removed that too.
Jump to PostIn that case have the thread that is closing call PostThreadMessage() to send a private message to the DialogBox thread, then in the dialog's PreTranslateMesssage() event handler check for that message and call EndDialog().
Jump to Post>>i want to close this dialog box after a particular thread ends
That sounds like there is more than one thread in your dialog application program.Do NOT call AfxEndThread() because you didn't call AfxBeginThread(). If you want the dialog box to exit immediately after processing OnInitDialog() then just …
All 9 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
risa
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
risa
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
risa
0
Light Poster
wamuti
0
Newbie Poster
vidz
0
Newbie Poster
Anitaj
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.