Jump to content

AutoIt Desktop Shell


Recommended Posts

I started this a couple of months ago and figured that maybe others would like to contribute or just criticize whatever does it for you. ;) I'm having to start from scratch and re-research everything but if someone has some code to contribute or ideas please share them. Everyone else start coding like freaking crazy.

For those lost on the subject please lookup emerge desktop as some of it may be incorporated into this version. It won't be if I can help it though.

To get some conversation started what features are the most desired?

Should (AutoIt Desktop Shell) be the name? Ideas?

Registering the shell is simple enough -

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

I will be needing to touch on some sensitive subjects. How can we intercept the same hotkeys as explorer for the start menu and etc... If this is unacceptable then mods please due inform me. I'm not asking now, just speculating on this project's development.

Edited by Decipher
Spoiler

censored.jpg

 

Link to comment
Share on other sites

AutoIt Desktop Shell Source - Updated 9:33 PM 4/2/2013

I've started writting some startup functions.

#NoTrayIcon
#include <File.au3>
#include <Array.au3>

Global Const $sDEF_SETTINGS_PATH = @ScriptDir & "\Settings.ini"
Global Const $sDEF_STARTUP_DIR = @StartupDir ;- Currently only reads from current users startup directory.
;- Not currently implemented - Global Const $sDEF_STARTUP_EXCLUDE = False
;- This code is extremely experimental and only displays information
;- TODO:
; (1) Add other special folder startup location - I think whatever is register under HKLM->RUN will still start but haven't tested it.
;(2) Add option to exclude default locations along with option to include a custom startup location
;(3) Add option for delays and pherhaps order based on the order the user has entered in the settings file.
;(4) Open to suggestions - This is a couple of many function to be written to create the AutoIt Desktop Shell
Global $aStartupPID[50]

Dim $aList = _GetStartupList()
;- _ArrayDisplay($aList)
_ExecuteStartupList($aList)


Func _GetStartupDir($sStartupDir = $sDEF_STARTUP_DIR)
        Local $sSetting = IniRead(@ScriptDir & "\settings.ini", "LoadAtStartup", "StartupDir", "")
        If Not $sSetting Then
            $sSetting = $sStartupDir
        EndIf
        Return $sSetting
EndFunc

Func _GetStartupList($sExcludeList = "")
    Local $aExcludeList , $sStartupList, $aStartupList = _FileListToArray(_GetStartupDir(), "*", 0)
    If @error Then
        Return @error
    EndIf
    $sExcludeList = "desktop.ini," & IniRead($sDEF_SETTINGS_PATH, "LoadAtStartup", "Exclude", "")
    If StringInStr($sExcludeList, ",", 2, -1) == StringLen($sExcludeList)  Then
        $sExcludeList = StringTrimRight($sExcludeList, 1)
    EndIf
    $aExcludeList = StringSplit($sExcludeList, ",")
    For $i = 1 To $aStartupList[0] Step 1
        For $index = 1 To $aExcludeList[0] Step 1
            If Not StringInStr($aStartupList[$i], $aExcludeList[$index], 2) Then
                $sStartupList &= $aStartupList[$i] & ","
            EndIf
        Next
    Next
    Return StringSplit(StringTrimRight($sStartupList, 1), ",")
EndFunc

Func _IsFileShortcut($sFilename)
    Local $szDrive, $szDir, $szFName, $szExt
    Local $aPath = _PathSplit($sFilename, $szDrive, $szDir, $szFName, $szExt)
    If $aPath[4] == ".lnk" Then
        Return True
    EndIf
EndFunc

Func _ExecuteStartupList($aStartupList)
    Local $aProperties, $sStartupDir = _GetStartupDir()
    For $i = 1 To $aStartupList[0] Step 1
        If _IsFileShortcut($aStartupList[$i]) Then
            $aProperties = FileGetShortcut(_PathFull($aStartupList[$i], $sStartupDir))
            If Not @error Then
                ;- Run($aProperties[0], $aProperties[1], $aProperties[6])
                ConsoleWrite("Run(" & $aProperties[0] & ", " & $aProperties[1] & ", " & $aProperties[6] & ")" & @CRLF)
            EndIf
        Else
            ;- Run($aStartupList[$i], $sStartupDir)
            ConsoleWrite("Run(" & $aStartupList[$i] & ")" & @CRLF)
        EndIf
    Next
EndFunc

- This would be preferred since .lnk usually are executed by explorer but some function may have to be reponsible for retrieving the specific icon for a shortcut.

- This will be used in the desktop window functions.

Multiple Desktops - Wow! I see now that most of the work has already been done and there isn't any reason to reinvent the wheel here but I may need to contact the author of this

- This will work great for showing the default menus when a user right clicks on a icon in the program manager.

- Easy on the eyes and has made the cut - This will be a feature.

Any of the authors of the fore-mentioned scripts that wish for their work not to be included partly or entirely into this project then please PM me and I will make the necessary changes.

Edited by Decipher
Spoiler

censored.jpg

 

Link to comment
Share on other sites

This has been done before, have a search, there was a guy called JustinReno, BrettF and myself who I distinctly remember taking part in.

Edit: Here they are.

  • BrettF -
  • seclinix -
  • JustinReno -
  • Alek -
  • Dhilip89 -
And I can't seem to find mine anymore, I'm sure I made one though... Edited by James
Link to comment
Share on other sites

  • Moderators

Also, as this is not specifically asking for assistance to resolve an issue, but presenting an idea for people to contribute to, perhaps the Example Scripts section would be more appropriate.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

How can I register a listener function for the Win+R Hotkey?

The program manager will need to take use of the settings in this location:

HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics

#NoTrayIcon
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#Include <Misc.au3>

