?
Solved

How to trap WM_USERCHANGED

Posted on 1998-09-24
6
Medium Priority
?
455 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
LVL 3

Accepted Solution

by:
plaroche earned 800 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

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…
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

777 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