Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 07, 2016, 04:25:51 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Make any Window Dockable to the Side of the Screen  (Read 7521 times)

greasypigstudios

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
IDEA: Make any Window Dockable to the Side of the Screen
« on: April 29, 2008, 05:10:04 AM »
I've been looking for the longest time for an app that gave any window the ability to dock to the side of the screen like the Google/Vista sidebars, and the various instant messaging clients. I've got a 24 in widescreen that I want to maximize the visual efficiency of, and I prefer to work in a maximized window environment. I'm already using a vertical taskbar, docked IM buddy list, and vertical tab bar for firefox. I'm also already using Allsnap as a tiny step in the right direction (I used to use Gridmove but it was too sluggish). Being able to make my browser dockable would make it easy to put a spreadsheet up tiled next to it.

Anybody who can whip this up or even just point me in the direction of an existing app will get a featured article on my blog, http://www.greasypc.blogspot.com . It's not much of a reward but it's the best I can offer.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,409
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: Make any Window Dockable to the Side of the Screen
« Reply #1 on: April 29, 2008, 07:45:28 PM »
i was going to suggest Allsnap.. what doesnt that do that you want to do?

greasypigstudios

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: Make any Window Dockable to the Side of the Screen
« Reply #2 on: April 29, 2008, 07:49:40 PM »
I want to be able to maximize my windows, and have windows i maximize not overlap the windows I've got docked. Instant messaging windows do this perfectly, I'm so surprised to find a utility doesn't exist for this already.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,409
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: Make any Window Dockable to the Side of the Screen
« Reply #3 on: April 29, 2008, 08:02:57 PM »
ah yes i understand now.  i don't know any program for this off hand, but i look forward to seeing if anyone else knows any.

one thing you could do as a temporary stop gap is run a program like my DesktopCoral program and use it to reserve a side of your screen, and then manually size and move your other programs on top of that area.  they will then be protected from other programs maximizing on top of them.

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 886
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Make any Window Dockable to the Side of the Screen
« Reply #4 on: June 14, 2008, 07:05:23 PM »
 :) Here's DockOc!

Dock as many windows as you like to the screen's edges!
Usage: Grab a window by the caption and drop it on a screen edge to dock it.

There's still some options I want to add, but give it a try.

Skrommel


;DockOc.ahk
; Dock as many windows as you like to the screen's edges
; Usage: Grab a window by the caption and drop it on a screen edge
;Skrommel @ 2008

#NoEnv
#SingleInstance,Force
DetectHiddenWindows,On
SetWinDelay,0
CoordMode,Mouse,Screen

applicationname=DockOc

Gosub,MENU
showing=0
SetTimer,CHECK,500
OnExit,EXIT
Return


~LButton Up::
MouseGetPos,mx,my,mwin,mctrl
If (mx=monitorLeft)
  edge=left
Else
If (mx=monitorRight-1)
  edge=right
Else
If (my=monitorTop)
  edge=top
Else
If (my=monitorBottom-1)
  edge=bottom
Else
  Return
MouseGetPos,mx,my,mwin
SendMessage,0x84,,(my<<16)|mx,,ahk_id %mwin%
part:=ErrorLevel
If part<>2
  Return

WinGetPos,wx,wy,ww,wh,ahk_id %mwin%
If (edge="left")
  WinMove,ahk_id %mwin%,,0,
Else
If (edge="right")
  WinMove,ahk_id %mwin%,,% A_ScreenWidth-ww,
Else
If (edge="top")
  WinMove,ahk_id %mwin%,,,0
Else
If (edge="bottom")
  WinMove,ahk_id %mwin%,,,% A_ScreenHeight-wh
WinSet,AlwaysOntop,On,ahk_id %mwin%
WinHide,ahk_id %mwin%
%edge%=% "" %edge% . mwin ","
showing=0
Return


CHECK:
SysGet,monitor,MonitorWorkArea
MouseGetPos,mx,my,mwin,mctrl
edge=
If (mx=0)
  edge=left
