AutoHotkey Community

It is currently May 26th, 2012, 10:00 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: May 13th, 2005, 2:39 am 
Offline

Joined: July 30th, 2004, 8:50 pm
Posts: 192
8) Do you have mulitple monitors, a projector or other display devices?
DeskTopControl lets you take contol of all the windows on your desktop.

Shows the icons of the running programs in a little window. Move, maximize, drag and drop files... It's not perfect, but it works.

Anyone know another way of getting a file's path other than through the registry?

Skrommel


Code:
; DeskTopControl
;
; Controls all the windows on all your display devices.
; Move, maximize, show windows info, drag and drop files to any program.

DetectHiddenWindows,Off
SetWindelay,0
guititle=DeskTopControl
iconsize=32
winlist=
command=create

START:
  Gosub,NEWWIN
  GetKeyState,lbutton,LButton,P 
  If lbutton=D
    Gosub,INDEX
  Sleep,100
Goto,START

NEWWIN:
  winlist=
  WinGet,id,List,,,Program Manager
  Loop %id%
  {
    winlist=%winlist%%id%
  }
  If winlist<>%oldwinlist%
  {
    Gosub,CREATEGUI
    command=create
    Gosub,INDEX
    command=update
    oldwinlist=%winlist%
  }
Return

TOPMOST:
WinGet,topmost,ExStyle,ahk_id %window%
Transform,topmost,BitAnd,%topmost%,0x8
If topmost<>0
  topmost=On
Else
  topmost=Off
Return

CREATEGUI:
  SysGet,mon1,Monitor,1
  SySGet,mon2,Monitor,2
  SysGet,mon3,Monitor,3
  SySGet,mon4,Monitor,4
  desktopw:=mon1Right
  If mon2Right>%desktopw%
    desktopw:=mon2Right
  If mon3Right>%desktopw%
    desktopw:=mon3Right
  If mon4Right>%desktopw%
    desktopw:=mon4Right
  desktoph:=mon1Bottom
  If mon2Bottom>%desktoph%
    desktoph:=mon2Bottom
  If mon3Bottom>%desktoph%
    desktoph:=mon3Bottom
  If mon4Bottom>%desktoph%
    desktoph:=mon4Bottom
  If command=create
  {
    SysGet,titlebarh,4
    SysGet,borderh,33
    guiw:=desktopw/10
    guih:=desktoph/10
    SysGet,work,MonitorWorkArea
    guix:=workRight-guiw-borderh
    guiy:=workBottom-guih-borderh-titlebarh+4
  }
  Else
    WinGetPos,guix,guiy,,,%guititle%
  Gui,Destroy
  Gui,+AlwaysOnTop -Resize +ToolWindow
  Gui,Show,x%guix% y%guiy% h%guih% w%guiw% NA,%guititle%
Return

INDEX:
  windowlist=
  WinGet,id,List,,,Program Manager
  Loop,%id%
  {
    StringTrimRight,window,id%A_Index%,0
    WinGetTitle,title,ahk_id %window%
    If title<>%guititle%
    If title<>
    {
      iconid=icon%A_Index%
      Gosub,GETPOS
      Gosub,READICON
      If command=create
        Gosub,ADDICON
      Gosub,DRAWICON
      Gosub,MOVEICON
      Gosub,SETINFO
    }
  }
Return

GETPOS:
  WinGetPos,winx,winy,winw,winh,ahk_id %window%
  x:=winx/10
  y:=winy/10
  w:=winw
  h:=winh
  if x<0
    x:=0
  snap:=guiw-iconsize
  if x>%snap%
    x:=snap
  if Y<0
    y:=0
  snap:=guih-iconsize
  if y>%snap%
    y:=snap
Return

SETINFO:
  %iconid%window:=window
  %iconid%info  :=info
  %iconid%file  :=file
  %iconid%path  :=path
  %iconid%title :=title
  %iconid%x     :=x
  %iconid%y     :=y
  %iconid%w     :=w
  %iconid%h     :=h
Return

GETINFO:
  window:=%iconid%window
  info  :=%iconid%info
  file  :=%iconid%file
  path  :=%iconid%path
  title :=%iconid%title
  x     :=%iconid%x
  y     :=%iconid%y
  w     :=%iconid%w
  h     :=%iconid%h
Return

ADDICON:
  Gui,Add,Pic,v%iconid% gMOVE
Return

DRAWICON:
  GuiControl,,%iconid%,*w%iconsize% *h-1 %path%
