Page 1 of 1

AHK, Actual Window Manager, Everything

Posted: Sun Jan 30, 2022 5:05 am
by adamantine
i decided at least to try to lower my heavy dependence on the Actual Window Manager program (my version was released in march-2012)
(at this forum) there were some explanations recently: first link, second link
probably, someday i will post a similar topic at the ahk-forum

it should be noted again that the idea is very complex
and seemingly, it's not realizable wholly (if we speak about all awm-features that i use)

generally, the aim is to completely forget about awm (by substituting it with the numerous small/medium ahk-codes)
but currently, there should be just some start

 
first of all, i would like to know the opinions (get some useful technical advices) of those people who have substantial knowledge about ahk
(it's better if they also know what awm is, and what its vast possibilities are)

maybe the ahk-help contains some necessary info (in particular, at the List of Windows Messages page)

 
the above-mentioned first link enumerates many typical needs (features of awm)
(that link is related to my awm-rules which deal with the et program, and with its 2 sub-windows: advanced search, organize bookmarks)
those 3 et-related cases/rules are described in a very detailed form (nearly as much as possible)

as a whole, my awm-setup has circa 90 window rules. 4 of them are about et only
including the relatively new 'index journal' window rule. it contains not so many settings added by me:

1. (target window) window class: #32770
2. (target window) window caption: Index Journal     (substring match: yes) (exact match: no) (regular expression: no)
3. (target window) program: \Everything.exe

4. (at window startup) resize: 1897x898
5. (at window startup) align: top-left, horizontal shift - 0, vertical shift - 321
6. (at window startup) stay always on top: always
7. (at window startup) run keyboard macro: <Tab><Win+End> (delay before running: 0,1s) (Win+End means just End here: it's a work around)

8. (at window startup) the super-important block premature appearance of window option: yes
           this option's tool-tip says: delay window's appearance until all startup actions which affect window's look
                                                  (such as align, resize, move to monitor) are applied
                                                  to prevent the unwanted 'window jumping' effect

9. (size) resize window automatically: at startup to: width - 1897, height - 898
10. (title buttons) stay always on top: yes (17 other actions: no)

(via an ahk-code) how to achieve the same functionality (items 1-10) for the 'index journal' window?

Re: AHK, Actual Window Manager, Everything

Posted: Fri Feb 04, 2022 4:49 am
by adamantine
i managed to get some patterns working
these patterns/examples may become useful in my further attempts (described in the previous message) to migrate from awm to ahk

example 1 (works):

Code: Select all

DetectHiddenWindows, On
q::
Run C:\WINDOWS\system32\charmap.exe,,HIDE,PID
WinWaitActive, ahk_class MyDlgClass ahk_exe charmap.exe
send {tab 3}
WinShow ahk_class MyDlgClass ahk_pid %PID%
return
after i press the q button, the Character Map window appears (hidden)
then it successfully receives my command (the window is still in a hidden state)
and only after that the window becomes visible

 
example 2 (works):

Code: Select all

#Persistent
SetBatchLines, -1
SetWinDelay, -1

Gui +LastFound
hWnd := WinExist()

DllCall( "RegisterShellHookWindow", UInt,hWnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )

OnMessage( MsgNum, "ShellMessage" )
return

ShellMessage( wParam,lParam )
{
    if ( wParam = 1 ) ;  HSHELL_WINDOWCREATED := 1
    {
        WinGetTitle, title, ahk_id %lParam%
        if ( title = "Character Map" )
             {
             sleep 1000
             send {tab 3}
             }
        if ( title = "WinSpy" )
             {
             sleep 2000
             send {tab 4}
             }
    }
}
2 various windows/programs (Character Map and WinSpy) successfully receive my different commands
(it automatically happens after those windows appear: i don't need to press any button)

 
example 3 (nearly identical to example 2) (doesn't work):

Code: Select all

#Persistent
SetBatchLines, -1
SetWinDelay, -1

Gui +LastFound
hWnd := WinExist()

DllCall( "RegisterShellHookWindow", UInt,hWnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )

OnMessage( MsgNum, "ShellMessage" )
return

ShellMessage( wParam,lParam )
{
    if ( wParam = 1 ) ;  HSHELL_WINDOWCREATED := 1
    {
        WinGetTitle, title, ahk_id %lParam%
        if  ( title = "Add New Torrent" )
             {
             sleep 2000
             send {tab}
             }
        if  ( title = "Character Map" )
             {
             sleep 1000
             send {tab 3}
             }
    }
}
the u-torrent program has its main window (which is present in taskbar) (the caption is µTorrent 1.6.1), and its Add New Torrent sub-window (which only appears from time to time) (it is always absent in taskbar) (the caption is Add New Torrent)

but this approach doesn't work (the Character Map part works, the Add New Torrent part doesn't)
(if i disable my corresponding rules in the awm program, then the issue persists)

i may be wrong but it seems that the ahk code cannot recognize this Add New Torrent sub-window because it's not a part of taskbar
but most likely, the solution should exist. do you have any ideas?

Re: AHK, Actual Window Manager, Everything

Posted: Wed Oct 19, 2022 3:53 pm
by sauljhl
did you post in the AHK forum, i suspect you might get more traction there?

Re: AHK, Actual Window Manager, Everything

Posted: Wed Oct 19, 2022 3:57 pm
by sauljhl
See this subforum, do some searches in it & its subforums
https://www.autohotkey.com/boards/viewforum.php?f=4

Re: AHK, Actual Window Manager, Everything

Posted: Fri Oct 21, 2022 10:02 am
by adamantine
AHK forum is very indifferent
fresh example

Re: AHK, Actual Window Manager, Everything

Posted: Fri Oct 21, 2022 4:40 pm
by sauljhl
LOL, well, it certainly looks like you've been dogged/persistent, best of luck!

Re: AHK, Actual Window Manager, Everything

Posted: Sun Oct 30, 2022 11:16 pm
by Immutabl3
adamantine wrote: Fri Oct 21, 2022 10:02 am AHK forum is very indifferent
fresh example
Hi Adamantine, I randomly came across this post and also read the stuff you linked to on AHK forum. I was annoyed at the lack of response you received over there and decided to create an account here to let you know I might be able to assist. I run a similar workflow of custom window placement along with taskbar hiding/removal and also have source code for both.

Re: AHK, Actual Window Manager, Everything

Posted: Sun Oct 30, 2022 11:24 pm
by adamantine
to let you know I might be able to assist
- thank you for your kind words
- i hope that we'll manage to do something useful in that ahk-topic

Re: AHK, Actual Window Manager, Everything

Posted: Sat Nov 05, 2022 5:52 am
by sauljhl
Thanks for sharing here; I will follow you both with curiosity/interest in the ahk thread!