Search found 1747 matches

by Albireo
26 Mar 2024, 11:57
Forum: Tutorials (v2)
Topic: Detect window open and close
Replies: 15
Views: 4782

Re: Detect window open and close

@Albireo the purpose of this library is to replace Win... functions with non-blocking ones: while WinWaitActive and such block script execution until the window is in the desired state, WinEvent.Active lets the program do other stuff in the meanwhile and responds only when the window reaches the de...
by Albireo
26 Mar 2024, 09:10
Forum: Ask for Help (v2)
Topic: CheckColor / WaitColor - Color names of HEX color
Replies: 1
Views: 58

CheckColor / WaitColor - Color names of HEX color

Hi! I want two functions() to handle colors. Check Color() - Reads a color on one dot. and WaitColor() - Waits until a certain color occurs at the specified coordinate. At the same time, I want to be able to name certain colors (estimated 10-20 pcs) in the call of the function(). eg. #FF0000 = Red a...
by Albireo
26 Mar 2024, 07:40
Forum: Tutorials (v2)
Topic: Detect window open and close
Replies: 15
Views: 4782

Re: Detect window open and close

Thank you Descolada ! It works (in some way.) But if I add the instruction MsgBox "Next!" (after the structure above) #requires AutoHotkey v2 #include WinEvent.ahk WinEvent.Show(AIMS_Showed, "AIMS ahk_exe !!!!.exe ahk_class TShellForm", 1) Try Run aProg.file, aProg.path, "Max", &AimsPID catch as e {...
by Albireo
25 Mar 2024, 10:03
Forum: Tutorials (v2)
Topic: Detect window open and close
Replies: 15
Views: 4782

Re: Detect window open and close

Many good examples (of a rather difficult problem) One question is .: When has a program started? In order to control the program I am currently working on, the window must be visible on the screen. Now I do it in this way .: ... Try Run aProg.file, aProg.path, "Max", &AimsPID catch as e { MsgBox "E...
by Albireo
15 Mar 2024, 17:26
Forum: Ask for Help (v2)
Topic: Manage dual GUIs
Replies: 9
Views: 213

Re: Manage dual GUIs

Yes, but... Summary 1) Transferring information between Gui functions? (Without making GUIs Global) 2) Gray out a Gui that is disabled - Possible? - How? Description If I use one of your example scripts, which is slightly modified, you might understand my problem. #Requires AutoHotkey v2.0 #SingleIn...
by Albireo
14 Mar 2024, 17:03
Forum: Ask for Help (v2)
Topic: UseErrorLevel -> try / catch Topic is solved
Replies: 1
Views: 79

UseErrorLevel -> try / catch Topic is solved

Hello! In AHK v1 I used UseErrorLevel in the Run instruction. Now I thought I'd try using try / catch Something similar to this .: try Run C:\Program Files (x86)\...ABC.exe, C:\Program Files (x86)\...\bin, Max, AimsPID catch as e ; Handles the first error thrown by the block above. { MsgBox "An erro...
by Albireo
14 Mar 2024, 15:47
Forum: Ask for Help (v2)
Topic: Manage dual GUIs
Replies: 9
Views: 213

Re: Manage dual GUIs

#Requires AutoHotkey v2.0 #SingleInstance force init ExitApp init() { Static fontSize := 10, width := 330, height := 200 gui_Close := (gui) => (main.Opt('-Disabled'), gui.Hide()) main := Gui('-DPIScale', 'Main'), main.SetFont('s' fontSize) main.AddButton('w' width, 'Help').OnEvent('Click', btn_Clic...
by Albireo
14 Mar 2024, 13:17
Forum: Ask for Help (v2)
Topic: Manage dual GUIs
Replies: 9
Views: 213

Re: Manage dual GUIs

