LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I log off of windows 2000 using window SDK???

All I need to do is to log the current user off of windows 2000 if a certain amount of time has elapsed without any interaction. Thanks.
0 Kudos
Message 1 of 4
(3,227 Views)
Hello

You would have to use the Windows SDk's for that.
Check out the following link to the MSDN, that should give you some tips on how to start off.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/shutdown_3ago.asp

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 4
(3,227 Views)
I have followed the sdk information as far as I know and now am able to RESTART, but what I'd like to be able to to is only LOG OFF. A piece of my code is below. I specify that I only want to log off rather than restart, but whatever options are in the code, my machine restarts, taking more time than I'd like.

case EVENT_COMMIT:
//only logs off the user, the second parameter is ignored in windows 2000
ExitWindowsEx(EWX_LOGOFF, 0);
break;
0 Kudos
Message 3 of 4
(3,227 Views)
More info: If I run this in visual C++ using the following code:

#include

int main(int argc, char* argv[])
{
ExitWindows(0, 0);
return 0;
}

it works (it only logs me off)

If I use the exact same code in CVI, I get restarted rather than just logged off?? In both cases, I've got cdecl as the function calling method.

thank you.
0 Kudos
Message 4 of 4
(3,227 Views)