Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Making WM_TIMECHANGE independent on top-level Window?

Posted on 2001-08-15
5
375 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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