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

C / C++ / MFC

 
GeneralRe: How to close other processes? Pin
Moochie515-Oct-04 8:14
Moochie515-Oct-04 8:14 
GeneralRe: How to close other processes? Pin
Andrzej Markowski15-Oct-04 9:32
Andrzej Markowski15-Oct-04 9:32 
GeneralRe: How to close other processes? Pin
Moochie515-Oct-04 10:53
Moochie515-Oct-04 10:53 
GeneralRe: How to close other processes? Pin
Moochie516-Oct-04 9:46
Moochie516-Oct-04 9:46 
GeneralRe: How to close other processes? Pin
Moochie516-Oct-04 10:01
Moochie516-Oct-04 10:01 
GeneralRe: How to close other processes? Pin
Andrzej Markowski17-Oct-04 11:54
Andrzej Markowski17-Oct-04 11:54 
AnswerRe: How to close other processes? Pin
Andrzej Markowski21-Oct-04 8:38
Andrzej Markowski21-Oct-04 8:38 
AnswerRe: How to close other processes? Pin
Andrzej Markowski23-Oct-04 19:16
Andrzej Markowski23-Oct-04 19:16 
Posting WM_CLOSE message to the main thread using PostThreadMessage doesn't close your application also. You have to post WM_CLOSE message to all windows on the main thread, as vikrams said. Here's the code how to do this :
// define callback function like below
BOOL CALLBACK EnumThreadWndProc(HWND hwnd, LPARAM lParam)
{
	::PostMessage(hwnd,WM_CLOSE,0,0);
	return TRUE;
}
// call EnumThreadWindows instead of PostThreadMessage
EnumThreadWindows(rp[option-1].dwThreadId,EnumThreadWndProc,0);
Regards,
Andrzej Markowski

My Latest ArticlesCCustomBitmapButton: An owner-draw button and a frame for the caption bar, in one class.
CCustomTabCtrl: A clone of the Excel tab sheet control.

QuestionProblem trying to create an alpha surface? Pin
Dani10000114-Oct-04 12:12
Dani10000114-Oct-04 12:12 
Generaldouble-clicking application causes error Pin
dotbomb14-Oct-04 12:02
dotbomb14-Oct-04 12:02 
GeneralRe: double-clicking application causes error Pin
Joaquín M López Muñoz14-Oct-04 12:15
Joaquín M López Muñoz14-Oct-04 12:15 
GeneralRe: double-clicking application causes error Pin
dotbomb14-Oct-04 12:23
dotbomb14-Oct-04 12:23 
GeneralRe: double-clicking application causes error Pin
Joaquín M López Muñoz14-Oct-04 12:44
Joaquín M López Muñoz14-Oct-04 12:44 
QuestionHow To Hold a Key Pin
Dody_DK14-Oct-04 11:48
Dody_DK14-Oct-04 11:48 
AnswerRe: How To Hold a Key Pin
ThatsAlok14-Oct-04 18:42
ThatsAlok14-Oct-04 18:42 
AnswerRe: How To Hold a Key Pin
toxcct14-Oct-04 20:01
toxcct14-Oct-04 20:01 
GeneralRe: How To Hold a Key Pin
Dody_DK17-Oct-04 9:56
Dody_DK17-Oct-04 9:56 
Generalmessage reflection Pin
prateekkathuria14-Oct-04 11:47
prateekkathuria14-Oct-04 11:47 
GeneralRe: message reflection Pin
prateekkathuria14-Oct-04 12:33
prateekkathuria14-Oct-04 12:33 
GeneralConstruction fails Pin
Fernando A. Gomez F.14-Oct-04 10:50
Fernando A. Gomez F.14-Oct-04 10:50 
GeneralRe: Construction fails Pin
David Crow14-Oct-04 11:01
David Crow14-Oct-04 11:01 
GeneralRe: Construction fails Pin
Fernando A. Gomez F.14-Oct-04 11:09
Fernando A. Gomez F.14-Oct-04 11:09 
GeneralRe: Construction fails Pin
Fernando A. Gomez F.14-Oct-04 11:16
Fernando A. Gomez F.14-Oct-04 11:16 
GeneralRe: Construction fails Pin
Stan Shannon14-Oct-04 11:02
Stan Shannon14-Oct-04 11:02 
GeneralRe: Construction fails Pin
Fernando A. Gomez F.14-Oct-04 11:11
Fernando A. Gomez F.14-Oct-04 11:11 

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.