Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #16  
Old 09-03-2013, 08:15
BoB's Avatar
BoB BoB is offline
Lo*eXeTools*rd
 
Join Date: Jun 2009
Location: England
Posts: 85
Rept. Given: 88
Rept. Rcvd 56 Times in 24 Posts
Thanks Given: 2
Thanks Rcvd at 2 Times in 2 Posts
BoB Reputation: 56
Hi, you can create a new desktop object, which avoids Alt + Tab, Ctrl + Alt + Del ..

Code:
hOldThreadDesktop := GetThreadDesktop(GetCurrentThreadId);
hOldInputDesktop := OpenInputDesktop(0, FALSE, DESKTOP_CREATEWINDOW + DESKTOP_SWITCHDESKTOP);
hLockedDesktop := CreateDesktop('LockedDesktop', nil, nil, 0, DESKTOP_CREATEWINDOW + DESKTOP_SWITCHDESKTOP, nil);
SetThreadDesktop(hLockedDesktop);
SwitchDesktop(hLockedDesktop);
..Then run your application within that new desktop ..

Code:
SI.cb := SizeOf(StartupInfo);
SI.lpDesktop := PChar('LockedDesktop');
If CreateProcess(nil, 'YourApp.exe', nil, nil, True, 0, nil, nil, SI, PI) Then
  WaitForSingleObject(PI.hProcess, INFINITE);
..And when your app exits, return to 'real' desktop ..

Code:
if hOldInputDesktop <> 0 then SwitchDesktop(hOldInputDesktop);
if hOldThreadDesktop <> 0 then SetThreadDesktop(hOldThreadDesktop);
if hLockedDesktop <> 0 then CloseDesktop(hLockedDesktop);

See Desktops @ MSDN

Have fun!
BoB
Reply With Quote
  #17  
Old 09-03-2013, 10:41
ontryit ontryit is offline
Friend
 
Join Date: Nov 2011
Posts: 172
Rept. Given: 127
Rept. Rcvd 17 Times in 14 Posts
Thanks Given: 411
Thanks Rcvd at 70 Times in 43 Posts
ontryit Reputation: 17
Quote:
Originally Posted by wilson bibe View Post
Private Type NOTIFYICONDATA
cbSize As Long
hWnd As Long
uId As Long
uFlags As Long
ucallbackMessage As Long
hIcon As Long
szTip As String * 64
End Type
Private Const NIM_DELETE = &H2
Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Sub Form_Load()
Dim tskWin As Long
Dim t As NOTIFYICONDATA
Shell "taskmgr.exe", vbHide
Do Until tskWin <> 0
tskWin = FindWindow("#32770", "the name of window of takmager.exe in your language")
Loop
t.hWnd = tskWin
Shell_NotifyIcon NIM_DELETE, t
End Sub

Create an .dll file with this code, call it by inserting a code in the code cave of your app, work in all the files that I develope to sell when I need to lock the sequence crtl+alt+del.
*you don't need admin previlegies to run it
**translate this code to the language that you used in your app
BR
This isn't real solution to disable ctrl+alt+del keys but only hidden the "taskmgr.exe" from shown. This will only affect on xp but not on w7 when the ctrl+alt+del key was pressed.

Alternate way just like your code do, you can also do this:

Code:
Open "C:\Windows\System32\Taskmgr.exe" For Input Lock Read Write As #1
Reply With Quote
  #18  
Old 09-03-2013, 10:49
ontryit ontryit is offline
Friend
 
Join Date: Nov 2011
Posts: 172
Rept. Given: 127
Rept. Rcvd 17 Times in 14 Posts
Thanks Given: 411
Thanks Rcvd at 70 Times in 43 Posts
ontryit Reputation: 17
Quote:
Originally Posted by BoB View Post
Hi, you can create a new desktop object, which avoids Alt + Tab, Ctrl + Alt + Del ..

