Solved

How to trap WM_USERCHANGED

Posted on 1998-09-24
6
416 Views
Last Modified: 2013-12-03
*** Urgent ***
Hi,
I'm making a services for 95/98 and I need to trap WM_USERCHANGED, I try with PreTranslateMessage(MSG* pMsg) but with out success.

Can you tell me how this @#$ message can be trap in my app.

Thank you very much.
Deesse
0
Comment
Question by:deesse
  • 5
6 Comments
 
LVL 1

Author Comment

by:deesse
Comment Utility
Edited text of question
0
 
LVL 1

Author Comment

by:deesse
Comment Utility
Adjusted points to 200
0
 
LVL 1

Author Comment

by:deesse
Comment Utility
Edited text of question
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 3

Accepted Solution

by:
plaroche earned 200 total points
Comment Utility
Are you doing this with MFC or borland?

The message is sent to your primary application window. As the doc states:

WM_USERCHANGED
A WM_USERCHANGED (0x0054) message is sent via BroadcastSystemMessage to all top-level windows, installable drivers, and VxDs when the user logs on or off and user profiles are enabled.


Under MFC you can handle this in your CMainFrame class:

In mainfrm.cpp, in the message map
 ON_MESSAGE(WM_USERCHANGED, OnUserChanged)

In mainfrm.h, before DECLARE_MESSAGE_MAP()
 afx_msg LONG OnUserChanged(WPARAM, LPARAM);

In mainfrm.cpp

LONG CMainFrm::OnUserChanged(WPARAM p1, LPARAM p2)
{
// Do something
return 0;
}

0
 
LVL 1

Author Comment

by:deesse
Comment Utility
I develop with MFC
and
Let me try this, I didn't remember if I already test that without success, it's been a long time...


0
 
LVL 1

Author Comment

by:deesse
Comment Utility
Very Good,

But I thought the ON_MESSAGE was only for user defined message like WM_USER + X.

Another proof that we can learn something every day...
Thank's again
Deesse.


0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

8 Experts available now in Live!

Get 1:1 Help Now