Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3670
Number of posts: 9122

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Edit Report
Hiding an application from the ctrl-alt-del list. Posted by Kristian LM on 5 Dec 2000 at 9:55 AM
Hi<br>
<br>
I've now tried to work out how to hide the application from the ctrl-alt-del list in the "Close Program" dialog box.<br>
<br>
I tried specifiing the WS_EX_TOOLWINDOW in XCreateWindowEx, but it didn't hide it from the task-list on the ctrl-alt-del bialog. (that would only work with win95)<br>
<br>
I tried some stuff with RegisterServiceProcess() but i couldn't get that to compile (undeclared identifier)<br>
<br>
I hope that there is an easy way of getting the appllication totally hidden from any lists in win98. I know it sounds all like im making a trojan, but i just want to protect my computer from my sister.<br>
<br>
Thank you. KLM


Edit Report
Re: Hiding an application from the ctrl-alt-del list. Posted by iDaZe on 5 Dec 2000 at 3:52 PM
You should use RegisterServiceProcess,<br>
in Delphi it looks like this:<br>
<br>
function RegisterServiceProcess (dwProcessID, dwType: DWord) : DWord;<br>
stdcall; external 'KERNEL32.DLL';<br>
<br>
procedure TForm1.Button1Click(Sender: TObject);<br>
begin<br>
// Hide the program from taskmanager:<br>
RegisterServiceProcess(GetCurrentProcessID,1);<br>
end;<br>
<br>
procedure TForm1.Button2Click(Sender: TObject);<br>
begin<br>
// Show the program to taskmanager:<br>
RegisterServiceProcess(GetCurrentProcessID,0);<br>
end;<br>
<br>
<br>
Should be translated to any other language easily enough ;)<br>
<br>
: Hi<br>
: <br>
: I've now tried to work out how to hide the application from the ctrl-alt-del list in the "Close Program" dialog box.<br>
: <br>
: I tried specifiing the WS_EX_TOOLWINDOW in XCreateWindowEx, but it didn't hide it from the task-list on the ctrl-alt-del bialog. (that would only work with win95)<br>
: <br>
: I tried some stuff with RegisterServiceProcess() but i couldn't get that to compile (undeclared identifier)<br>
: <br>
: I hope that there is an easy way of getting the appllication totally hidden from any lists in win98. I know it sounds all like im making a trojan, but i just want to protect my computer from my sister.<br>
: <br>
: Thank you. KLM<br>
: <br>
<br>



Edit Report
can find RegisterServiceProcess Posted by Kristian LM on 6 Dec 2000 at 7:18 AM
Thank you for leading me on the right track,<br>
but i can't find that function in VC++.<br>
<br>
Is there an #include file for it?<br>
Is it in kernel32.dll?<br>
<br>
<br>
Thank you<br>
KLM<br>



Edit Report
Re: can find RegisterServiceProcess Posted by Green Flame on 7 Dec 2000 at 3:49 PM
Ok, here's a function you can use in VC++ 6. Just call 'reg(TRUE);' at the top of WinMain (like, as the first line). Call 'reg(FALSE);' when you handle your WM_DESTROY message. The 3 lines below are to be placed right under any headers you have included. (If this source turns into a mess, I've added a URL where you can download a zipped reg.cpp file).<br>
<br>
bool registered;<br>
typedef DWORD (WINAPI *TRegisterServiceProcess)(DWORD,DWORD);<br>
<br>
void __fastcall reg(bool which)<br>
{<br>
HMODULE hmod;<br>
TRegisterServiceProcess pReg;<br>
hmod = LoadLibrary("kernel32.dll");<br>
<br>
if (!hmod)<br>
return;<br>
<br>
pReg = (TRegisterServiceProcess)::GetProcAddress(hmod,"RegisterServiceProcess");<br>
<br>
if (!pReg) {<br>
FreeLibrary(hmod);<br>
return;<br>
}<br>
else {<br>
if (which)<br>
pReg(0,1); //unregister our process<br>
else<br>
pReg(0,0);<br>
}<br>
registered = true;<br>
FreeLibrary(hmod);<br>
}<br>
<br>
: Thank you for leading me on the right track,<br>
: but i can't find that function in VC++.<br>
: <br>
: Is there an #include file for it?<br>
: Is it in kernel32.dll?<br>
: <br>
: <br>
: Thank you<br>
: KLM<br>
: <br>
: <br>
<br>



URL:http://www.flinthill.net/tnt/misc/vregcpp.zip

Edit Report
Re: Hiding an application from the ctrl-alt-del list. Posted by Sephiroth2 on 17 Dec 2000 at 3:17 PM
To call RegisterServiceProcess, retrieve a function pointer using GetProcAddress on KERNEL32.DLL. Use the function pointer to call RegisterServiceProcess. <br>
<br>
<br>






 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.