THE ZEPINT NETWORK

programmer assist

Delphi Delphi XML Feeds

Delphi Questions Delphi Solutions Delphi Articles

A Rapid Application Development language from Borland International destination.

Hide process in Win2K/NT/XP

DiggBlinkRedditDeliciousTechnorati

question by srap | Hard

How do i can to hide my process in task manager? off course in Win2K/NT/XP platform.

Post reply Subscriptions

Re: Hide process in Win2K/NT/XP

reply by Srirangan

var
// Global OS vars
VersionInfo: TOSVersionInfo;
Platform: string;
MajorVersion,MinorVersion,Build: DWORD;

procedure GetOSVersion;
begin
VersionInfo.dwOSVersionInfoSize := SizeOf(VersionInfo);
GetVersionEx(VersionInfo);

with VersionInfo do
begin
case dwPlatformId of
VER_PLATFORM_WIN32s: Platform := '3.1';
VER_PLATFORM_WIN32_WINDOWS : Platform := '98';
VER_PLATFORM_WIN32_NT:
begin
Case dwMajorVersion of
5 : Platform := '2000/NT';
else
Platform := 'NT';
end;
if dwBuildNumber > = 2500 then Platform := 'XP'
end;
end;

MajorVersion := dwMajorVersion;
MinorVersion := dwMinorVersion;
Build := dwBuildNumber;
end;
end;

type
TReg = function (dwProcessID, dwType: DWord) : DWord;

var
RegisterServiceProcess: TReg;
begin

// Determine the operating system
GetOsVersion;

// Check to see if OS is 9x
if Platform = '98' then begin
Handle := LoadLibrary('KERNEL32.DLL');
if Handle <> 0 then begin
@RegisterServiceProcess := GetProcAddress(Handle, 'RegisterServiceProcess');
if @RegisterServiceProcess <> nil then
RegisterServiceProcess(GetCurrentProcessID, RSPSIMPLESERVICE);
end;
FreeLibrary(Handle);
end;
end;

Application.Initialize;
Application.Title:= '';


procedure HideMe();
begin
// Make sure the form is out of sight
form1.Left := 99999;
form1.Top := 99999;

// Make form dissapear
form1.Visible := false;
Application.Minimize;

// Hide window entirely (dissapears from task bar!)
ShowWindow(Application.Handle, SW_HIDE);
SetWindowLong(Application.Handle, GWL_EXSTYLE,
GetWindowLong(Application.Handle, GWL_EXSTYLE)
or WS_EX_TOOLWINDOW );
end;

Post reply Subscriptions

Re: Hide process in Win2K/NT/XP

reply by zohibshaikh

Hi!!

wel read u'r code but how should i appy it. can u please give me in details or step by step procedure abt this code

Please can u do it fast because have to complete my college project
Thanking u
zohib shaikh

Post reply Subscriptions

Got a Delphi Question?

Just Sign Up and ask the top Delphi experts!

Search via Google

User Login

Email Address

Password

Leading Experts

Rank Expert Points
#1 frankzzsword 4600
#2 Bejaan 2900
#3 csfreak 1100
#4 Anurag 700
#5 keyvez 700
#6 nnarasimha 600
#7 Nakata 600
#8 martinig 600
#9 mastercomputers 400
#10 Huntress 150
#11 Adkron 150
#12 Yogesh 100
#13 lexxwern 100
#14 Mustan Khan 100
#15 poizn 100
This is a list of overall best performing experts, how many points do you have?