Crtl+Alt+Del

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by merendo.

Hi @ll.
How to protect a programme from being terminated by Crtl+Alt+Del?

Cu @ll, merendo
--
I've been hiding - What am I hiding from???
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Use the SEARCH button :)

viewtopic.php?t=404
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by merendo.

Thanks for reminding me (This is how, you remind me...) :wink:

Cu @ll, merendo
--
I've been hiding - What am I hiding from???
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by merendo.

Hmm... Sorry none of the codes works. Always: Blah is not a command, an array or a linked list. Or: Assembly error. Please mail us this file!!!

Cu @ll, merendo
--
I've been hiding - What am I hiding from???
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Did you read the link posted by PB in the above link??
you can't do it on WinNT/Win2000/WinXP because of their
security settings. For a Visual Basic discussion about it, please see
this link:

http://groups.google.com/groups?as_q=ct ... misc&hl=en

And also when trying the above mentioned code, did you have INLINE ASM enabled?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by merendo.

Guess I have to change my signature. I AM using Win98SE but it doesn't work. Maybe an AMD K6-2 350MhZ is too slow?

Cu @ll, merendo
--
I've been hiding - What am I hiding from???
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> How to protect a programme from being terminated by Crtl+Alt+Del?

This has always worked for me:

Code: Select all

; Hide app from the Win 9x/ME CTRL+ALT+DEL task list.
; Note: Does NOT work with NT/2K/XP for security reasons.
; Inline ASM does NOT need to be enabled in Compiler Options.
r=GetProcAddress_(GetModuleHandle_("kernel32.dll"),"RegisterServiceProcess")
If r : !push dword 1 : !push dword 0  : !call r : EndIf ; Change 1 to 0 to show.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by merendo.

Thanks. This also works fine for me. But I always had ASM Inline enabled and nothing worked. I guess I have to buy a new chest but no money...

Cu @ll, merendo
--
I've been hiding - What am I hiding from???
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

This code I posted above used to work, but not anymore. I had to
change it to separate lines like so, but now I get an error for the
"call" line. Anyone know how to bring it up to v3.81's expectations?

Code: Select all

; Hide app from the Win 9x/ME CTRL+ALT+DEL task list.
; Note: Does NOT work with NT/2K/XP for security reasons.
; Inline ASM does NOT need to be enabled in Compiler Options.

r=GetProcAddress_(GetModuleHandle_("kernel32.dll"),"RegisterServiceProcess")
If r
  !push dword 1 ; 1 = Hide, 0 = Show.
  !push dword 0
  !call r
EndIf
Fred
Administrator
Administrator
Posts: 16617
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Dunno why it worked before as it's not a correct syntaxe (could work only of no '!' was used and enableinlineasm used. Here is the correct code snippet:

Code: Select all

; Hide app from the Win 9x/ME CTRL+ALT+DEL task list. 
; Note: Does NOT work with NT/2K/XP for security reasons. 
; Inline ASM does NOT need to be enabled in Compiler Options. 

r=GetProcAddress_(GetModuleHandle_("kernel32.dll"),"RegisterServiceProcess") 
If r 
  !push dword 1 ; 1 = Hide, 0 = Show. 
  !push dword 0 
  !call dword [v_r] 
EndIf 
BTW, it's easier to use CallFunctionFast for this kind of task:

Code: Select all

; Hide app from the Win 9x/ME CTRL+ALT+DEL task list. 
; Note: Does NOT work with NT/2K/XP for security reasons. 
; Inline ASM does NOT need to be enabled in Compiler Options. 

r=GetProcAddress_(GetModuleHandle_("kernel32.dll"),"RegisterServiceProcess") 
If r
  CallFunctionFast(r, 0, 1)
EndIf 
Post Reply