| | |
Plz Help:In windows programming how to close dialog box?
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
you 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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
In 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().
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
Join Date: Jul 2007
Posts: 31
Reputation:
Solved Threads: 1
ur solution is not helping me frnd......i hav called a thread in onInitDialog of a dialog box(onInitDialog is called from DoModal()) .in the tread i hav done some processing and after it gets completed i need to end this thread(can i use AfxEndThread?) and should b able to catch the ending of thread after DoModal(by checking for GetExitCode()?) and close the dialog box(using EndDialog).Can do this ???
>>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 simply call EndDialog() at the end of that function.
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 simply call EndDialog() at the end of that function.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
Join Date: Jul 2007
Posts: 31
Reputation:
Solved Threads: 1
[no there is only one thread (sorry if my statement indicated so)
i hav called thread by using AfxBeginthread in onInitdialog of Dialog box and wants to close this dialog Box only after the thread ends(do i hav to use AfxEndThread inside the thread(at the end) after the thread completes its processing)
i hav called thread by using AfxBeginthread in onInitdialog of Dialog box and wants to close this dialog Box only after the thread ends(do i hav to use AfxEndThread inside the thread(at the end) after the thread completes its processing)
![]() |
Similar Threads
- How to close dialog box (Windows NT / 2000 / XP)
- Windows GUI - problem with dialog box (C++)
Other Threads in the C++ Forum
- Previous Thread: Problem in Inheritance
- Next Thread: My sales terminal program
| Thread Tools | Search this Thread |
api array arrays based binary bitmap c++ c/c++ calculator char char* class classes code coding compile console conversion convert count data database delete deploy developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






