Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[function] DockA 1.0


  • Please log in to reply
14 replies to this topic
majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
D o c k A
Docking system for AHK windows.



Download          Documentation


Posted Image

aaffe
  • Members
  • 1045 posts
  • Last active: Jan 16 2014 01:32 PM
  • Joined: 17 May 2007
The download-Side doesnt work for me....

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
fixed
Posted Image

aaffe
  • Members
  • 1045 posts
  • Last active: Jan 16 2014 01:32 PM
  • Joined: 17 May 2007
Thanks!

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
Function parameters were badly documented. Fixed.
Posted Image

Joy2DWorld
  • Members
  • 562 posts
  • Last active: Jun 30 2014 07:48 PM
  • Joined: 04 Dec 2006
I see this not get so many comments so I add one:


WAY NICE!!!!



This is nicely coded function.



Edit: Couple of small possible bugs:

You are using STATIC variables to save global toggle states. This is not a good idea. You should use LOCAL variables instead.
Joyce Jamce

guest3456
  • Guests
  • Last active:
  • Joined: --
DockA bug reported in Forms Framework thread here:
http://www.autohotke...260.html#380260

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007
I love DockA. It's so easy to use and works great.

I found what I think may be a bug while trying to call DockA as a library. I'm new to scripting so it may not be a bug.

Line 89
ifEqual, %HHost%,,return
I changed to
ifEqual, HHost,,return

When trying to call as a library I got the "This dynamic variable is blank..." error message. Removing the "%" has it working so far for my script.

Thanks for a great app.

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
Yes, its a bug.
Thx.
Posted Image

Chance
  • Members
  • 15 posts
  • Last active: Jan 09 2011 10:25 AM
  • Joined: 30 Dec 2010
Ok, so as the documentation of DockA.ahk said :

Using dock module you can glue windows to an AHK window.


So Majikinetor, if I want to glue a AHK script to a third part windows (i.e. notepad window) i have to use your other dock script, Dock.ahk, right ?

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
Yes
Posted Image

Lucid_Method
  • Members
  • 147 posts
  • Last active: Dec 06 2014 08:39 AM
  • Joined: 19 Apr 2010
Very useful majkinetor, thanks :-)

I have a 2 part question as I might not be taking the best approach to begin with. I am working on a tool that needs to be able to build GUI's dynamically, meaning I'm reading an INI file that has the coordinates for a collection of buttons that I'm turning into a GUI. To do this I have my main window that loads, then I read the INI file and generate the 2nd GUI. I want the 2nd gui to look/act as if it was built into main window.

I'm not sure if this is the best approach but it seems to work - where i build my main gui and then I generate the 2nd gui, using DockA to attach 2nd to the first and using the +owner1 config to make the 2nd window act like its part of the first. Is there a better way to build and attach a 2nd gui to the first gui using built in AHK functionality? If not this way works fine.. but comes my 2nd question ---

I can build the 2nd gui and attach it where I want it just fine when the 1st gui starts in a specific location on screen. I have the 2nd gui building at coordinate starting at 0,0 on the screen, so if the main window is moved to another monitor when it builds the 2nd gui it draws on the first monitor initially. Moving the main window forces the 2nd gui to reposition exactly where I want it to be positioned. I recognize that I could determine the window position of the first window before drawing the 2nd gui and adjust for the positioning that way, but it seems like it would be easier if I knew how to force DockA to automatically act as if I had just moved the main window - forcing DockA to move the 2nd gui to where I want it in relation to the main window.

Hopefully that makes sense - thanks :-)

**Edit** It looks like I can just move the main window by 1x coordinate and back quickly and that forces the redraw which will work, but the question still stands as to if this is the best approach?? Thanks
Posted Image
Macro Everything
Lucid_Method Index

guest3456
  • Guests
  • Last active:
  • Joined: --
you can check the bug link i posted earlier in this thread, when you go to the link, also read the next few posts, i had a similar problem with the docked window not 'attaching' itself until i dragged it, and i posted a quick solution to send WM_MOVE if you dont want to move 1 pixel and back

DataLife
  • Members
  • 1022 posts
  • Last active: Nov 27 2015 01:09 AM
  • Joined: 27 Apr 2008

When I click on the client I can drag it away from the host.

 

How can I get prevent this? I only need the client to be able to be moved if the host is moved.

 

I am sure it has something to do with "You can monitor WM_WINDOWPOSCHANGED=0x47 to detect when user move clients (if they are movable) in order to update dock properties"

 

But I have no idea how to do that.

 

#include docka.ahk
Gui 1: add, text,, this is the host
Gui 1: show, w300 h300, Host
WinGet,HostID,ID, Host

Gui 2: add, text, ,this is the client
gui 2: show, w300 h300, Client
WinGet,ClientID,ID,Client
Docka(HostID, ClientID,  "x() y(1) w(1) h(,300)")  
return

 

 


Check out my scripts.  (MyIpChanger) (XPSnap) (SavePictureAs) All my scripts are tested on Windows 7, AutoHotkey 32 bit Ansi unless otherwise stated.

dustind900
  • Members
  • 43 posts
  • Last active: Nov 03 2017 01:11 PM
  • Joined: 09 Dec 2012

Try this

#include docka.ahk

Gui 1: add, text,, this is the host
Gui 1: show, w300 h300, Host
WinGet,HostID,ID, Host

Gui 2: -Caption
Gui 2: add, text, ,this is the client
gui 2: show, w300 h300, Client
WinGet,ClientID,ID,Client
Docka(HostID, ClientID,  "x() y(1) w(1) h(,300)")  
return

or this works but the client window does not dock to the bottom of the Host window until it is moved.


#include docka.ahk
DetectHiddenWindows On
 
Gui 1: +HwndHwnd1
Gui 1: add, text,, this is the host
Gui 1: show, w500 h300, Host
 
Gui 2: +HwndHwnd2
Gui 2: add, text, ,this is the client
hSysMenu:=DllCall("GetSystemMenu","Int",Hwnd2,"Int",FALSE)
nCnt:=DllCall("GetMenuItemCount","Int",hSysMenu) 
DllCall("RemoveMenu","Int",hSysMenu,"UInt",nCnt-6,"Uint","0x400") 
DllCall("DrawMenuBar","Int",Hwnd2)
Docka(Hwnd1, Hwnd2, "x() y(1) w(1) h(,300)")
gui 2: show, w300 h300, Client
return