Dock [v2.0 b3]

×÷Õß: majkinetor ×î½ü¸üÐÂʱ¼ä: nonexistent


Dock desired top level windows (dock clients) to any top level window (dock host).

Using dock module you can glue your or third-party windows to any top level window. Docked windows in module terminology are called Clients and the window that keeps their position relative to itself is called Host. Once Clients are connected to the Host, this group of windows will behave like single window - moving, sizing, focusing, hiding and other OS events will be handled by the module so that the “composite window” behaves like the single window.

Dock(pClientID, pDockDef="", reset=0)
Dock_HookProc(hWinEventHook, event, hwnd, idObject, idChild, dwEventThread, dwmsEventTime )
Dock_Shutdown()
Dock_Toggle(false)
Dock_Update()

¹ØÓÚº¯ÊýµÄ²ÎÊýºÍ·µ»ØÖµ, Çë²ÎÔÄÆäÔ´Âë»ò ´ËÎĵµ.

±¸×¢

Its not strictly stdlib conform, because it works with global variables AND have subroutines with Return statements. If you want to use this library, you must include at the end of your script after last Return (end of AutoExec).

See at DockA for regular AutoHotkey Guis:
* GUID=ed633b80-ac75-126a-97c9-1634b021e32f

¹ØÓڴ˺¯Êý(¼¯)µÄ¸üÐÂϸ½ÚºÍ×¢ÒâÊÂÏî, Çë²Î¼û AutoHotkey ÂÛ̳: http://www.autohotkey.com/forum/viewtopic.php?t=19400

Ðí¿É

´Ëº¯Êý(¼¯)ÊÇ»ùÓÚ CC By-Nc 3.0 Ðí¿ÉµÄ¿ªÔ´ÏîÄ¿. ÏëÁ˽âÐí¿ÉÏêÇé, Çë²Î¼û http://creativecommons.org/licenses/by-nc/3.0/

ʾÀý

; #Include Dock.ahk
SetBatchLines, -1 
#SingleInstance, force 
   
   Msgbox This test will monitor Notepad appearance and add customizable number of dock clients to its left side.

   host := "ahk_class Notepad" 
   clientNo := 5 


   loop, %clientNo% 
   { 
      Gui %A_Index%:+LastFound +ToolWindow +Border +Resize -Caption 
      Gui,%A_Index%:Add, Button, 0x8000, %A_Index% 
      c%A_Index% := WinExist() 

      Dock("+" c%A_Index%, "0,-1,-10, 0,0," A_Index*50 ",0,50,0,50") 
   } 

   Dock_OnHostDeath := "OnHostDeath" 

return 

FindHost: 
   if Dock_HostID := WinExist(host) 
   { 
      SetTimer, FindHost, OFF 
       loop, %clientNo% 
         DllCall("ShowWindow", "uint", c%A_Index%, "uint", 5)     
       
      Dock_Toggle(true) 
   } 
return 

OnHostDeath: 
   SetTimer, FindHost, 100 
return