swdev
swdev

Reputation: 5157

What is the minimum functionality needed to create Shell Replacement for Windows?

As you know we can change Windows Shell by changing Shell key in HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon

I create simple AutoHotKey script, compile it to cgywin.exe, and implement the basic WIN+R, WIN+E etc. What I targeted is a windows environment where there is no taskbar, a fullscreen Cygwin Console and emacs inside it. I found that simple AutoHotkey suffice me

Here is the AutoHotKey script (compiled to cygwin.exe)


Run C:\Development\Tools\Cygwin\Cygwin.bat,,max
Run C:\Development\Tools\Fun\xeyes.exe
run c:\Program Files\Digsby\digsby.exe
#h::
    run rundll32.exe powrprof.dll,SetSuspendState Hibernate
    return
#w::
    ifWinExist "@Gameloft:)"
    {
        WinActivate
    }else{  
        run e:\Data\vs.net\At Gameloft\At Gameloft\At Gameloft\bin\Release\At Gameloft.exe
        WinWait "@Gameloft:)"
        WinActivate
    }
    return
#y::
    run c:\Program Files\Digsby\digsby.exe
    return
#f::
    run firefox
    return
#t::
        run thunderbird
        return
#c::
        Run C:\Development\Tools\Cygwin\Cygwin.bat,,max
    return
#r::
    DllCall(DllCall("GetProcAddress", "Uint", DllCall("GetModuleHandle", "str", "shell32"), "Uint", 61), "Uint", 0, "Uint", 0, "Uint", 0, "Uint", 0, "Uint", 0, "Uint", 0)
    return
#g::
    run chrome
    return
#e::
    run c:\Program Files\zabkat\xplorer2_lite\xplorer2_lite.exe
    return
#^e::
    run explorer
    return
#d::
    WinSet, Style, -0xC00000, A
    WinMaximize, A
    return

But I realize that certain shell function is missing. Such as when I download using Chrome, I can' use "Open Folder" menu for the downloaded file. It seems like somehow the shell provide those functionality.

What is the most basic stuff that must be implemented to create a suffice Shell Replacement??

Thank you!

Upvotes: 1

Views: 841

Answers (2)

casablanca
casablanca

Reputation: 70721

Technically, there is no "required" functionality for a shell -- you don't need anything at all (but of course, such a shell wouldn't serve any useful purpose).

In practice, you will sometimes encounter problems (as you did) when you replace the shell entirely. This is due to the fact that the default shell (explorer.exe) is the same process that also manifests itself as Windows Explorer. Depending on what API calls Chrome uses, it might fail to open a folder window because there is no running instance of explorer.exe.

For this reason, most shell replacements today don't really "replace" the default shell, but they run on top of explorer.exe, but hide the desktop and/or taskbar and instead present their own interface.

Upvotes: 1

Lazlo
Lazlo

Reputation: 8790

What you describe is the phenomenon that no process is associated to the default protocol of a simple filename or path. For example, Chrome probably tries to start C:\Users\You\Downloads as a process. However, since you replaced the default shell, no executable is associated with that behavior.

I am unaware whether AutoHotKey can handle plain arguments passed it, however.

Upvotes: 1

Related Questions