This tiny code will demonstrate how to log-off from windows.

#include <windows.h>
#include <stdio.h>
int main (int argc, char **argv)
 printf ("Good-bye!\n");
 ExitWindows(0, 0);
 return 0;

I always thought that more went into log-in/log-off code

wow, just what i needed 8)
could you make one for "shutdown" :-D

great superb fantabulous man superb

With newer versions of windows you acn also use the "shutdown" command by calling system();