Screen does not refresh when screen saver active

G

Guest

I have a C# .NET Framework 1.1 application running on XP SP2 that displays
alerts. When no alerts are active, the application is hidden. The app runs a
background thread to check for alerts. When an alert is detected, the message
information is displayed using a delegate to update the UI and display the
window. This works great as long as the screen saver is not active. However
when the screen saver is active (and password protected) the text in the
alert window gets updated but when the computer is unlocked the alert window
does not display the new text.
I have tried calling Invalidate, Update, Activate, Refresh, but nothing
seems to actually cause the full window and all child controls to refresh and
show the updated contents.

What do I need to do to cause the updated information to display properly
when the machine is unlocked from the screen saver?

Thanks,

Leslie
 
M

Michael Nemtsev

Hello Leslie,

I suppose you need to handle the Microsoft.Win32.SystemEvents.SessionSwitch
event to handle the situation when the user locking the station.
So you need to change your architecture slightly to keep the queue of alerts
and shows the latest event after this event's arise

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

L> I have a C# .NET Framework 1.1 application running on XP SP2 that
L> displays alerts. When no alerts are active, the application is
L> hidden. The app runs a background thread to check for alerts. When an
L> alert is detected, the message information is displayed using a
L> delegate to update the UI and display the window. This works great as
L> long as the screen saver is not active. However when the screen saver
L> is active (and password protected) the text in the alert window gets
L> updated but when the computer is unlocked the alert window does not
L> display the new text. I have tried calling Invalidate, Update,
L> Activate, Refresh, but nothing seems to actually cause the full
L> window and all child controls to refresh and show the updated
L> contents.
L>
L> What do I need to do to cause the updated information to display
L> properly when the machine is unlocked from the screen saver?
L>
L> Thanks,
L>
L> Leslie
L>
 
G

Guest

Michael,

This sounds like the correct solution. Unfortunately SessionSwitch is not
supported in 1.1. Are there any other approaches other than trapping the
event using InteropServices?

Also, is this normal behavior? In this case I have updated the text in the
text box and if I select the "invisible text" using the mouse, it shows up,
but until I interact with with window or somehow cause it to refresh manually
the text remains hidden.

Thanks,

Leslie
 
M

Michael Nemtsev

Hello Leslie,

Then use API WTSRegisterSessionNotification methods.
It's used by .NET SessionSwitch

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

L> Michael,
L>
L> This sounds like the correct solution. Unfortunately SessionSwitch is
L> not supported in 1.1. Are there any other approaches other than
L> trapping the event using InteropServices?
L>
L> Also, is this normal behavior? In this case I have updated the text
L> in the text box and if I select the "invisible text" using the mouse,
L> it shows up, but until I interact with with window or somehow cause
L> it to refresh manually the text remains hidden.
L>
L> Thanks,
L>
L> Leslie
L>
L> "Michael Nemtsev" wrote:
L>
Hello Leslie,

I suppose you need to handle the
Microsoft.Win32.SystemEvents.SessionSwitch
event to handle the situation when the user locking the station.
So you need to change your architecture slightly to keep the queue of
alerts
and shows the latest event after this event's arise
---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo

L> I have a C# .NET Framework 1.1 application running on XP SP2 that
L> displays alerts. When no alerts are active, the application is
L> hidden. The app runs a background thread to check for alerts. When
an
L> alert is detected, the message information is displayed using a
L> delegate to update the UI and display the window. This works great
as
L> long as the screen saver is not active. However when the screen
saver
L> is active (and password protected) the text in the alert window
gets
L> updated but when the computer is unlocked the alert window does
not
L> display the new text. I have tried calling Invalidate, Update,
L> Activate, Refresh, but nothing seems to actually cause the full
L> window and all child controls to refresh and show the updated
L> contents.
L>
L> What do I need to do to cause the updated information to display
L> properly when the machine is unlocked from the screen saver?
L>
L> Thanks,
L>
L> Leslie
L
 
G

Guest

Michael,

Will do. Thanks for your help.

Leslie

Michael Nemtsev said:
Hello Leslie,

Then use API WTSRegisterSessionNotification methods.
It's used by .NET SessionSwitch

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

L> Michael,
L>
L> This sounds like the correct solution. Unfortunately SessionSwitch is
L> not supported in 1.1. Are there any other approaches other than
L> trapping the event using InteropServices?
L>
L> Also, is this normal behavior? In this case I have updated the text
L> in the text box and if I select the "invisible text" using the mouse,
L> it shows up, but until I interact with with window or somehow cause
L> it to refresh manually the text remains hidden.
L>
L> Thanks,
L>
L> Leslie
L>
L> "Michael Nemtsev" wrote:
L>
Hello Leslie,

I suppose you need to handle the
Microsoft.Win32.SystemEvents.SessionSwitch
event to handle the situation when the user locking the station.
So you need to change your architecture slightly to keep the queue of
alerts
and shows the latest event after this event's arise
---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo

L> I have a C# .NET Framework 1.1 application running on XP SP2 that
L> displays alerts. When no alerts are active, the application is
L> hidden. The app runs a background thread to check for alerts. When
an
L> alert is detected, the message information is displayed using a
L> delegate to update the UI and display the window. This works great
as
L> long as the screen saver is not active. However when the screen
saver
L> is active (and password protected) the text in the alert window
gets
L> updated but when the computer is unlocked the alert window does
not
L> display the new text. I have tried calling Invalidate, Update,
L> Activate, Refresh, but nothing seems to actually cause the full
L> window and all child controls to refresh and show the updated
L> contents.
L>
L> What do I need to do to cause the updated information to display
L> properly when the machine is unlocked from the screen saver?
L>
L> Thanks,
L>
L> Leslie
L>
 

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