Solved

How to trap WM_USERCHANGED

Posted on 1998-09-24
6
439 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
ID: 1414784
Edited text of question
0
 
LVL 1

Author Comment

by:deesse
ID: 1414785
Adjusted points to 200
0
 
LVL 1

Author Comment

by:deesse
ID: 1414786
Edited text of question
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 
LVL 3

Accepted Solution

by:
plaroche earned 200 total points
ID: 1414787
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
ID: 1414788
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
ID: 1414789
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 Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

860 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