Else
If (mx=A_ScreenWidth-1)
  edge=right
Else
If (my=0)
  edge=top
Else
If (my=A_ScreenHeight-1)
  edge=bottom

If (edge="left" Or edge="right")
  orientation=y
Else
If (edge="top" Or edge="bottom")
  orientation=x
Else
{
  If (mwin<>showingid)
  {
    WinHide,ahk_id %showingid%
    showing=0
  }
  Return
}

closestid=
shortest=9999
Loop,Parse,%edge%,`,
{
  id:=A_LoopField
  If id=
    Break
  IfWinNotExist,ahk_id %id%
    StringReplace,%edge%,%edge%,%id%`,,
  WinGetPos,wx,wy,ww,wh,ahk_id %id%
  distance:=Abs(m%orientation%-w%orientation%)
  If (distance<shortest) ; And my-wy>0 And my-wy<wh)
  {
    shortest:=distance
    closestid:=id
  }
}
If closestid=
  Return
If (showingid<>closestid)
  WinHide,ahk_id %showingid%
showingid:=closestid
WinShow,ahk_id %showingid%
showing=1
Return


EXIT:
edges=left,right,top,bottom
Loop,Parse,edges,`,
{
  edge:=A_LoopField
  Loop,Parse,%edge%,`,
  {
    id:=A_LoopField
    WinSet,AlwaysOntop,Off,ahk_id %id%
    WinShow,ahk_id %id%
  }
}
ExitApp


MENU:
Menu,Tray,DeleteAll
Menu,Tray,NoStandard
Menu,Tray,Add,%applicationname%,ABOUT
Menu,Tray,Add,
Menu,Tray,Add,&About...,ABOUT
Menu,Tray,Add,E&xit,EXIT
Menu,Tray,Tip,%applicationname%
Menu,Tray,Default,%applicationname%
Return


ABOUT:
Gui,Destroy
Gui,Margin,20,20
Gui,Add,Picture,xm Icon1,%applicationname%.exe
Gui,Font,W700
Gui,Add,Text,x+10 yp+10 Bold,%applicationname% v1.0
Gui,Font,W400
Gui,Add,Text,y+10,Dock as many windows as you like to the screen's edges
Gui,Add,Text,xp y+5,Usage: Grab a window by the caption and drop it on a screen edge

Gui,Add,Picture,xm y+20 G1HOURSOFTWARE Icon2,%applicationname%.exe
Gui,Add,Text,x+10 yp,For more tools, information and donations, please visit
Gui,Font,W700 CBlue
Gui,Add,Text,y+5 G1HOURSOFTWARE,www.1HourSoftware.com
Gui,Font,W400 CBlack

Gui,Add,Picture,xm y+20 GDONATIONCODER Icon7,%applicationname%.exe
Gui,Add,Text,x+10 yp,Please support the contributors at
Gui,Font,W700 CBlue
Gui,Add,Text,y+5 GDONATIONCODER,www.DonationCoder.com
Gui,Font,W400 CBlack

Gui,Add,Picture,xm y+20 GAUTOHOTKEY Icon6,%applicationname%.exe
Gui,Add,Text,x+10 yp,This tool was made using the powerful
Gui,Font,W700 CBlue
Gui,Add,Text,y+5 GAUTOHOTKEY,www.AutoHotkey.com
Gui,Font,W400 CBlack

Gui,Show,,%applicationname% - About
Gui,+LastFound
guiid:=WinExist()
hCurs:=DllCall("LoadCursor","UInt",NULL,"Int",32649,"UInt") ;IDC_HAND
OnMessage(0x200,"WM_MOUSEMOVE")
Return

1HOURSOFTWARE:
Run,www.1HourSoftware.com
Return

DONATIONCODER:
Run,www.DonationCoder.com
Return

AUTOHOTKEY:
Run,www.AutoHotkey.com
Return

