Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hidden application 1

Status
Not open for further replies.

Alt255

Programmer
May 14, 1999
1,846
US
I'm developing an app that must remain hidden (most of the time). I'm hiding it from the task-list with:<br><br>OwnerhWnd = GetWindow(Me.hwnd, GW_OWNER)<br>ret = ShowWindow(OwnerhWnd, SW_HIDE)<br><br>How can I prevent it from showing up in the Close Program Window (Ctrl+Alt+Del)?<br><br>Any ideas will be appreciated.<br><br> <p> <br><a href=mailto: > </a><br><a href= temporary Vorpalcom home page</a><br>Send me suggestions or comments on my current software project.
 
P.S. <b>without</b> disabling Ctrl+Alt+Del. I want the users to be able to close errant apps.... just not <b>mine</b>. <p> <br><a href=mailto: > </a><br><a href= temporary Vorpalcom home page</a><br>Send me suggestions or comments on my current software project.
 
'Add a module to your project (In the menu choose Project -&gt; Add Module, Then click Open)<br>'Insert 2 CommandButtons to your form (named Command1 and Command2)<br>'When you will press the first button, you will disable the Ctrl-Alt-Del <br>'and when you will press the second button you will enable the Ctrl-Alt-Del<br><br>'Insert this code to the module :<br><br>Declare Function SystemParametersInfo Lib &quot;user32&quot; Alias _<br>&quot;SystemParametersInfoA&quot; (ByVal uAction As Long, ByVal uParam As Long, _&nbsp;&nbsp;<br>ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long<br><br>'Insert this code to your form:<br><br>Sub DisableCtrlAltDelete(bDisabled As Boolean)<br>Dim x As Long<br>x = SystemParametersInfo(97, bDisabled, CStr(1), 0)<br>End Sub<br><br>Private Sub Command2_Click()<br>DisableCtrlAltDelete (False)<br>End Sub<br><br>Private Sub Command1_Click()<br>DisableCtrlAltDelete (True)<br>End Sub<br><br> <p>Eric De Decker<br><a href=mailto:vbg.be@vbgroup.nl>vbg.be@vbgroup.nl</a><br><a href= Visual Basic Forum</a><br>
 
Eric, I really don't want to disable Ctrl+Alt+Del. I had hoped to find a way to hide the app from the &quot;Close Program&quot; window. Thanks for the reply.<br> <p> <br><a href=mailto: > </a><br><a href= temporary Vorpalcom home page</a><br>Send me suggestions or comments on my current software project.
 
Alt255 -<br><br>What if you made your app an Active-X executable?&nbsp;&nbsp;They show up under the NT task list, but I don't think they do under Win9x<br><br>Chip H.<br><br><br><br>
 
Thanks, Chip. I'll check it out.<br> <p> <br><a href=mailto: > </a><br><a href= temporary Vorpalcom home page</a><br>Send me suggestions or comments on my current software project.
 
No luck. It still shows up with the application title. Thanks for trying.<br><br>I know this can be done. Anybody have another suggestion? <p> <br><a href=mailto: > </a><br><a href= temporary Vorpalcom home page</a><br>Send me suggestions or comments on my current software project.
 
Okay, I think I've got it.<br><br>Private Declare Function GetCurrentProcessId Lib_ &quot;kernel32&quot; () As Long<br>Private Declare Function RegisterServiceProcess Lib_ &quot;kernel32&quot; (ByVal dwProcessID As Long, ByVal dwType As Long) As Long<br><br>Private Sub Form_Load()<br>Dim Gcpi As Long<br>Dim Ret As Long<br>Gcpi = GetCurrentProcessId()<br>Ret = RegisterServiceProcess(Gcpi, 1)<br>End Sub<br><br>This seems to work pretty well with Win98 (haven't tried the others). <p> <br><a href=mailto: > </a><br><a href= temporary Vorpalcom home page</a><br>Send me suggestions or comments on my current software project.
 
Now I feel really foolish. It's bad enough that I followed my own post with three more posts... now I discover that App.TaskVisible = False performs the same basic function without using the API.<br><br>Eric and Chip, feel free to kick me. <p> <br><a href=mailto: > </a><br><a href= temporary Vorpalcom home page</a><br>Send me suggestions or comments on my current software project.
 
LOL! That's not like you Alt! Finding a simple and elegant way of doing something. &lt;grin&gt;<br><br>Mike <p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
I'll accept a kick from you too, Mike. Why didn't somebody tell me I was chasing my own nose? :O<br> <p> <br><a href=mailto: > </a><br><a href= temporary Vorpalcom home page</a><br>Send me suggestions or comments on my current software project.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top