Solved

Making WM_TIMECHANGE independent on top-level Window?

Posted on 2001-08-15
5
373 Views
Last Modified: 2013-11-20
0
Comment
Question by:TYB
5 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 6387762
no comment
0
 

Author Comment

by:TYB
ID: 6387785
Sorry about that there is no question.

I want to map the WM_TIMECHANGE-message in a class other than a CWnd-class, how do I do that ?
The WM_TIMECHANGE is sent to all top-level windows but if I do not have a window then the message wont
be caught, so I want the message to be mapped in a class other than a CWnd-class so that I can do necessary
stuff when the time switches from Daylight to Standard and the other way around.
Is there a way around this or can the above be done ?
0
 
LVL 86

Expert Comment

by:jkr
ID: 6387907
>>The WM_TIMECHANGE is sent to all top-level windows but
>>if I do not have a window then the message wont be caught

All (well, almost) MFC GUI elements are based on CWnd. And, even more important, to process a message, you need to have a window (where should the system send the message to?). Why don't you simply create an invisible window that can receive the message?
0
 
LVL 2

Accepted Solution

by:
SamratAshok earned 200 total points
ID: 6388206

You are writing a MFC application without creating any window!?

How are you doing that in first place?
Invisible window approach has been done to death and it is generally the most
efficient, so unless you have reason not to use it. you're fine.

If you cannot create your own window, try writing hook procedure that hooks onto
main desktop window and traps the messages from there. I believe there is
sample somewhere in MSDN about Hook procs.



0
 

Author Comment

by:TYB
ID: 6405852
I use the solution with the invisible Wnd... tnx for contribution.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question