How to trap WM_USERCHANGED

*** 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
LVL 1
deesseAsked:
Who is Participating?
 
plarocheConnect With a Mentor Commented:
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
 
deesseAuthor Commented:
Edited text of question
0
 
deesseAuthor Commented:
Adjusted points to 200
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
deesseAuthor Commented:
Edited text of question
0
 
deesseAuthor Commented:
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
 
deesseAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.