Desktop locked

  • Thread starter Thread starter Peter Larsen [CPH]
  • Start date Start date
P

Peter Larsen [CPH]

Hi,

I have a window that resize itself when some event occurs.
What happens is that a panel is toggled invisible when idle and visible when
active. Also the window height change.
There are also other layout changes, but basically we are talking about a
window resize (just to simplify it).

This work just fine if the desktop is visible.

But if the desktop is locked or not visible for some reasons, the size is
calculated wrong.
I think it does make sense since the form won't need to update if not
visible. The problem is that the form is left with a wrong size.

My question is - are there a way where i can detect if the form think it is
invisible or doesn't need to update its handle/form ??

Thanks

BR
Peter
 
Hello Peter,

When you say "a panel is toggled invisible when idle and visible when
active", what do you mean by idle and active? Is it the active/deactive
state of the window or the user input state?

Could post your code that is currently having problem so I can have a
better understanding of the situation?

The form itself doesn't provide a direct way to indicate whether or not it
is visible. Here we say Visible means visible to the user - because the
Form.Visible property only detects the WS_VISIBLE style under the hood, but
the form itself might be covered by other windows or even like you said,
the active desktop could be the screen saver or winlogon (locked or UAC
dialog).

So I think you may want to add checks to the scenarios that the screen
saver is running or the user's desktop is locked.

To check the screen saver running status:

Call the SystemParameterInfo function (P/Invoke) with the
SPI_GETSCREENSAVERRUNNING parameter.

To check the winlogon desktop:

Call the OpenInputDesktop with DESKTOP_READOBJECTS access request, if the
winlogon or other secured desktop is currently owning the user input, the
function will return null so it is very likely your application is
currently not visible or operatable to the user.

If you could explain more detailed requirements about your app, and your
preferred programming language for a sample, I can work together with you
towards a better solution.

Thanks,

Jie Wang

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hello Peter,

Any updates on the issue?

If you still need assistance, please don't hesitate to let me know.

Thanks,

Jie Wang

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Jie,

Thanks for your reply.

The active/deactive state does not necessary means user input.
I think i will look into DESKTOP_READOBJECTS - it will probably solve 99% of
the problems.

Thanks again.
BR
Peter
 
Thanks,
good info
kcs
Peter Larsen said:
Hi Jie,

Thanks for your reply.

The active/deactive state does not necessary means user input.
I think i will look into DESKTOP_READOBJECTS - it will probably solve 99%
of the problems.

Thanks again.
BR
Peter


"Jie Wang [MSFT]" said:
Hello Peter,

When you say "a panel is toggled invisible when idle and visible when
active", what do you mean by idle and active? Is it the active/deactive
state of the window or the user input state?
 
Back
Top