Return

MoVEICON:
  GuiControl,Move,%iconid%,x%x% y%y%
Return

READICON:
  WinGet,file,ProcessName,ahk_id %window%
  Loop,HKEY_CURRENT_USER,Software\Microsoft\Windows\ShellNoRoam\MUICache,0,0
  {
    IfInString,A_LoopRegName,%file%
    {
      RegRead,info
      path=%A_LoopRegName%
      Break
    }
  }
Return

MOVE:
  iconid:=A_GuiControl
  Gosub,GETINFO
  Gosub,TOPMOST
  If A_GuiControlEvent=DoubleClick
  {
    WinGet,max,MinMax,ahk_id %window%
    If max=0
      WinMaximize,ahk_id %window%
    Else 
      WinRestore,ahk_id %window%
    Gosub,GETPOS
    Gosub,MOVEICON
    Return
  }
  WinSet,AlwaysOnTop,On,ahk_id %window%
  WinSet,AlwaysOnTop,On,%guititle%
  MouseGetPos,mx0,my0       
  GuiControlGet,iconpos,Pos,%iconid%
  offx:=mx0-iconposx
  offy:=my0-iconposy
  moved=0

MOVING:
  MouseGetPos,mx,my
  If moved=0
  {
    If mx<>%mx0%
      moved=1
    If my<>%my0%
      moved=1
  }
  If moved=1
  {
    x:=mx-offx
    y:=my-offy
    Gosub,MOVEICON
    winx:=x*10
    winy:=y*10
    WinMove,ahk_id %window%,,%winx%,%winy%
  }
  ToolTip,%info% - %path% - %title% - x%winx%:y%winy% - t:%topmost%
  GetKeyState,lbutton,LButton,P 
  If lbutton=U
  {
    WinSet,AlwaysOnTop,%topmost%,ahk_id %window%
    WinActivate,ahk_id %window%
    If moved<>0
    {
      Gosub,GETPOS
      Gosub,MOVEICON
      Gosub,SETINFO
    }
    ToolTip
    Return
  }
Goto,MOVING

GUICLOSE:
ExitApp

