Locking a Windows machine using C# .NET framework

  • Thread starter Thread starter Simon Mercer
  • Start date Start date
S

Simon Mercer

Hi,

Just wondered if there is any code based way of locking the operating
system, the same way as when doing ctrl + alt + del and selecting lock
computer.

I have created a screensaver in c# and when it activates I want the computer
to lock at the same time.

Any pointers/ideas?

Thanks,
Simon
 
Hi Simon
There is Win32 api that you can use to detect the CEvent CTRL_CLOSE_EVENT
or CTRL_LOGOFF_EVENT not sure if you can raise these events yourself from
your code , but I guess you can . try to search on that event API and how
to do that .
Mohamed M .Mahfouz
Developer Support Engineer
ITWorx on behalf of Microsoft EMEA GTSC
 
Back
Top