Re: Hide process in Win2K/NT/XPreply 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/XPreply 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!
|