GUIDROPFILES:
Loop,parse,A_GuiControlEvent,`n
{
  Run,%path% %A_LoopField%
  ToolTip,%path% %A_LoopField%
  Sleep,1000
}
ToolTip
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 13th, 2005, 11:13 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
That sounds like it does a lot. Thanks for sharing it.

By the way, I haven't forgotten about that cool mouse scrolling script you posted about a year ago. One of these days I'm going to put it in the showcase. If you have any newer version of it, feel free to e-mail it to support@autohotkey.com


Report this post
Top
 Profile  
Reply with quote  
 Post subject: MouseTailor
PostPosted: May 14th, 2005, 8:30 am 
Offline

Joined: July 30th, 2004, 8:50 pm
Posts: 192
What I originally wanted to with my mouse script was to control the thumb tracker(?) of the scroll bar, but I couldn't find the messages to send. And of course make the button combinations user defined. I'll look into it.

Skrommel


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 18th, 2005, 2:51 am 
Offline

Joined: April 7th, 2004, 2:43 pm
Posts: 62
Amazing,just amazing. Talk about thinking "outside the box".

This script really shows the versatility of AHK in my opinion. Thanks Skrommel for the inspiration.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 20th, 2006, 10:42 pm 
Offline

Joined: June 11th, 2005, 9:34 am
Posts: 264
Location: England ish
WOW!!!!!!!!!!!!!!!!!1 That is seriously AMAZING. as in. WOW.
You are a Star



If you could do more amazing scripts for multi monitors it would be just Great.

_________________
::
I Have Spoken
::


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 21st, 2006, 9:31 am 
Offline

Joined: August 15th, 2005, 7:15 am
Posts: 107
Location: North Carolina
That is really cool, never seen anything like it before. I agree with the previous post, I'd like to see more help for managing multiple monitors. But as it is, it is very, very nice. Innovative.

Bob

_________________
When it comes to Binary, there are 10 types of people. Those who get it and those who don't. :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject: New version
PostPosted: February 20th, 2006, 9:38 pm 
Offline

Joined: July 30th, 2004, 8:50 pm
Posts: 192
I've just uploaded another solution using IrFanView.

Image MultiMonMan

Image

You'll find the code and more info at
http://www.donationcoder.com/Software/Skrommel/index.html#MultiMonMan

But it's a bit slow, and it flickers. Anyone got any improvements?

Skrommel


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: New version
PostPosted: March 12th, 2006, 3:59 am 
Offline

Joined: March 11th, 2006, 12:44 pm
Posts: 341
Location: Munich, Germany
skrommel wrote:
But it's a bit slow, and it flickers. Anyone got any improvements?


Hi Skrommel, this script is great, i used it as a base to build my DeskMan script which does not show multiple monitors but all open windows and simulates a kind of apple-dock with minimized windows (minimize to dock).

search for "Deskman" in the forum. i also changed the usage of the capture so i only get the targetsize directly also with antialize which shows more details compared to a simple resize.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 10th, 2010, 3:57 pm 
Offline

Joined: August 31st, 2006, 5:25 am
Posts: 25
This tool has saved me a lot and I can't live without it, seriously. Thanks to skrommel for sharing this.

Since i moved to Windows 7, I cannot use this any more :(. Has any of us tweaked it and used it in Windows 7? If so, could you please share and save my life and others like me?

Many, many thanks!

_________________
Musa.Biralo


Report this post
Top
 Profile  
Reply with quote  
PostPosted: August 9th, 2011, 9:28 am 
Musa wrote:
This tool has saved me a lot and I can't live without it, seriously. Thanks to skrommel for sharing this.

Since i moved to Windows 7, I cannot use this any more :(. Has any of us tweaked it and used it in Windows 7? If so, could you please share and save my life and others like me?

Many, many thanks!


Search for this code in the .ahk file.

MultiMonMan.ahk wrote:
PAINT:
Loop
{
ptooltip=0
pcount=0
Loop,4
{
pmonitor:=A_Index
IfWinExist,%pmonitor% - %applicationname%
{
pcount+=1
WinGetPos,px,py,pw,ph,%pmonitor% - %applicationname%
pw:=pw-2*borderh
ph:=pw*%pmonitor%Aspect
If (pw<>poldw%pmonitor% Or ph<>poldh%pmonitor%)
WinMove,%pmonitor% - %applicationname%,,,,,% ph+titlebarh+borderh*2
poldw%pmonitor%:=pw
poldh%pmonitor%:=ph
DllCall("gdi32.dll\StretchBlt",UInt,hdc_target_%pmonitor%,Int,0,Int,0,Int,pw,Int,ph
,UInt,hdc_source,UInt,%pmonitor%Left,UInt,%pmonitor%Top,Int,%pmonitor%Width,Int,%pmonitor%Height,UInt,0xCC0020) ; SRCCOPY
MouseGetPos,pmx,pmy
pwx:=px+(pmx-%pmonitor%Left)/%pmonitor%Width*pw+borderh
pwy:=py+(pmy-%pmonitor%Top)/%pmonitor%Height*ph+borderh+titlebarh
If (pwx>=px+borderh And pwx<=px+pw+2*borderh And pwy>=py+borderh+titlebarh And pwy<=py+ph+2*borderh+titlebarh)
{
markx:=pwx-borderh-px
marky:=pwy-borderh-titlebarh-py
DllCall("MoveToEx",UInt,hdc_target_%pmonitor%,Int,markx-4,Int,marky,Str,0)
DllCall("LineTo",UInt,hdc_target_%pmonitor%,Int,markx+5,Int,marky)
DllCall("MoveToEx",UInt,hdc_target_%pmonitor%,Int,markx,Int,marky-4,Str,0)
DllCall("LineTo",UInt,hdc_target_%pmonitor%,Int,markx,Int,marky+5)
ptooltip+=1
tx:=pwx
ty:=pwy
}
Gosub,MOUSE
Sleep,%delay%
}
}
If ptooltip=0
ToolTip
If pcount=0
ExitApp
}


Add the semicolon omission to the code (Add red) ;MouseGetPos,pmx,pmy

You'll lose the in window mouse pointer. However it doesn't crash.

I hope this helps.


Report this post
Top
  
Reply with quote  
 Post subject: It Works!
PostPosted: October 27th, 2011, 5:32 pm 
Offline

Joined: October 27th, 2011, 4:39 pm
Posts: 1
Thanks Time,

It worked and fixed the bug which caused MultiMonMan to crash in windows7.

Now do you have a solution for the problem which causes it to show only upto 4 monitors ?

Thanks,
Roy Tal


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: kenn, xXDarknessXx and 15 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group