[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Turn an exe into a shell

Posted on 1998-09-21
6
Medium Priority
?
375 Views
Last Modified: 2010-04-06
I'm writing a machine control app, that runs under NT.  As it's a dedicated app, I'd like to stop the user getting at anything other than the app.  Therefore I'd like to write it as a shell for NT.

The question is, how?

It's currently a working Exe, with no required DLLs.
0
Comment
Question by:bcrotaz
[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
  • 2
  • 2
  • 2
6 Comments
 
LVL 20

Expert Comment

by:Madshi
ID: 1340462
In win95 you would have to change "c:\windows\system.ini\[boot]\shell=Explorer.Exe" to "...\shell=c:\YourAppsPath\YourApp.exe".
AFAIK, in winNT the "system.ini" is mirrored in the registry. So please look if you find the corresponding entries in the registry. But I don't know if it works - you'll have to try it.
If it works, your application is just started instead of "explorer.exe", which is responsible for drawing the desktop icons and the taskbar and ...
So I think that would be exactly what you need. The only thing - as I said before - I don't know if it works with winNT as well.

Regards, Madshi.
0
 
LVL 1

Author Comment

by:bcrotaz
ID: 1340463
Anyone else - are there any things you need to do in the exe to support being a shell in NT?

Setting the shell to notepad.exe seems to still bring up explorer....
0
 
LVL 1

Accepted Solution

by:
wamoz earned 400 total points
ID: 1340464
According to MSDN, you can indeed replace the shell on Windows NT. Note from the references to Program Manager that this information was written with reference to WinNT 3.x

Excerpted from MSDN:

Replacing the Shell (Program Manager)
Last reviewed: November 2, 1995
Article ID: Q100328  
The information in this article applies to:
Microsoft Win32 Application Programming Interface (API) included with:


    - Microsoft Windows NT versions 3.1, 3.5, and 3.51



SUMMARY
To replace the current shell, change the following registry key:


   HKEY_LOCAL_MACHINE\
      SOFTWARE\
      Microsoft\
      Windows NT\
      CurrentVersion\
      Winlogon\
      Shell

Note that Program Manager combines the functionality of Program Manager and Task Manager (the Task Manager installed is not actually run). Therefore, you must take this into account. In Windows NT 3.1, if the new shell does not replace the Task Manager functionality, the replacement string should contain both the new shell name and TASKMAN.EXE, separated by commas. In Windows NT 3.5, the new shell should either spawn TASKMAN.EXE or your own task manager, specified in

   HKEY_LOCAL_MACHINE\
      SOFTWARE\
      Microsoft\
      Windows NT\
      CurrentVersion\
      Winlogon\
      Taskman

The value does not exist by default, it must be added. The value type is REG_SZ.
To update the string that is retrieved when you call GetPrivateProfileString(), change the string in the following registry key:


   HKEY_LOCAL_MACHINE\
      SOFTWARE\
      MICROSOFT\
      Windows NT\
      Current Version\
      WOW\
      Boot\
      Shell

The duplicate entry is for compatibility with Windows 3.1.  

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:bcrotaz
ID: 1340465
With a bit of tweaking for NT4, it worked!
0
 
LVL 1

Expert Comment

by:wamoz
ID: 1340466
I also found the following information. Once again there is no clear indication of what version of Windows is described, however, in this case it is at least clear that it applies to Win32. Most of the information I found on this topic applied to Win16. It appears that the sample given shuts down progman.exe and runs explorer.exe in its stead. I suppose you could try shutting down explorer.exe and running your own shell.

For god's sake don't do this to your primary development machine, you could easily toast it completely messing about with shell replacements.

Once again, excerpted from MSDN...

How to Restart the Windows Shell Programmatically
Last reviewed: October 2, 1995
Article ID: Q137572  
The information in this article applies to:
Microsoft Win32 Software Development Kit (SDK) version 4.0


SUMMARY
Creating and updating shell extensions in Windows requires that the shell be restarted. This may be accomplished by having the user manually perform this task; however, in many cases, you may find it is better to do it programmatically.



MORE INFORMATION
To restart the shell programmatically, find the shell window, post it a quit message, and then call WinExec() with explorer.exe. For Example:



   HWND hwndShell = FindWindow("Progman", NULL);
   PostMessage(hwndShell, WM_QUIT, 0, 0L);
   WinExec("Explorer.exe",SW_SHOW);

 

0
 
LVL 20

Expert Comment

by:Madshi
ID: 1340467
wamoz,

the stuff in your last comment is about shell extensions like ContextMenu shell extensions or CopyHookHandlers or PropertySheetHandlers or DragDropHandlers, not about changing the whole shell itself...
But your answer is quite well.  :-)

Regards, Madshi.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

649 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