Some script questions

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
reluct
Posts: 134
Joined: 28 Nov 2018, 05:07

Some script questions

29 Oct 2019, 16:05

Code: Select all

$1::
PixelGetColor, color, 56, 284, RGB
If color = 0x008000
{
    WinRestore, ahk_exe AkelPad.exe
    IfWinNotActive ahk_class QWidget
    {
        WinActivate, ^.*Engvidshortcut.*$
    }
    Send 1
    ControlClick, x60 y150, ahk_class QWidget,, Left, 1, NA


1. Why does WinActivate, ^.*Engvidshortcut.*$ work even though there is no SetTitleMatchMode, RegEx command at the beginning of the script?
2. Why does WinActivate, ^. * Engvidshortcut. * $ оnly work if I use IfWinNotActive ahk_class QWidget? (ahk_class QWidget and WinActivate, ^. * Engvidshortcut. * $ are equivalent).
3. Why does WinRestore, ahk_exe AkelPad.exe restore the window only if the command WinMinimize, ahk_exe AkelPad.exe was used before? If I just minimize the window by clicking in the upper right corner, then WinRestore, ahk_exe AkelPad.exe does not work.
4. And the last question, why is ControlClick, x60 y150, ahk_class QWidget,, Left, 1, NA not working if the window is not active?
User avatar
rommmcek
Posts: 1475
Joined: 15 Aug 2014, 15:18

Re: Some script questions

30 Oct 2019, 13:12

@1. Works for me correctly.
@2. Definitely wrong syntax. Generally wrong syntax might work sometimes.
@3. Works for me, but:
WinRestore wrote:If a particular type of window does not respond correctly to WinRestore, try using the following instead:
PostMessage, 0x112, 0xF120,,, WinTitle, WinText ; 0x112 = WM_SYSCOMMAND, 0xF120 = SC_RESTORE
@4.
ControlClick-Reliability wrote:NA avoids marking the target window...~. However, this method might not work for all types of windows and controls.
P.s: Don't be too picky!
reluct
Posts: 134
Joined: 28 Nov 2018, 05:07

Re: Some script questions

01 Nov 2019, 11:39

rommmcek wrote:
30 Oct 2019, 13:12
@2. Definitely wrong syntax. Generally wrong syntax might work sometimes.
Sorry did not see the message
What will the correct syntax look like?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Araphen and 421 guests