#Anybody know anything about autohotkey guis? (AHK)

23 messages · Page 1 of 1 (latest)

narrow bluff
#

This is for autohotkey v2.1 alpha

My problem is. my gui draws onto another screen so when that screen is focused i have to double click one of my on screen gui buttons to activate it.

Basically its focusing my on screen gui thats drawn on the parent window. then i dont have to double click anymore if its focused.

How do i make it so I dont have to double click. Focus First then click if the parent window is focused is there a simple option or...

Should I make sure my GUI drawn onto the parent screen always maintains focus and never focuses the parent window and then i relay any normal action/command that would go to that window through the Gui?

Just curious if anybody knows thanks.

sleek siren
#
gui := Gui("+AlwaysOnTop +ToolWindow -Caption +E0x08000000") ; WS_EX_NOACTIVATE

btn := gui.AddButton("x10 y10 w120 h30", "Gang weed bottom text")
btn.OnEvent("Click", (*) => MsgBox("Clicked"))

OnMessage(0x21, WM_MOUSEACTIVATE)

WM_MOUSEACTIVATE(wParam, lParam, msg, hwnd) {
    ; 1=MA_ACTIVATE, 2=MA_ACTIVATEANDEAT, 3=MA_NOACTIVATE, 4=MA_NOACTIVATEANDEAT
    return 3 ; MA_NOACTIVATE
}

gui.Show("x100 y100")
#

haven't written ahk in ages but I think this should work?

#

also general disclaimer about AHK being garbage and making UIs in AHK is a massive pain and not worth it

narrow bluff
#

My UIs are actually very responsive. I Have made an editor that i am actually converting to a simple gui maker for ahk2. basically it looks like paint to add the forms, controls to then when its built if its an exe all the editor code is diabled so it just shows the gui i drag and dropped... If you need to add code to the button or menu item youd just put it in your autohotkey script Button|ActionName () {}

#

ill try it out and see if it becomes more responsive

#

At the moment you can just add buttons, pictures, text (drag to adjust size, can drag to position as well. the edit window lets you stylise - select options) everything saves to a json

#

2.1 alpha is pretty cool tbh doing it just to learn

sleek siren
#

Wasn't saying they're unresponsive or anything

#

Just saying AHK might not be the best choice kek

narrow bluff
#

What language should I learn?

#

id show you my ahk scripts if interested. they feel powerful to me.

#

im not sure what AHK would be similar to. im no professional programmer by any means but im not entirely dumb ive dabbled with coding since visual basic 3 when i was like 10 but i never stuck with anything and learned i know basics and how to get things to work. and if i see how something is done from an example code i can usually figure out how to make it work for myself.

hot hawkBOT
#

@narrow bluff

File Attachments Not Allowed

For safety reasons we do not allow files with certain file extensions.

xerpage Said

This is my gui im working on that im trying to fix the double click issue with

Code Formatting

You can share your code using triple backticks like this:
```
YOUR CODE
```

Large Portions of Code

For longer scripts use a code hosting platform like GitHub Gists and share the link here

Ignored these files due to them having disallowed file extensions
  • New_Test_Gui.ahk
narrow bluff
#

ah

#

cant send attachments here nevermind

sleek siren
#

just rename the .ahk to .txt and it'll work

narrow bluff
hot hawkBOT
#

-# :warning: Files from unknown sources can be dangerous. Download with care. :warning:

narrow bluff
#

Thats the kind of stuff i do.

rough tulip
#

Yeah I love AHK for quick hacks and things but I've never had call for dialogs.
Heck I once wrote an AHK script to watch for running applications and set core affinities per-app in the background, zero dialogs needed.. Even if it might have been nice to configure the app settings/affinities with a GUI. 😛

narrow bluff
#

Yeah if im using it for personal use an not an eventual distro my guis are nonexistant/minimal.. usually an onscreen statusbar saying if somethings enabled or traytip notifications and rightclick menu/w submenus and hotkeys