Solved

shell & explorer.exe

Posted on 2000-03-26
8
507 Views
Last Modified: 2010-08-05
I'm creating a program to limit the time my younger siblings spend each day on my computer.
I've created a login screen, and then I changed the SYSTEM.INI file so that "Shell" points to this
program.  This works fine, but when the correct password is entered, I want the program to run explorer.exe as a
shell.  Right now when I run explorer.exe, he just pops up like Windows Explorer, i.e no taskbar/startmenu & desktop visible.

Is it possible to run explorer.exe as a shell from within my program?


Another question,  I know that you can disable various things, like the desktop, control panel and start menu to
name a few ...  I've seen some tweak utility that did this.  How is this done?  It's somewhere in the registry, right?


Thanks,

Hagur
0
Comment
Question by:hagur
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 21

Expert Comment

by:gemarti
ID: 2658426
Why don't you use user profiles instead of trying to recreate the wheel? I mean with user profiles you can set windows up so that whoever is logged on only sees what you want them to see. Then if you want to also have a timer program that will shut down windows after a certain period of time you can create this program with the appropriate code and place it in the registry to run on startup for this specific user.

This would seem to be a easier solution.

0
 
LVL 15

Expert Comment

by:simonet
ID: 2658432
Once the default shell has been loaded, you cannot load (change) another shell.

Alex
0
 
LVL 10

Expert Comment

by:Lischke
ID: 2659975
My son is still too young to know what I'm actually doing on my computer but soon I have to care about this. And I already came to the conclusion that a simple DOS extension like Win9x doesn't provide the security I need. I know it is cheaper than OSes like WinNT but you will never need to think again about usual security with the latter. This might also be important if your machine is connected to Internet, as my little home network. I have two machines both running W2K and I simply cannot afford to open holes in my privacy (not only what my son sees, this would only be a small part of the problem, but what others may see).

Just my $0.02 and not thought as answer to this question here :-)

Ciao, Mike
0
 
LVL 20

Expert Comment

by:Madshi
ID: 2660249
Just change the Shell setting back to "Explorer.Exe" before starting the explorer.

  WritePrivateProfileString(...);  // restore Explorer as cache
  WritePrivateProfileString(nil, nil, nil, ...);  // flush ini
  ShellExecute(...);  // start explorer

Most policies are under "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies". The best way to find the correct keys is to use PolEdit and then look at the registry in the Policies key.

Regards, Madshi.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 3

Author Comment

by:hagur
ID: 2660307
That's interesting Madshi ...

WritePrivateProfileString() where ?
In the registry?

Could you please be a little more specific?
0
 
LVL 21

Expert Comment

by:gemarti
ID: 2661639
Here's the syntax for WritePrivateProfileString()

WritePrivateProfileString(
  lpAppName:PChar;     {pointer to section name}
  lpKeyName:PChar;     {pointer to key name}
  lpString:PChar;      {pointer to string}
  lpFileName:PChar;    {pointer to initialization filename}
);BOOL;                {Returns TRUE or FALSE}

This function sets the string value for the specified reistry key in the specified section of a private user defined initialization file. The function can also create sections inside the initialization file.


I think you still need to setup the user profiles as I suggested, otherwise you will find nothing in the KEY that Madshi suggests.
0
 
LVL 20

Accepted Solution

by:
Madshi earned 100 total points
ID: 2661898
Hagur, you said this:

>> I've created a login screen, and then I changed the SYSTEM.INI file so that "Shell" points to this
program.

So I thought you would know how to use WritePrivateProfileString...   :-)

  WritePrivateProfileString('Boot', 'Shell', 'Explorer.Exe', 'system.ini');
  WritePrivateProfileString(nil, nil, nil, 'system.ini');

Regards, Madshi.

P.S: I don't have user profiles on my machine. It works without, too.
0
 
LVL 3

Author Comment

by:hagur
ID: 2663592
I'll have to accept Madshi's answer, what he said works exactly like I needed it to,  also without user profiles.

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now