what SHOULD be a painfully simple API call...
I created a simple Log Off application using Visual C++ 6.0; It was painfully easy, all I had to do was create a new Win32 application, gave it the "Simple Win32 Application" template, and replaced the TODO comment with ExitWindowsEx(EWX_LOGOFF | EWX_FORCE,0);, and it worked absolutely perfectly.
Now, I wanted to create a version that would lock the workstation. I looked up ExitWindowsEx in the help and clicked on System Shutdown Functions under See Also, and found a function called LockWorkStation, which, according to the Help file, was exactly what I was looking for; It was defined in the same header as ExitWindowsEx, was also stored in user32.lib...basically, it's exactly identical except that it locks the workstation instead of logging out.
Problem is, it doesn't work. At all. When I type it in, the parameter list (in this case, VOID) comes up, when I hover over it, I see the prototype, and when I hit F1, I get the help file. But when I compile, it says "error C2065: 'LockWorkStation' : undeclared identifier"
It's *not* an undelared identifier, it's part of the API.
What the *expletives deleted* do I have to do to accomplish what ought to be a dead simple API call? I even tried loading Visual Basic, even though I don't know anything about Visual Basic, and managed to accomplish...precisely bugger. VB won't make the API call, either.