[Script] Dock-It ( window docker )

Post your working scripts, libraries and tools for AHK v1.1 and older
Ralf_Reddings200244
Posts: 110
Joined: 11 Mar 2023, 14:16

Re: [Script] Dock-It ( window docker )

24 Mar 2023, 16:10

Ahh that did it! Thank you, to both of you.
Gary-Atlan82
Posts: 74
Joined: 07 Mar 2023, 05:20

Re: [Script] Dock-It ( window docker )

07 Jul 2023, 12:57

@hellbent
Outstanding, as always Hellbent.
Thanks allot for writting this piece of software!

For a long time I have been looking for a software that does something like this on certain windows.
One solution I found, essentially records the window I partially wanted to hide and relays the recording to another window. Hiding the target window, it would then send clicks or keys to the target window through convoluted means.
After going through several of them I gave up, because the end result was just sub optimal.


I tested your program and it works smoothly, really smoothly. It also works consistently across many windows.
I have a question or two, I hope you can answer them for me.

After I crop a window, is the newly cropped window I am interacting with still the original window I started with or some other window you created?

I investigated the cropped window with the spy tool, it has all the identifiers as the original window. (Title, Exe etc) but then how are you achieving this cropped effect. I am confused on this.

Is it possible to treat the cropped window as a standard window? As in, its no different than any other window on the desktop. Currently when I crop a window, its set to always on top, I would like the window to just be a normal window.


I attempted to comment all the SetWinOnTop lines in your code to see if that works. While it stopped the window from being set on top, now if I am coming back from another and attempt to left click on the cropped window to activate it. It does not get sent to the top of "Z" window list, it remains behind other windows. I can only get it to the top of other window by clicking on the title bar of the GUI that is drawn on top of the window. Is it possible that when I left click anywhere on the cropped window, in order to activate it, it should also be made the top most window.


My AHK knowledge is limited, I don't mind learning classes and some OPP and figure your program out. Your code base is about 1000 lines. Either way your answers would help me allot in understanding your program.
User avatar
Hellbent
Posts: 2114
Joined: 23 Sep 2017, 13:34

Re: [Script] Dock-It ( window docker )

08 Jul 2023, 01:26

Gary-Atlan82 wrote:
07 Jul 2023, 12:57

After I crop a window, is the newly cropped window I am interacting with still the original window I started with or some other window you created?

I investigated the cropped window with the spy tool, it has all the identifiers as the original window. (Title, Exe etc) but then how are you achieving this cropped effect. I am confused on this.
It is your original window but it is made a child of another window.

It works by putting a window inside another window and then putting that window in yet another window.

Grandparent window > Parent Window ( the size you had set ) > Child window ( your target window )

.
dock it 1.gif
dock it 1.gif (17.79 KiB) Viewed 472 times
.

Here is another example that uses 4 layers instead of 3 ( Great-Grandparents / Great-Grandchildren )


.
pix 2.gif
pix 2.gif (84.54 KiB) Viewed 472 times
.


.
pix 1.gif
pix 1.gif (493.99 KiB) Viewed 472 times
.


Is it possible to treat the cropped window as a standard window? As in, its no different than any other window on the desktop. Currently when I crop a window, its set to always on top, I would like the window to just be a normal window.
The simplest way would be to replace Line 331 ( from op script )
with this new code ( or just edit it)

Code: Select all

This.MainWindow.Options := " -DPIScale "
And then add this code to line 175 ( in the "__New" method at the very bottom. After This._MoveChild() )

Code: Select all

WinActivate, % "ahk_id " This.MainWindow.Hwnd
With that you should be able to use alt+tab to bring the window up as well as having a "Untitled Gui" AHK icon in the taskbar for each instance.

Here is a hint at doing something more complicated.

Code: Select all


DockIndex := 0

F1::
	( ++DockIndex > DockIt.Docks.Length() ) ? ( DockIndex := 1 ) 
	WinActivate, % "ahk_id " DockIt.Docks[ DockIndex ].MainWindow.Hwnd 
	return
	
Hope that helps.
Gary-Atlan82
Posts: 74
Joined: 07 Mar 2023, 05:20

Re: [Script] Dock-It ( window docker )

08 Jul 2023, 05:56

@Hellbent This is much more information then I was hoping to get. Thank you so much for taking the time to answer my questions. I just have to say you are a genius for how you was able to achieve this.

Its perfect!
I will apply the changes you suggested and see how it goes.

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: Noitalommi_2 and 249 guests