Solved

Uncloseable Window

Posted on 2002-05-07
5
183 Views
Last Modified: 2012-06-27
Hi there, basically, I would like some code that will stop my app from closing. On RM networks, it closes any applications that are not meant to be running when you log off the network and i want my program to keep running.

thanks for your help, Jack.
0
Comment
Question by:Portal111
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6994485
Please maintain your open questions:

Hiding Objects Date: 07/13/2001 10:20AM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=flash&qid=20150504
Getting Process Icons Date: 01/07/2002 11:30PM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20252540
Using The Tint Command / If There is One Date: 12/05/2001 10:18AM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=javascript&qid=20243976

Thanks,
Anthony
0
 
LVL 22

Expert Comment

by:cookre
ID: 6995461
Here's a snippet that references a largely undocumented API call that let's the caller survive a logoff.  This is one of the tings I do to simulate services on 95.

Yes, I know it's not not VB, but the switch to VB should go pretty easy.

Kernel32=GetModuleHandle("KERNEL32.DLL");
if (Kernel32==NULL)
   {
   PostMsg("Unable to get KERNEL32.DLL");
   DestroyWindow(hWnd);
   return 0;
   }

RegisterServiceProcess=(ExRegSrvProc)GetProcAddress(Kernel32,"RegisterServiceProcess");
if (RegisterServiceProcess==NULL)
   {
   PostMsg("RegisterServiceProcess entry point not found in KERNEL32");
   DestroyWindow(hWnd);
   return 0;
   }
if (1!=RegisterServiceProcess(GetCurrentProcessId(),1))
   {
   PostMsg("Unable to register service");
   DestroyWindow(hWnd);
   return 0;
   }
0
 
LVL 22

Accepted Solution

by:
cookre earned 200 total points
ID: 6995465
Here's one link of many to VB samples:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1012&lngWId=-10

Do a search on 'registerserviceprocess 95 vb' to see all of them.  

Note that not only does the process survive a logoff, it doesn't show up in the ctrl-alt-delete task list either.
0
 
LVL 3

Expert Comment

by:n_narayanan
ID: 6996297
In your form query unload event

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
cancel = true
End Sub
0
 

Author Comment

by:Portal111
ID: 7610047
Nice1, thanks! sorry for the really really slow response. Jack
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adding to a VBA? 6 90
Modifying Conditional Format from VBA code 3 80
Sub or Function is not defined 6 59
VBA: copy range dynamically based on config sheet v2 3 59
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question