You like to create short programs :? (but I'm getting better and better at reading these) One of my objections this time is that the function init() is executed, and the program code "runs" on. if the code lock like this #Requires AutoHotkey v2.0 init(), ExitApp init(){ } I got the same result In th...
by Albireo
14 Mar 2024, 11:36
Forum: Ask for Help (v2)
Topic: Manage dual GUIs
Replies: 9
Views: 213

Re: Manage dual GUIs

Thanks! It doesn't quite work the way I want it to. a) the main gui is not in a function() b) the help gui is not (always) placed ovet the main gui #Requires AutoHotkey v2.0 #SingleInstance Force funcGui("Main") ExitApp funcGui(Title) { ; Main GUI aSize := {} aSize.x := 150 aSize.y := 150 aSize.w :=...
by Albireo
14 Mar 2024, 06:34
Forum: Ask for Help (v2)
Topic: Manage dual GUIs
Replies: 9
Views: 213

Manage dual GUIs

Hi! My desire is to create a main-GUI in a function() (no problem) The main-GUI have a Button, and when the Button is pressed, a second Gui in another function() is opened. (now the second Gui (as function()) is inside the first Gui (function()) - maybe it's better to place the second Gui-function o...
by Albireo
29 Feb 2024, 12:43
Forum: Ask for Help (v2)
Topic: Change icon in the toolbar - Windows
Replies: 0
Views: 168

Change icon in the toolbar - Windows

Hi! I have written an AHK program that starts another program. Deciding which icon to display on the desktop is easy. But when the other program is launched, it has got a different / unknown icon in the taskbar (at the bottom of the screen). Is it possible to get the same icon/symbol on the desktop ...
by Albireo
13 Feb 2024, 18:43
Forum: Ask for Help (v2)
Topic: Handle starting AHK scripts multiple times
Replies: 11
Views: 263

Re: Handle starting AHK scripts multiple times

Thank you!
Sorry, didn't test your suggestion well enough. It works!

I had a problem with the IF statement. My desire is to do something like this (it doesn't work!)

Code: Select all

If ( hWnd <> A_ScriptHwnd )

Is this the only way?

Code: Select all

If ( hWnd < A_ScriptHwnd ) or ( hWnd > A_ScriptHwnd )
by Albireo
13 Feb 2024, 08:23
Forum: Ask for Help (v2)
Topic: Handle starting AHK scripts multiple times
Replies: 11
Views: 263

Re: Handle starting AHK scripts multiple times

Thanks! #Requires AutoHotkey v2.0 #SingleInstance off MsgBox "This script's PID:`n`n" WinGetPID(A_ScriptHwnd), 'PID', 'Iconi' The advantage of PID is that it is possible to control e.g. with Task Manager. (no idea how to see HWND in Windows) #Singleinstance off - No question is asked if the program ...
by Albireo
13 Feb 2024, 06:39
Forum: Ask for Help (v2)
Topic: Handle starting AHK scripts multiple times
Replies: 11
Views: 263

Re: Handle starting AHK scripts multiple times

thank you! I think my request can be solved in several ways. But to perhaps get a slightly clearer solution strategy - I think like this .: (right now I skip the handling of prog.exe and a AHK-script running as administrator - previously described) Now - Only one Script.ahk can be run at a time. But...
by Albireo
11 Feb 2024, 04:06
Forum: Ask for Help (v2)
Topic: Handle starting AHK scripts multiple times
Replies: 11
Views: 263

Re: Handle starting AHK scripts multiple times

If prog.exe is running - I think I can identify it in Task Manager. If someone tries to start Prog.exe, once again prog.exe will crash. in that case a message to the user is desired - possibly activate Prog.exe, that is already running. I'm not sure if Script.ahk needs to be run as administrator to ...
by Albireo
10 Feb 2024, 19:43
Forum: Ask for Help (v2)
Topic: Handle starting AHK scripts multiple times
Replies: 11
Views: 263

Re: Handle starting AHK scripts multiple times

I don't think I understand your idea. Looked in the task manager (win 10), and AHK 2.0 seems to be presented in another (better?) way. One example - Script.ahk (as administrator) starts Prog.exe, - Script.ahk exits. - Prog.exe is later terminated manually. Or - Script.ahk starts Prog.exe, - Script.a...
by Albireo
10 Feb 2024, 05:41
Forum: Ask for Help (v2)
Topic: Handle starting AHK scripts multiple times
Replies: 11
Views: 263

Handle starting AHK scripts multiple times

There are a few different requests that may arise when an AHK program is started. My questions .: I) Is it possible to automatically terminate an AHK script, which is run as administrator? (2b below) and start a new instance? II) Is it possible to check if the AHK script is already running before? (...
by Albireo
08 Feb 2024, 18:20
Forum: Ask for Help (v2)
Topic: Dynamic resize and remove the windows header on a GUI Topic is solved
Replies: 9
Views: 294

Re: Dynamic resize and remove the windows header on a GUI Topic is solved

My example was pretty straightforward
Often the GUI window contains other information that is not dynamic.
ex. a headline and an image (logo) or similar.
Does redraw of the GUI window complicate the solution?
(Wondering if I can think of any good/illustrative examples)
by Albireo
08 Feb 2024, 08:13
Forum: Ask for Help (v2)
Topic: Dynamic resize and remove the windows header on a GUI Topic is solved
Replies: 9
Views: 294

Re: Dynamic resize and remove the windows header on a GUI Topic is solved

Thank you! (both of you)
What great possibilities with Gui in version 2 (which v1 lacked)
Would have preferred to put "accepted" on both solutions. But it has to be @mikeyww because that solution will suit me better - right now.
by Albireo
07 Feb 2024, 18:51
Forum: Ask for Help (v2)
Topic: Dynamic resize and remove the windows header on a GUI Topic is solved
Replies: 9
Views: 294

Dynamic resize and remove the windows header on a GUI Topic is solved

Tried to write a little program to describe my desires This GUI example works (in some sense) #Requires AutoHotkey v2.0 #SingleInstance force dynGui := Gui( , "Dynamic GUI") dynGui.SetFont("cBlue Bold s20", "Verdana") ; dynGui.AddText("x30 y30 h25" , "This text has `na variable length!") dynGui.AddT...

Go to advanced search