i used these fuctions so as to enable log off /reboot and shutdown through my program but it seems that only log off is fuctioning. why is that? even if i force a shutdown it still just logs off... (windows 2000)..if it has to do with the windows authoring and permissions how can i bypass them?
void __fastcall TForm1::Logoff1Click(TObject *Sender)
{
ExitWindowsEx(EWX_LOGOFF, 0);
}
//----------------------------------------------------------
void __fastcall TForm1::Reboot1Click(TObject *Sender)
{
ExitWindowsEx(EWX_REBOOT, 0);
}
//----------------------------------------------------------
void __fastcall TForm1::Shutdown1Click(TObject *Sender)
{
ExitWindowsEx(EWX_POWEROFF, 0);
}
//-------------
void __fastcall TForm1::Logoff1Click(TObject *Sender)
{
ExitWindowsEx(EWX_LOGOFF, 0);
}
//----------------------------------------------------------
void __fastcall TForm1::Reboot1Click(TObject *Sender)
{
ExitWindowsEx(EWX_REBOOT, 0);
}
//----------------------------------------------------------
void __fastcall TForm1::Shutdown1Click(TObject *Sender)
{
ExitWindowsEx(EWX_POWEROFF, 0);
}
//-------------