Click here to Skip to main content
16,005,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: a question about WTL Pin
Paul M Watt17-Apr-02 22:07
mentorPaul M Watt17-Apr-02 22:07 
GeneralBalloon ToolTip Pin
Sameer Maggon17-Apr-02 21:00
Sameer Maggon17-Apr-02 21:00 
GeneralRe: Balloon ToolTip Pin
Ravi Bhavnani17-Apr-02 21:06
professionalRavi Bhavnani17-Apr-02 21:06 
GeneralRe: Balloon ToolTip Pin
Shog918-Apr-02 5:08
sitebuilderShog918-Apr-02 5:08 
QuestionSave a tree control's hiberarchy ? Pin
DreamWords17-Apr-02 20:52
DreamWords17-Apr-02 20:52 
AnswerRe: Save a tree control's hiberarchy ? Pin
Ravi Bhavnani17-Apr-02 21:02
professionalRavi Bhavnani17-Apr-02 21:02 
GeneralThank you! Pin
DreamWords17-Apr-02 21:19
DreamWords17-Apr-02 21:19 
GeneralXP's Switch User feature complicates IPC Pin
17-Apr-02 20:11
suss17-Apr-02 20:11 
Hi folks, I'm writing a software package that runs on NT/2K/XP.

It consists of a service that always runs, plus a UI app that runs while a user is logged on. The service needs to send notifications to the UI app.

So far I have been using BroadcastSystemMessage() to do this and it works, EXCEPT when I have multiple users logged onto XP via fast user switching.

In that case, it seems as if the service only broadcasts to the first logged on user's session; the sessions that logged on later don't seem to get the broadcast.

My service's call to BroadcastSystemMessage() looks like this:

DWORD dwRecipients = BSM_ALLDESKTOPS|BSM_APPLICATIONS;
BroadcastSystemMessage(BSF_POSTMESSAGE|BSF_IGNORECURRENTTASK|BSF_NOHANG, &dwRecipients, MSG_TO_MONITOR, msgtype, 0 );

As I said, the above code works in NT/2K and even XP when only one user is logged on, but when more than one user is logged on XP, it only seems to broadcast to the current user.

I have a feeling that I should be using some other API to get my message through to all user sessions. I've looked at the WTS... API stuff for terminal services, but there doesn't seem to be anything that sends messages (there is a badly-named routine WTSSendMessage, but it shows a messagebox, it doesn't actually send a message).

So, any IPC/XP geeks out there have any advice? At this point I'm thinking of using global objects as semaphores and having a thread in the UI app wait for them and then send messages to it's main window, but I hope there is something simpler...

Thanks,

Alex Benenson
Confused | :confused:

Alex Benenson
alex@sashazur.com
GeneralRe: XP's Switch User feature complicates IPC Pin
Blake Miller15-Apr-04 9:28
Blake Miller15-Apr-04 9:28 
Questionwhy won't this work? Pin
Shotgun17-Apr-02 16:54
Shotgun17-Apr-02 16:54 
AnswerRe: why won't this work? Pin
Mike Nordell17-Apr-02 17:44
Mike Nordell17-Apr-02 17:44 
GeneralEdit Boxes Pin
sankar17-Apr-02 16:15
sankar17-Apr-02 16:15 
GeneralRe: Edit Boxes Pin
Mike Nordell17-Apr-02 17:31
Mike Nordell17-Apr-02 17:31 
GeneralRe: Edit Boxes Pin
sankar17-Apr-02 18:24
sankar17-Apr-02 18:24 
GeneralRe: Edit Boxes Pin
Mike Nordell17-Apr-02 19:26
Mike Nordell17-Apr-02 19:26 
GeneralRe: Edit Boxes Pin
Ravi Bhavnani17-Apr-02 21:00
professionalRavi Bhavnani17-Apr-02 21:00 
GeneralRe: Edit Boxes Pin
Roger Allen18-Apr-02 3:06
Roger Allen18-Apr-02 3:06 
GeneralAdding Tabs to a Tab Control Pin
17-Apr-02 13:46
suss17-Apr-02 13:46 
GeneralRe: Adding Tabs to a Tab Control Pin
Todd.Harvey18-Apr-02 11:13
Todd.Harvey18-Apr-02 11:13 
GeneralStrange Code in MFC Source Pin
Joel Matthias17-Apr-02 13:04
Joel Matthias17-Apr-02 13:04 
GeneralRe: Strange Code in MFC Source Pin
Shog917-Apr-02 13:07
sitebuilderShog917-Apr-02 13:07 
GeneralRe: Strange Code in MFC Source Pin
Gianfranco Lanzetta17-Apr-02 13:18
Gianfranco Lanzetta17-Apr-02 13:18 
GeneralRe: Strange Code in MFC Source Pin
l a u r e n17-Apr-02 21:13
l a u r e n17-Apr-02 21:13 
GeneralRe: Strange Code in MFC Source Pin
Michael Dunn17-Apr-02 13:33
sitebuilderMichael Dunn17-Apr-02 13:33 
GeneralRe: Strange Code in MFC Source Pin
Joel Matthias17-Apr-02 19:57
Joel Matthias17-Apr-02 19:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.