Solved

Making WM_TIMECHANGE independent on top-level Window?

Posted on 2001-08-15
5
379 Views
Last Modified: 2013-11-20
0
Comment
Question by:TYB
[X]
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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ORA-01403: no data found 43 116
Not needed 13 134
Way to decrease size of apk file 9 133
Adjust the codes 3 66
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

710 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