Global Const $sDEF_WALLPAPER = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper")
Global Const $iDEF_TASKBAR_SIZE = 22 ;- Toolbar at top of screen

Global $hProgMan, $aDesktopIcon[1][2];- $aDesktopIcon[50][2]

_ProgMan_Start()

Func _ProgMan_Start()
    $hProgMan = GUICreate("ProgMan", @DesktopWidth, @DesktopHeight, -1, -1, $WS_POPUP)
    $hCtrl_Background = GUICtrlCreatePic($sDEF_WALLPAPER, -1, $iDEF_TASKBAR_SIZE, @DesktopWidth, @DesktopHeight-$iDEF_TASKBAR_SIZE)
    GUICtrlSetState($hCtrl_Background, @SW_DISABLE)
    $aDesktopIcon[0][0] = GUICtrlCreateIcon("H:\Windows\System32\notepad.exe", -1, -1, -1)
    $aDesktopIcon[0][1] = ControlGetPos($hProgMan, "", $aDesktopIcon[0][0])
    ;_ProgMan_Icons()
    GUISetState(@SW_SHOWNA)
EndFunc

Func _ProgMan_Icons()
    ;_WinAPI_ExtractIconEx(
EndFunc

While 1
    $iMsg = GUIGetMsg()
    If $iMsg == $GUI_EVENT_SECONDARYUP Then Exit
    _ProgMan_MoveIcon()
WEnd

Func _ProgMan_MoveIcon()
    If _IsPressed("01") Then
        Opt("MouseCoordMode", 2)
        Local $aMPosNew, $aCtrlPos, $aMousePos = MouseGetPos()
        For $i = 0 To UBound($aDesktopIcon, 1) -1 Step 1
            $aCtrlPos = $aDesktopIcon[$i][1]
            If $aMousePos[0] >= $aCtrlPos[0] And $aMousePos[0] <= ($aCtrlPos[0] + $aCtrlPos[2]) _
                And $aMousePos[1] >= $aCtrlPos[1] And $aMousePos[1] <= ($aCtrlPos[1] + $aCtrlPos[3]) Then
                Do
                    $aMPosNew = MouseGetPos()
                    ControlMove($hProgMan, "", $aDesktopIcon[$i][0], $aCtrlPos[0] + $aMPosNew[0] - $aMousePos[0], _
                            $aCtrlPos[1] + $aMPosNew[1] - $aMousePos[1])
                    Sleep(100)
                Until Not _IsPressed("01")
            $aDesktopIcon[$i][1] = ControlGetPos($hProgMan, "", $aDesktopIcon[$i][0])
            ExitLoop
            EndIf
        Next
    EndIf
EndFunc

How can I prevent the window from gaining focus - Always on bottom? The only viable solution is where the interface remains responsive but when clicking on lets say for example and image on the interface then it shouldn't appear to have minimized all of the other windows.

Thanks to anyone willing to offer suggestions. I enjoy cooperating on projects with others so that is why I explicitly welcomed anyone to do so however it doesn't matter if they do or not.

*Edit

I added an example icon that can be moved. Based on CtrlResizeMove.au3

I know I've asked this before so I'll have to search around but how can you display an icon with its control background transparent. I'm using GUICtrlCreateIcon above.

Edited by Decipher
Spoiler

censored.jpg

 

Link to comment
Share on other sites

James,

This has been done before, have a search, there was a guy called JustinReno, BrettF and myself who I distinctly remember taking part in.

Edit: Here they are.

  • BrettF -
  • seclinix -
  • JustinReno -
  • Alek -
  • Dhilip89 -
And I can't seem to find mine anymore, I'm sure I made one though...

Those are cool and thanks for sharing but I'd like to create my own custom version that's more feature complete, pherhaps even complete replicate explorer at its base including the start menu, toolbars, program manager, and file manager then build on top of that but with major improvements. If I'm satisified I'll probably even convert it to C for practice.

Anonymous

Spoiler

censored.jpg

 

Link to comment
Share on other sites

Anonymous

:shocked: please I care of my computer, don't hack it.

Edit instead of reply :

Lets please do remain on topic

No worries, if I post in a topic then I'm involved, consequently I will follow it for any help.

perhaps you would enjoy doing a little more research on the group

No need ;) Edited by FireFox
Link to comment
Share on other sites

Bump :shifty:,

How can I prevent the window from gaining focus - Always on bottom?

The only viable solution is where the interface remains responsive but when clicking on lets say for example and image on the interface then it shouldn't appear to have minimized all of the other windows.

Anonymous

Spoiler

censored.jpg

 

Link to comment
Share on other sites

  • Moderators

FireFox,

Do you want your window to be "BOTTOM MOST" ? I don't see how to do that

_WinAPI_SetWindowPos with the $HWND_BOTTOM CONSTANT as a parameter would look a good starting place. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

FireFox,

You asked "Do you want your window to be "BOTTOM MOST" ? I don't see how to do that." - I gave a solution. The "CONSTANT" highlight was just a bit of a joke. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

FireFox,

No, I did. :>

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

I don't want to continue working on this unless I know I can make it work properly so I'm stuck. :mellow:

*Edit - I tried using your code in a loop along with other flags mentioned in the help file but its way to glitchy.

Edited by Decipher
Spoiler

censored.jpg

 

Link to comment
Share on other sites

  • 2 weeks later...

KaFu,

It seems you've done a lot experimenting with preventing windows from taking the top most attribute. Perhaps you could look into this for me. If not I'm probably gonna give up on this one. Thanks

Anonymous

Spoiler

censored.jpg

 

Link to comment
Share on other sites

Hi Decipher,

afaik it's not possible to prevent some windows (e.g. the taskbar) from stealing the topmost attribute, the only workaround I've found so far is to check the topmost window in a loop and reset the order if something has changed it.

Regards

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...