For Programmers: Free Programming Magazines  


Home > Archive > MSDN > June 2006 > detect absence/presence of message loop programatically









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author detect absence/presence of message loop programatically
jjbval

2006-06-17, 8:03 am

Is there a way to programmatically detect the presence of a message loop in
an application ?

I need to do this so that when a piece of code in a DLL that relies the
power management messages is used in an application that has no message loop
of it's own I can spawn a thread to get the messages delivered, but *NOT* do
so if the application already has a message loop running.

Alternatively, is there a way to detect/hook device removal and insertion
and suspend and resume without the use of the APM_???? messages ?
Gerry Hickman

2006-06-17, 8:03 am

Hi,

Have you looked at SPY++ ? It may enable you to test some apps and see
what messages are being generated and if it works, you could build
something similar.

jjbval wrote:
> Is there a way to programmatically detect the presence of a message loop in
> an application ?
>
> I need to do this so that when a piece of code in a DLL that relies the
> power management messages is used in an application that has no message loop
> of it's own I can spawn a thread to get the messages delivered, but *NOT* do
> so if the application already has a message loop running.
>
> Alternatively, is there a way to detect/hook device removal and insertion
> and suspend and resume without the use of the APM_???? messages ?



--
Gerry Hickman (London UK)
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com