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.
Ancient Dragon
Retired & Loving It
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,342
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().
Ancient Dragon
Retired & Loving It
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,342
>>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.
Ancient Dragon
Retired & Loving It
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,342