Windows Form Shown on Locked Desktop

S

Scott Numbers

Fellow C-Sharp developers,

I have an application that must be able to display a message on a
desktop even if the screen saver has locked the computer. If you pass
"ServiceNotification" as a MessageBoxOption on the MessageBox.Show
method, the MessageBox will display even if there is not a user logged
in. Unfortunately, my users want to override the colors as well as
make other modifications to the MessageBox that cannot be done since
the MessageBox Class cannot easily be subclassed. Most people (as well
as myself) would recommend re-creating a standard window with
MessageBox-like functionality. The only problem is that I am having a
problem recreating the "ServiceNotification" functionality of the
MessageBox.

Does anybody have a clue, how this can be done in a C# application? I
have tried several different things like setting the parent during
window creation, setting style and ex-style bits during window
creation, but have not found the trick.

I would appreciate any insight anybody might have on this.

Thanks in advance,
Scott Numbers
 
S

Scott Numbers

Thanks for the reply Nicholas. I was kind of hoping there was a trick
such as the window using a specific class or being a child of a
specific window or special styles bits. It can obviously be done since
MessageBox does it.

While using Spy++ on the windows to determine infomation about a
MessageBox window, I notice my C-Sharp form window had
'WindowsFormParkingWindow' as the parent window. I would have thought
the parent window would have been none or the Desktop. What is the
purpose of this window?

Anyway, thanks again for the response.
Scott Numbers


Nicholas Paldino said:
Scott,

I don't believe that you can do this. I believe that the
ServiceNotification value is only interpreted by the MessageBox API, and not
by regular windows. I can't find anything in MSDN about
MB_SERVICE_NOTIFICATION which would indicate that kind of functionality is
elsewhere.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Scott Numbers said:
Fellow C-Sharp developers,

I have an application that must be able to display a message on a
desktop even if the screen saver has locked the computer. If you pass
"ServiceNotification" as a MessageBoxOption on the MessageBox.Show
method, the MessageBox will display even if there is not a user logged
in. Unfortunately, my users want to override the colors as well as
make other modifications to the MessageBox that cannot be done since
the MessageBox Class cannot easily be subclassed. Most people (as well
as myself) would recommend re-creating a standard window with
MessageBox-like functionality. The only problem is that I am having a
problem recreating the "ServiceNotification" functionality of the
MessageBox.

Does anybody have a clue, how this can be done in a C# application? I
have tried several different things like setting the parent during
window creation, setting style and ex-style bits during window
creation, but have not found the trick.

I would appreciate any insight anybody might have on this.

Thanks in advance,
Scott Numbers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top