PDA

Click to See Complete Forum and Search --> : after start before close? possible?


nihar
Feb 9th, 2002, 01:48 AM
Hi!!

I would want to know how to write api code, to make my application start before the windows shell is shown to the users. And once the application is done with then either shutdown the system or proceed with the shell.

If i were able to do this will it create a problem with the library files available to my program such as general windows dlls or other dlls of my program?

I am doing this as I do not the user to execute any other program for security reasons.

I have seen a couple of setup programs run in similar manner ie., they are loaded after windows starts but the windows shell the start menu, desktop etc are not shown. after the programs done with its stuff then it proceeds to shutdown the system.

Please please help me with this.
Thanx a ton in advance.
Nihar.
:)

lord_dude
Feb 9th, 2002, 07:11 AM
The way you would normally start programs before the windows shell is putting an entry in the registry in:

hkeylocalmachine\software\microsoft\windows\currentversion\runservices


however, in this case that wont work because when you use this method, the windows shell will be loaded straigh afterwards, and it wont give your program long to do what it needs to do. The only other way i can think of for doing this is make your program change the line in the system.ini file that says shell=explorer.exe to the name of your program. Then when your done, change it back and run

shell "explorer.exe"

If you dont change it back before running explorer.exe instead of the shell you will get windows explorer loading. Also you need to make sure when you are changing the system.ini, that you use the api functions or you will have problems (getprivateprofilestring etc).

http://www.vbsquare.com/files/iniclass/



As for the shuting down, you need the ExitWindowsEx function:
http://www.vbapi.com/ref/e/exitwindowsex.html


Back up your system.ini file before messing with it and make sure u have a dos boot disk!!!


i take no responsibility if you mess your pc up by messing up yuor system.ini.