This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Tool equivelent for rundll32.exe "user32.dll,LockWorkStation"


On Jun  3 16:39, Jason Pyeron wrote:
> Is there a tool like shutdown, etc to lock the workstation or should I stick
> with rundll32.exe "user32.dll,LockWorkStation"?

Stick with it.  A Cygwin tool could do nothing above that.  If you
really want a Cygwin tool, just write your own:

#include <stdio.h>
#define WINVER 0x0500
#include <windows.h>

int main ()
{
  if (!LockWorkStation ())
    {
      fprintf (stderr,
	       "%s: Can't lock workstation.  Win32 error code %lu\n",
      		GetLastError ());
      return 1;
    }
  return 0;
}


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]