Code:
hOldThreadDesktop := GetThreadDesktop(GetCurrentThreadId);
hOldInputDesktop := OpenInputDesktop(0, FALSE, DESKTOP_CREATEWINDOW + DESKTOP_SWITCHDESKTOP);
hLockedDesktop := CreateDesktop('LockedDesktop', nil, nil, 0, DESKTOP_CREATEWINDOW + DESKTOP_SWITCHDESKTOP, nil);
SetThreadDesktop(hLockedDesktop);
SwitchDesktop(hLockedDesktop);
..Then run your application within that new desktop ..

Code:
SI.cb := SizeOf(StartupInfo);
SI.lpDesktop := PChar('LockedDesktop');
If CreateProcess(nil, 'YourApp.exe', nil, nil, True, 0, nil, nil, SI, PI) Then
  WaitForSingleObject(PI.hProcess, INFINITE);
..And when your app exits, return to 'real' desktop ..

Code:
if hOldInputDesktop <> 0 then SwitchDesktop(hOldInputDesktop);
if hOldThreadDesktop <> 0 then SetThreadDesktop(hOldThreadDesktop);
if hLockedDesktop <> 0 then CloseDesktop(hLockedDesktop);

See Desktops @ MSDN

Have fun!
BoB
This solution was recommended by Microsoft but only for XP, you need to add a code to avoid taskmgr from shown on the default desktop when the the ctrl+alt+del/ctrl+shift+esc keys was pressed on xp in order to not make it suspiously looking. on W7 this solution can't be disable ctrl+alt+del keys
Reply With Quote
  #19  
Old 09-03-2013, 11:47
wilson bibe wilson bibe is offline
VIP
 
Join Date: Nov 2012
Posts: 492
Rept. Given: 489
Rept. Rcvd 439 Times in 180 Posts
Thanks Given: 859
Thanks Rcvd at 176 Times in 112 Posts
wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499
@ontryit
Did You really see the code?

Quote:
Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
You wrote Open "C:\Windows\System32\Taskmgr.exe" For Input Lock Read Write As #1, for what this instruction? I believe that you wanted to write
Quote:
Open "C:\Windows\System32\Taskmgr.exe" For Random As #1
useless too, Maybe you need to study a little more about VB6. I work with this language a long time :-), If this dll file works or not in another OS except XP, really I don't know because I lock all my apps to another versions of windows, obvious using VB6 too ok?
BR
Reply With Quote
  #20  
Old 09-06-2013, 13:38
ontryit ontryit is offline
Friend
 
Join Date: Nov 2011
Posts: 172
Rept. Given: 127
Rept. Rcvd 17 Times in 14 Posts
Thanks Given: 411
Thanks Rcvd at 70 Times in 43 Posts
ontryit Reputation: 17
wilson bibe: sorry, i not an expert on vb but i know how your code works, its only run hidden the taskmgr.exe and delete the icon on the systray. But with this methode, you are not really disable ctl+alt+del keys (i mean, if you have some code that will BlockInput, it will be free when these keys was pressed - http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx)

The real way to disable these keys on XP was replaced msgina.dll with your own or hook the SAS Window (undocumented) but on Vista above there are another way that i was not found yet .
Reply With Quote
  #21  
Old 09-06-2013, 19:52
wilson bibe wilson bibe is offline
VIP
 
Join Date: Nov 2012
Posts: 492
Rept. Given: 489
Rept. Rcvd 439 Times in 180 Posts
Thanks Given: 859
Thanks Rcvd at 176 Times in 112 Posts
wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499
@ontryit
No need "sorry" mate, believe the code works, I use it there are 05 years, always in the code cave.
All the best
Reply With Quote
The Following User Gave Reputation+1 to wilson bibe For This Useful Post:
ontryit (09-06-2013)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to disable VM detection? te$ter General Discussion 3 05-16-2015 17:06
Origins of Ctrl-Alt-Del Anticode General Discussion 0 04-17-2005 20:16
Why?the kb is disable 3boy General Discussion 1 09-03-2003 20:22


All times are GMT +8. The time now is 22:37.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )