I have been searching high and low and cant find any examples of a basic C# shell replacement. Anyone seen one?
Printable View
I have been searching high and low and cant find any examples of a basic C# shell replacement. Anyone seen one?
Shell, as in the Shell Command?
Sorry I wasnt more clear. An explorer replacement, not a cmd replacment. :)
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.Quote:
Originally Posted by kasracer
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.
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
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.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.Quote:
Originally Posted by kasracer
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.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... hehQuote:
Originally Posted by BrandonTurner
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.Quote:
Originally Posted by BrandonTurner
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.
yes, awkard, but i think they do it out of speed.Quote:
Originally Posted by kasracer
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.Quote:
Originally Posted by kasracer
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.Quote:
Originally Posted by BrandonTurner
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).
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