forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Code Idea !!

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Wed Jun 11, 2003 10:34 am    Post subject: Code Idea !! Reply with quote

This code is for Visual Basic but maybe the idea or code could be adatpted to be used with VDS or a VDS compatible DLL.

Hide your program in the Task Manager on Windows 95,98,NT,ME,2000 and XP !

Code:
Hiding Your Program in the Ctrl-Alt-Del list

To do this, your must register your program as a service. This is done by passing the process ID of your application to the RegisterService API.

Declarations

Copy the following code into the declarations section of a module:

Public Declare Function GetCurrentProcessId _
Lib "kernel32" () As Long
Public Declare Function GetCurrentProcess _
Lib "kernel32" () As Long
Public Declare Function RegisterServiceProcess _
Lib "kernel32" (ByVal dwProcessID As Long, _
ByVal dwType As Long) As Long

Public Const RSP_SIMPLE_SERVICE = 1
Public Const RSP_UNREGISTER_SERVICE = 0Procedures

To remove your program from the Ctrl+Alt+Delete list, call the MakeMeService procedure:

Public Sub MakeMeService()
Dim pid As Long
Dim reserv As Long

pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End SubTo restore your application to the Ctrl+Alt+Delete list, call the UnMakeMeService procedure:

Public UnMakeMeService()
Dim pid As Long
Dim reserv As Long

pid = GetCurrentProcessId()
regserv = RegisterServiceProcess(pid, _
RSP_UNREGISTER_SERVICE)
'End CodeDon't forget to unregister your application as a service before it closes to free up system resources by calling UnMakeMeService.



Disable the Ctrl+Alt+Del keys in windows 95,98,ME,NT,2000,XP

Code:
Disabling Ctrl-Alt-Delete and Ctrl-Esc

It is often useful in Visual Basic programs to be able to disable the Ctrl-Alt-Delete key sequence. It is easily done by persuading Windows that a screen saver is running. This code also disables Ctrl-Esc, that is used to activate the Start Menu.

Declarations

Copy this code into the declarations section of your project.

Private Declare Function SystemParametersInfo Lib _
"user32" Alias "SystemParametersInfoA" (ByVal uAction _
As Long, ByVal uParam As Long, ByVal lpvParam As Any, _
ByVal fuWinIni As Long) As LongCode

Sub DisableCtrlAltDelete(bDisabled As Boolean)
    Dim X As Long
    X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
End Sub
Use

To disable Ctrl-Alt-Delete:

Call DisableCtrlAltDelete(True)

To enable Ctrl-Alt-Delete:

Call DisableCtrlAltDelete(False)


Nathanh
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Jun 11, 2003 2:21 pm    Post subject: Reply with quote

Interesting... maybe when VDS 5 comes out we can see if we can convert
it! Very Happy

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Thu Jun 12, 2003 3:30 pm    Post subject: Reply with quote

there is a dll that will hide vds programs from the task manager...i am using it for one of my programs...can't remember which dll though...ggrr!!

might be one of tommy's...

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Jun 12, 2003 4:14 pm    Post subject: Reply with quote

Hasn't somebody made an example of that by using the NOTITLE style? Or does that still show it in the task manager?
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Thu Jun 12, 2003 7:50 pm    Post subject: Reply with quote

Yes there are two DLL's
vdsprot.dll
sledge.dll

But both do not disable in Task Manager and Ctrl+Alt+Del

in Windows 2000,NT and XP

Nathan
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Jun 12, 2003 8:49 pm    Post subject: Reply with quote

It's not really the fault of the DLLs but with the Windows NT policies
you cannot disable CTRL+ALT+DEL easily. The most common way is to
rewrite the MSGINA.DLL (I think) to your own specifications.

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Thu Jun 12, 2003 10:28 pm    Post subject: Reply with quote

nathan,

you are right...the dll only works for win 95/98/me

skit,

even with no title, i think that it still shows in the task manager

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Alphonse
VDS Pirate
VDS Pirate


Joined: 27 Jan 2003
Posts: 11

PostPosted: Fri Jun 13, 2003 2:10 am    Post subject: Reply with quote

Here is a delphi code to disable CtrlAltSup for NT:

Code:

Procedure CtrlAltSup(Actif :boolean);
 var HK :HKey;
  begin
   if Actif then
     begin
      RegCreateKey(HKEY_CURRENT_USER,'Software\Microsoft\Windows\CurrentVersion\Policies\System',HK);
      RegDeleteValue(HK,'DisableTaskMgr');
      if HK <> 0 then RegCloseKey(HK);
     end
   else
     begin(HKEY_CURRENT_USER,'Software\Microsoft\Windows\CurrentVersion\Policies\System','DisableTaskMgr','1');

     RegOpenKey(HKEY_CURRENT_USER,PChar('Software\Microsoft\Windows\CurrentVersion\Policies\System'),HK);

    if HK = 0 then RegCreateKey(HKEY_CURRENT_USER,PChar('Software\Microsoft\Windows\CurrentVersion\Policies\System'),HK);

     RegSetValueEx(HK,PChar('DisableTaskMgr'),0, REG_SZ, Pchar(1),1);

     RegCloseKey(HK);
     end;
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Jun 13, 2003 2:41 pm    Post subject: Reply with quote

If I'm right, that code will add your program to a kind of 'invisible list' ? I don't know Delphi that good, but if it are only a few registry keys, it shouldn't be too difficult to change it into VDS code...
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Alphonse
VDS Pirate
VDS Pirate


Joined: 27 Jan 2003
Posts: 11

PostPosted: Fri Jun 13, 2003 7:30 pm    Post subject: Reply with quote

Yeah Skit

this code only disable ctrl alt sup for NT platforms.

here is the vds code:




Code:

Title CtrlAltSup
  DIALOG CREATE,CtrlAltSup,-1,0,395,118
  DIALOG ADD,TEXT,TEXT1,12,106,,,Disable Task Manager under NT Platforms
  DIALOG ADD,BUTTON,Disable,58,54,120,30,Disable
  DIALOG ADD,BUTTON,Enable,59,224,120,30,Enable
  DIALOG SHOW

:evloop
wait event
%e = @event()
goto %e


:DisableButton
   Registry Write,CURUSER,Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableTaskMgr,1
  goto evloop


:EnableButton
   Registry Delete,CURUSER,Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableTaskMgr
  goto evloop


:close
exit

Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Jun 13, 2003 7:57 pm    Post subject: Reply with quote

This is just a common registry technique that should not be relied upon
because anyone with access to the registry can override this setting.

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Sun Jun 15, 2003 8:45 pm    Post subject: Reply with quote

On all versions of NT (though maybe not Windows XP Home Edition), it's possible to set
permissions for individual registry keys. On NT you may have to use regedt32.exe for
this. As this could be done manually, there must be some way to automate the permission settings too. I'm just afraid that if you are an administrator,
setting the permissions may not work as they could probably be overriden.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group