WM_MOUSEMOVE(wParam,lParam)
{
  Global hCurs
  Global guiid
  MouseGetPos,,,mwin,mctrl
  If mwin in %guiid%
  If mctrl in Static7,Static10,Static13
    DllCall("SetCursor","UInt",hCurs)
  Return
}

GuiEscape:
GuiClose:
  Gui,Destroy
  OnMessage(0x200,"")
  DllCall("DestroyCursor","Uint",hCurs)
Return
Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
« Last Edit: June 15, 2008, 05:59:44 PM by skrommel »

greasypigstudios

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: IDEA: Make any Window Dockable to the Side of the Screen
« Reply #5 on: June 14, 2008, 07:18:05 PM »
Wow, I can't believe someone's taking a stab at this! Thank you so much! Unfortunately, it doesn't seem to work for me... since i have my taskbar on the left side of the screen, I can't drag it past that to make it "snap" (Pidgin and other IM buddy lists can do it fine), meanwhile when I moved my taskbar back to the bottom just to see, whenever I threw a window to the side, it would just disappear, and wouldn't reappear until I threw another window there, at which point the new window disappears, and the old one reappears.

Do other people get this problem, or is it just me?

But still, it's really great that someone's taking this on. This would be the most productive app I would use when it's finished!

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 886
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Make any Window Dockable to the Side of the Screen
« Reply #6 on: June 15, 2008, 06:00:10 PM »
 :) Updated the code above!

Skrommel
Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.

PhilB66

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,522
    • View Profile
    • Donate to Member
Re: IDEA: Make any Window Dockable to the Side of the Screen
« Reply #7 on: June 15, 2008, 06:44:15 PM »
Nice script. Could you add support for a multi-monitor setup?

vradmilovic

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 35
    • View Profile
    • Dataland Software
    • Donate to Member
Re: IDEA: Make any Window Dockable to the Side of the Screen
« Reply #8 on: June 17, 2008, 09:21:33 AM »
Maybe something like this?

  http://www.datalands...om/files/DockAny.zip

Funny thing is that I started making this for myself yesterday... It has not really been tested so don't be too harsh. :) There are some glitches with some applications but main functionality is there.

=== "Dock Any" Readme file ===

WARNING: This is version 0.1, meaning it's far from finished. Use it if you
can, but if you have problems or special requirements, feel free to let me
know.

* Usage

To dock applications / windows, choose "Add" option and then click at
window you wish to add.

Use "Undock" option to detach window back to its original position.

Use "Close" option to close tab AND application entirely. If you close
embedded application directly (i.e. from File | Exit), "Dock Any" will
not be aware of this (at least for now).
Vladimir Radmilovic
- <a href="http://www.agendaatonce.com/">Agenda At Once - PIM and to-do list software</a>
- <a href="http://www.cd-label-designer.com/">CD Label Designer - powerful cd label maker</a>
- <a href="http://www.weblogstorming.com/">Web Log Storming - interactive web log analyzer</a>

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 886
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Make any Window Dockable to the Side of the Screen
« Reply #9 on: June 17, 2008, 11:48:26 AM »
 :-[ I've of course not read the whole request...again. Sorry, greasypigstudios.

 :) Great app, vradmilovic!

Skrommel
Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.

phatdaddy

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 1
    • View Profile
    • Donate to Member
Re: IDEA: Make any Window Dockable to the Side of the Screen
« Reply #10 on: March 16, 2009, 01:54:49 PM »
Nice app Vladimir!  Do you think it would be difficult to add multiple monitor support and a command line interface to DockAny?  I'd like to dock Outlook's calendar to a portion of a side monitor (current version only works with one monitor) and would like to be able to automate the adding of the window to the dock--I could do so with some scripting & a command line interface.  I also noticed something sort of strange--when I click on any of the menus for the embedded application, the menu pops up outside of the dock.  This problem goes away when I put DockAny into wide mode.

Thanks for posting DockAny!