Hi all
i want to simulate the ctrl + alt + delete keys
I am facing problem with this code. I able to get the reference of the "winlogon" desktop but am unable to simulate the ctrl + alt + delete keys.
can any one help please.
HDESK desktop;
ofstream myfile;
HDESK old_desktop = GetThreadDeskto p(GetCurrentThr eadId());
myfile.open ("c:\\desktop.t xt");
// Attempt to open the named desktop
esktop = OpenDesktop("Wi nlogon", 0, FALSE,
DESKTOP_CREATEM ENU | DESKTOP_CREATEW INDOW |
DESKTOP_ENUMERA TE | DESKTOP_HOOKCON TROL |
DESKTOP_WRITEOB JECTS | DESKTOP_READOBJ ECTS |
DESKTOP_SWITCHD ESKTOP | GENERIC_WRITE);
if(desktop!=NUL L){
myfile << "desktop found.\n";
}else{
myfile << "desktop not found.\n";
}
HWND hwndCtrlAltDel = FindWindow("SAS window class", "SAS window");
if (hwndCtrlAltDel == NULL) {
myfile << "SAS window not found.\n";
hwndCtrlAltDel = HWND_BROADCAST;
}
PostMessage(hwn dCtrlAltDel, WM_HOTKEY, 0, MAKELONG(MOD_AL T | MOD_CONTROL, VK_DELETE));
HWND logonwindow = FindWindow("", "Log On to Windows");
if (logonwindow == NULL) {
myfile << "logon window not found.\n";
}
myfile.close();
i want to simulate the ctrl + alt + delete keys
I am facing problem with this code. I able to get the reference of the "winlogon" desktop but am unable to simulate the ctrl + alt + delete keys.
can any one help please.
HDESK desktop;
ofstream myfile;
HDESK old_desktop = GetThreadDeskto p(GetCurrentThr eadId());
myfile.open ("c:\\desktop.t xt");
// Attempt to open the named desktop
esktop = OpenDesktop("Wi nlogon", 0, FALSE,
DESKTOP_CREATEM ENU | DESKTOP_CREATEW INDOW |
DESKTOP_ENUMERA TE | DESKTOP_HOOKCON TROL |
DESKTOP_WRITEOB JECTS | DESKTOP_READOBJ ECTS |
DESKTOP_SWITCHD ESKTOP | GENERIC_WRITE);
if(desktop!=NUL L){
myfile << "desktop found.\n";
}else{
myfile << "desktop not found.\n";
}
HWND hwndCtrlAltDel = FindWindow("SAS window class", "SAS window");
if (hwndCtrlAltDel == NULL) {
myfile << "SAS window not found.\n";
hwndCtrlAltDel = HWND_BROADCAST;
}
PostMessage(hwn dCtrlAltDel, WM_HOTKEY, 0, MAKELONG(MOD_AL T | MOD_CONTROL, VK_DELETE));
HWND logonwindow = FindWindow("", "Log On to Windows");
if (logonwindow == NULL) {
myfile << "logon window not found.\n";
}
myfile.close();
Comment