Esconder aplicação do CTRL ALT DEL
Amigos do Forum ja vi essa dica aqui, mas não lembro como fazer.
Como esconder aplicação do CTRL+ALT+DEL? alguem pode me ajudar agradeço deste já. :lol:
Como esconder aplicação do CTRL+ALT+DEL? alguem pode me ajudar agradeço deste já. :lol:
A::l::e::x
Curtidas 0
Respostas
Fernando
08/07/2003
Desabilitar Teclas Ctrl+Alt+Del
Ai vai um codigo que peguei no site da Borland que trava as teclas
(Ctrl+Alt+Del),(Alt+Tab), (Ctrl+Esc)
var
OldValue : LongBool;
begin
{liga a trava}
SystemParametersInfo(97, Word(True), @OldValue, 0);
{desliga a trava}
SystemParametersInfo(97, Word(False), @OldValue, 0);
end;
Ai vai um codigo que peguei no site da Borland que trava as teclas
(Ctrl+Alt+Del),(Alt+Tab), (Ctrl+Esc)
var
OldValue : LongBool;
begin
{liga a trava}
SystemParametersInfo(97, Word(True), @OldValue, 0);
{desliga a trava}
SystemParametersInfo(97, Word(False), @OldValue, 0);
end;
GOSTEI 0
Paulo Trajano
08/07/2003
[b:b4321895b2]Para ocultar a aplicação da lista de tarefas Ctrl+Alt+Del:[/b:b4321895b2]
Para chamar a função e ocultar a aplicação da lista:
Para fazer a aplicação aparecer de volta na lista:
[/code]
function RegisterServiceProcess(dwProcessID, dwType:Integer): Integer; stdcall; external ´KERNEL32.DLL´
Para chamar a função e ocultar a aplicação da lista:
RegisterServiceProcess(GetCurrentProcessID, 1)
Para fazer a aplicação aparecer de volta na lista:
RegisterServiceProcess(GetCurrentProcessID, 0)
GOSTEI 0
Maurograca
08/07/2003
[quote:adcd80c658=´Paulo Trajano´][b:adcd80c658]Para ocultar a aplicação da lista de tarefas Ctrl+Alt+Del:[/b:adcd80c658]
Para chamar a função e ocultar a aplicação da lista:
Para fazer a aplicação aparecer de volta na lista:
[/code][/quote:adcd80c658]
function RegisterServiceProcess(dwProcessID, dwType:Integer): Integer; stdcall; external ´KERNEL32.DLL´
Para chamar a função e ocultar a aplicação da lista:
RegisterServiceProcess(GetCurrentProcessID, 1)
Para fazer a aplicação aparecer de volta na lista:
RegisterServiceProcess(GetCurrentProcessID, 0)
Olá, isto só funciona no win9x para o windows XP não existe mais a chamada do procedimento no kernel32.
Alguém saberia como fazer para esconder um processo no winxp sem ter que usar o application.title:=´´; que só oculta a aplicação mas mantém o nome do processo na lista de processos, pensei em fazer um service no lugar de uma aplication...
Se alguém tiver uma idéia de como me ajudar a esconder um processo no windows XP.
Agradeço desde já.
Mauro Graca
GOSTEI 0
Kalango
08/07/2003
Mauro sua ideia de usar aplication.Title:=´´; e boa mas o processo ainda continua rodando. Ele some da lista de aplicativos mas da de processos naum. O que eu to tentando fazer para resolver isso é quando alguem apertar ctrl+alt+del sua aplicação perde o focus dai vc simula o ´alt+f4´
e reseta o focu pro seu aplicativo e bloqueia as teclas alt+f4 ctrl+esc e outras.
veja como bloque ar as teclas de atalho so num funciona pro ctrl +alt+del
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
const
WH_KEYBOARD_LL = 13;
LLKHF_ALTDOWN = $20;
type
KBDLLHOOKSTRUCT = record
vkCode: DWORD;
scanCode: DWORD;
flags: DWORD;
time: DWORD;
dwExtraInfo: Longint ;
end;
var
hhkLowLevelKybd : HHOOK;
FoldProc : LongInt;
hSASWnd : HWND;
hThread : Cardinal;
Form1: TForm1;
implementation
{$R *.dfm}
Function LowLevelKeyboardProc(nCode : Integer; wParam : Longint; var LParam: KBDLLHOOKSTRUCT) : Longint; stdcall;
var
fEatKeystroke : Boolean;
dwThreadId : Cardinal;
begin
If (nCode = HC_ACTION) Then
begin
If (wParam = WM_KEYDOWN) Or
(wParam = WM_SYSKEYDOWN) Or
(wParam = WM_KEYUP) Or
(wParam = WM_SYSKEYUP) Then
begin
fEatKeystroke :=
//-----------
(((GetKeyState(VK_CONTROL) And $8000) <> 0) and
((((GetKeyState(VK_RMENU)) or (GetKeyState(VK_LMENU))) And $8000) <> 0) and
(LParam.vkCode = VK_DELETE)) or
//--------------
((LParam.vkCode = VK_LWIN)) or //tecla menu iniciar esquerdo
((LParam.vkCode = VK_RWIN)) or //tecla menu iniciar direito
((LParam.vkCode = VK_F4) And ((LParam.flags And LLKHF_ALTDOWN ) <> 0)) Or //ALT + F4
((LParam.vkCode = VK_TAB) And ((LParam.flags And LLKHF_ALTDOWN ) <> 0)) Or //ALT + TAB
((LParam.vkCode = VK_ESCAPE) And ((LParam.flags And LLKHF_ALTDOWN ) <> 0)) Or //ALT + ESC
((LParam.vkCode = VK_ESCAPE) And ((GetKeyState(VK_CONTROL) And $8000) <> 0)); //CONTROL + ESC
End;
End;
If fEatKeystroke Then
Result := -1
Else
Result := CallNextHookEx(0, nCode, wParam, LongInt(@LParam));
End;
procedure TForm1.FormCreate(Sender: TObject);
begin
hhkLowLevelKybd := 0;
hhkLowLevelKybd := SetWindowsHookEx(WH_KEYBOARD_LL, @LowLevelKeyboardProc,
HInstance, 0);
application.title:=´´;
end;
end.
e reseta o focu pro seu aplicativo e bloqueia as teclas alt+f4 ctrl+esc e outras.
veja como bloque ar as teclas de atalho so num funciona pro ctrl +alt+del
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
const
WH_KEYBOARD_LL = 13;
LLKHF_ALTDOWN = $20;
type
KBDLLHOOKSTRUCT = record
vkCode: DWORD;
scanCode: DWORD;
flags: DWORD;
time: DWORD;
dwExtraInfo: Longint ;
end;
var
hhkLowLevelKybd : HHOOK;
FoldProc : LongInt;
hSASWnd : HWND;
hThread : Cardinal;
Form1: TForm1;
implementation
{$R *.dfm}
Function LowLevelKeyboardProc(nCode : Integer; wParam : Longint; var LParam: KBDLLHOOKSTRUCT) : Longint; stdcall;
var
fEatKeystroke : Boolean;
dwThreadId : Cardinal;
begin
If (nCode = HC_ACTION) Then
begin
If (wParam = WM_KEYDOWN) Or
(wParam = WM_SYSKEYDOWN) Or
(wParam = WM_KEYUP) Or
(wParam = WM_SYSKEYUP) Then
begin
fEatKeystroke :=
//-----------
(((GetKeyState(VK_CONTROL) And $8000) <> 0) and
((((GetKeyState(VK_RMENU)) or (GetKeyState(VK_LMENU))) And $8000) <> 0) and
(LParam.vkCode = VK_DELETE)) or
//--------------
((LParam.vkCode = VK_LWIN)) or //tecla menu iniciar esquerdo
((LParam.vkCode = VK_RWIN)) or //tecla menu iniciar direito
((LParam.vkCode = VK_F4) And ((LParam.flags And LLKHF_ALTDOWN ) <> 0)) Or //ALT + F4
((LParam.vkCode = VK_TAB) And ((LParam.flags And LLKHF_ALTDOWN ) <> 0)) Or //ALT + TAB
((LParam.vkCode = VK_ESCAPE) And ((LParam.flags And LLKHF_ALTDOWN ) <> 0)) Or //ALT + ESC
((LParam.vkCode = VK_ESCAPE) And ((GetKeyState(VK_CONTROL) And $8000) <> 0)); //CONTROL + ESC
End;
End;
If fEatKeystroke Then
Result := -1
Else
Result := CallNextHookEx(0, nCode, wParam, LongInt(@LParam));
End;
procedure TForm1.FormCreate(Sender: TObject);
begin
hhkLowLevelKybd := 0;
hhkLowLevelKybd := SetWindowsHookEx(WH_KEYBOARD_LL, @LowLevelKeyboardProc,
HInstance, 0);
application.title:=´´;
end;
end.
GOSTEI 0
Sanses
08/07/2003
As dicas do início fucionam para o windows 9x e a penultima até para o XP. Esta funciona para XP, uma vez que o XP não permite que sejam manipulados determinados controladores internos, o que temos que fazer é bloquear a apresentação da caixa ´Gerenciador de tarefas´, resultante do pressionamento do CTRL+ALT+DEL
Qualquer dúvida estamos ai
Sanses
uses registry; var reg : tregistry; begin reg:=tregistry.create; reg.RootKey:=HKEY_CURRENT_USER; reg.OpenKey(´\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System´, true); reg.writebool(´DisableTaskMgr´, true); end;
Qualquer dúvida estamos ai
Sanses
GOSTEI 0
Orismar
08/07/2003
unit UnitTravasEspeciais;
interface
uses Windows, Messages;
type
PKBDLLHOOKSTRUCT = ^KBDLLHOOKSTRUCT;
KBDLLHOOKSTRUCT = packed record
vkCode : DWORD;
scanCode : DWORD;
flags : DWORD;
time : DWORD;
dwExtraInfo : DWORD;
end;
const
LLKHF_EXTENDED = $00000001;
LLKHF_INJECTED = $00000010;
LLKHF_ALTDOWN = $00000020;
LLKHF_UP = $00000080;
LLMHF_INJECTED = $00000001;
WH_Keyboard_LL = 13;
procedure StartHook; stdcall;
procedure StopHook; stdcall;
implementation
var
OldHook: HHook;
function LowLevelHookProc(nCode:Integer; awParam: WPARAM;
alParam:LPARAM): LRESULT; stdcall;
var
ControlPressed, AltPressed, EscapePressed, WinPressed, TabPressed:
boolean;
pkbhs: PKBDLLHOOKSTRUCT;
FilterThis: boolean;
begin
FilterThis := false;
if nCode = HC_ACTION then
begin
pkbhs := PKBDLLHOOKSTRUCT(alParam);
ControlPressed := (GetAsyncKeyState(VK_CONTROL) and $8000) <> 0;
AltPressed := ((pkbhs^.flags and LLKHF_ALTDOWN)<>0);
EscapePressed := (pkbhs^.vkCode = VK_ESCAPE);
WinPressed := (pkbhs^.vkCode in [VK_LWIN, VK_RWIN]);
TabPressed := (pkbhs^.vkCode = VK_TAB);
// Disable WINDOWS Key
if WinPressed then
FilterThis := true
else
// Disable CTRL+ESC
if ControlPressed and EscapePressed then
FilterThis := true
else
// Disable ALT+TAB
if AltPressed and TabPressed then
FilterThis := true
else
// Disable ALT+ESC
if AltPressed and EscapePressed then
FilterThis := true;
end;
if not FilterThis then
Result:= CallNextHookEx (OldHook, nCode, awParam, alParam)
else
Result := 1;
end;
procedure StartHook; stdcall;
begin
OldHook := SetWindowsHookEx(WH_Keyboard_LL, LowLevelHookProc,
HInstance, 0);
end;
procedure StopHook; stdcall;
begin
UnHookWindowsHookEx(OldHook);
end;
end.
interface
uses Windows, Messages;
type
PKBDLLHOOKSTRUCT = ^KBDLLHOOKSTRUCT;
KBDLLHOOKSTRUCT = packed record
vkCode : DWORD;
scanCode : DWORD;
flags : DWORD;
time : DWORD;
dwExtraInfo : DWORD;
end;
const
LLKHF_EXTENDED = $00000001;
LLKHF_INJECTED = $00000010;
LLKHF_ALTDOWN = $00000020;
LLKHF_UP = $00000080;
LLMHF_INJECTED = $00000001;
WH_Keyboard_LL = 13;
procedure StartHook; stdcall;
procedure StopHook; stdcall;
implementation
var
OldHook: HHook;
function LowLevelHookProc(nCode:Integer; awParam: WPARAM;
alParam:LPARAM): LRESULT; stdcall;
var
ControlPressed, AltPressed, EscapePressed, WinPressed, TabPressed:
boolean;
pkbhs: PKBDLLHOOKSTRUCT;
FilterThis: boolean;
begin
FilterThis := false;
if nCode = HC_ACTION then
begin
pkbhs := PKBDLLHOOKSTRUCT(alParam);
ControlPressed := (GetAsyncKeyState(VK_CONTROL) and $8000) <> 0;
AltPressed := ((pkbhs^.flags and LLKHF_ALTDOWN)<>0);
EscapePressed := (pkbhs^.vkCode = VK_ESCAPE);
WinPressed := (pkbhs^.vkCode in [VK_LWIN, VK_RWIN]);
TabPressed := (pkbhs^.vkCode = VK_TAB);
// Disable WINDOWS Key
if WinPressed then
FilterThis := true
else
// Disable CTRL+ESC
if ControlPressed and EscapePressed then
FilterThis := true
else
// Disable ALT+TAB
if AltPressed and TabPressed then
FilterThis := true
else
// Disable ALT+ESC
if AltPressed and EscapePressed then
FilterThis := true;
end;
if not FilterThis then
Result:= CallNextHookEx (OldHook, nCode, awParam, alParam)
else
Result := 1;
end;
procedure StartHook; stdcall;
begin
OldHook := SetWindowsHookEx(WH_Keyboard_LL, LowLevelHookProc,
HInstance, 0);
end;
procedure StopHook; stdcall;
begin
UnHookWindowsHookEx(OldHook);
end;
end.
GOSTEI 0