Results 1 to 11 of 11

Thread: [RESOLVED] C# Shell Replacment

  1. #1

    Thread Starter
    Hyperactive Member BrandonTurner's Avatar
    Join Date
    Sep 2001
    Location
    East Lansing, Michiagn
    Posts
    268

    Resolved [RESOLVED] C# Shell Replacment

    I have been searching high and low and cant find any examples of a basic C# shell replacement. Anyone seen one?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: C# Shell Replacment

    Shell, as in the Shell Command?

  3. #3

    Thread Starter
    Hyperactive Member BrandonTurner's Avatar
    Join Date
    Sep 2001
    Location
    East Lansing, Michiagn
    Posts
    268

    Re: C# Shell Replacment

    Sorry I wasnt more clear. An explorer replacement, not a cmd replacment.

  4. #4
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: C# Shell Replacment

    Just kill the explorer process and replace it with your executable. It doesn't have to browse files either.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  5. #5

    Thread Starter
    Hyperactive Member BrandonTurner's Avatar
    Join Date
    Sep 2001
    Location
    East Lansing, Michiagn
    Posts
    268

    Re: C# Shell Replacment

    Quote Originally Posted by kasracer
    Just kill the explorer process and replace it with your executable. It doesn't have to browse files either.
    I know... but I want an example of one that actually talks with win32k.sys. For example, when I make a taskbar in my program, I dont want apps to maximize over top of it(assuming mine is bigger then explorers). And I want to see how another makes their system tray that will interact other applications.

    And as a side note, killing explorer is not the best way to go about it, acutally closing benfits you much more as it clears all the stuff win32k is caching and allows you to take more control.

  6. #6
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: C# Shell Replacment

    Quote Originally Posted by BrandonTurner
    I know... but I want an example of one that actually talks with win32k.sys. For example, when I make a taskbar in my program, I dont want apps to maximize over top of it(assuming mine is bigger then explorers). And I want to see how another makes their system tray that will interact other applications.
    Well, you can make your own Taskbar and just had it show the running programs. Then use the Win32 API to get all the open windows and make sure they're not over your task bar (and resize them if they are).
    Quote Originally Posted by BrandonTurner
    And as a side note, killing explorer is not the best way to go about it, acutally closing benfits you much more as it clears all the stuff win32k is caching and allows you to take more control.
    You can't just "close" explorer. The only way to make it stop running is to end its process or change the path of the shell in the registry and restart the system.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  7. #7

    Thread Starter
    Hyperactive Member BrandonTurner's Avatar
    Join Date
    Sep 2001
    Location
    East Lansing, Michiagn
    Posts
    268

    Re: C# Shell Replacment

    Quote Originally Posted by kasracer
    Well, you can make your own Taskbar and just had it show the running programs. Then use the Win32 API to get all the open windows and make sure they're not over your task bar (and resize them if they are).
    Lol, that would horrible to keep checking for that. There is a way using win32 api to tell win32k.sys what size your tool bar is so that it knows how big to make the windows when they are max. That is one of the many reasons I want to see a basic example so i can get a feel for these API.

    Quote Originally Posted by kasracer
    You can't just "close" explorer. The only way to make it stop running is to end its process or change the path of the shell in the registry and restart the system.
    Now, you should check your facts first. click start -> shutdown, then hold down shift, ctrl, and alt and hit cancel. and there you go, explorer closed down itself and cleared any settings it had told win32k, along with many other things that dont happen when you just kill it.

  8. #8
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: C# Shell Replacment

    Quote Originally Posted by BrandonTurner
    Lol, that would horrible to keep checking for that. There is a way using win32 api to tell win32k.sys what size your tool bar is so that it knows how big to make the windows when they are max. That is one of the many reasons I want to see a basic example so i can get a feel for these API.
    Well I wasn't even aware win32k.sys had GUI level methods (it operates in kernel space). I found this site which seems to have a list of its calls. Odd they would put GUI code in kernel space... heh
    Quote Originally Posted by BrandonTurner
    Now, you should check your facts first. click start -> shutdown, then hold down shift, ctrl, and alt and hit cancel. and there you go, explorer closed down itself and cleared any settings it had told win32k, along with many other things that dont happen when you just kill it.
    This feature was added in Windows 95 and was only provided as an easy way to close Explorer. It was mainly used for testing plugins.

    It's not going to matter if you kill it or use this method. They do almost the samething.

    Also, as far as I can tell, win32k.sys provides an interface for making system calls and it does not hold any settings for explorer or any other app.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  9. #9

    Thread Starter
    Hyperactive Member BrandonTurner's Avatar
    Join Date
    Sep 2001
    Location
    East Lansing, Michiagn
    Posts
    268

    Re: C# Shell Replacment

    Quote Originally Posted by kasracer
    Well I wasn't even aware win32k.sys had GUI level methods (it operates in kernel space). I found this site which seems to have a list of its calls. Odd they would put GUI code in kernel space... heh
    yes, awkard, but i think they do it out of speed.

    Quote Originally Posted by kasracer
    This feature was added in Windows 95 and was only provided as an easy way to close Explorer. It was mainly used for testing plugins.

    It's not going to matter if you kill it or use this method. They do almost the samething.

    Also, as far as I can tell, win32k.sys provides an interface for making system calls and it does not hold any settings for explorer or any other app.
    They are different. For example, kill explorer and open notpad and maxmize it. it will not fill the whole screen, it leaves room for the old taskbar. now "close" it using my method and it when you maxmize it, notepad will fill the whole screen.

  10. #10
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: C# Shell Replacment

    Quote Originally Posted by BrandonTurner
    They are different. For example, kill explorer and open notpad and maxmize it. it will not fill the whole screen, it leaves room for the old taskbar. now "close" it using my method and it when you maxmize it, notepad will fill the whole screen.
    Both the CONTROL + SHIFT + ALT at the shutdown screen and ending the Explorer process on both of my PCs yield the same result. Windows still behave correctly in relation to their size.

    One thing that doesn't work correctly no matter which method used is clicking on something in the taskbar to minimize or maximize it if it was open while explorer was shutdown.

    From my measurements, it seems to take the same amount of time to end the explorer process and to close it via your method so it doesn't appear as if it's making any calls when it's closing "the right way" unless it has just a few quick calls (normally, when clearing the cache from any application, there is significant disk activity but it appears to be the same no matter which way Explorer is closed).

    Anyway, we are going off topic. Maybe someone else will post that has more experience with using the win32k.sys (I don't even know how to use it; I don't think you can directly reference it).
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  11. #11

    Thread Starter
    Hyperactive Member BrandonTurner's Avatar
    Join Date
    Sep 2001
    Location
    East Lansing, Michiagn
    Posts
    268

    Re: C# Shell Replacment

    In general the API i was looking for SystemParametersInfo(), and I found an exmaple of it being used here: http://www.csharphelp.com/archives3/archive578.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width