Solved

How to trap WM_USERCHANGED

Posted on 1998-09-24
6
442 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
[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
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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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 an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 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