Jump to content

Integrated Shortcut Toolbar

Recommended Posts

Much like the old Microsoft Office Shortcut Bar, I've created a toolbar which resides on the right-hand side of the screen, dynamically adjusting it's size and position relative to resolution using the @DesktopHeight and @DesktopWidth information macros. This all works fine.

The trouble I have is that windows can still disappear behind it - and maximized windows often do with the Minimize, Restore and Close controls being covered by my toolbar.

What I want to do is somehow reduce the usable desktop area so windows know to only go up to my toolbar and not beyond it, especially when maximized - much like when the Office toolbar was active.

Has anyone achieved this, or played with this theory at all?

Link to post
Share on other sites

I've already got $WS_EX_TOOLWINDOW and $WS_EX_TOPMOST by using the combined value of 0x00000088. Adding the $WS_SYSMENU style doesn't seem to make any difference to how other windows behave. I've pretty much exhausted all options regarding the GUI window's own properties.

I may have to resort to monitoring all active windows and moving them if they go past a certain pixel.

Link to post
Share on other sites

Hmm, I seem to have answered my own question here.

Basically, as it's a GUI script there's already a "Just idle around" While-WEnd loop anyway, so I've just wrapped the following code in that so it monitors any windows that become active (except itself). It seems to work well in initial tests, but feel free to improve upon the code and let me know!

; Just idle around
While 1
    $title = WinGetTitle("")
    $pos = WinGetPos($title)
    $rightedge = $pos[0] + $pos[2]

    If $title = "Toolbar" Then
    ;do nothing
    ElseIf  $rightedge > @DesktopWidth-55 Then
            $newwidth = @DesktopWidth-55-$pos[0]
            WinMove($title, "", $pos[0], $pos[1], $newwidth)
Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...