Solved

Making WM_TIMECHANGE independent on top-level Window?

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

Expert Comment

by:jhance
Comment Utility
no comment
0
 

Author Comment

by:TYB
Comment Utility
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
Comment Utility
>>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
Comment Utility

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
Comment Utility
I use the solution with the invisible Wnd... tnx for contribution.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now