Search found 1752 matches
- Today, 17:52
- Forum: Ask for Help (v2)
- Topic: CheckColor / WaitColor - Color names of HEX color
- Replies: 8
- Views: 112
Re: CheckColor / WaitColor - Color names of HEX color
This code work! (with Sleep 1000 ) #Requires Autohotkey 2.0 #SingleInstance Force CoordMode 'Pixel', 'Window' Run 'notepad.exe',,, &tstPID WinWaitActive 'ahk_pid ' tstPID Sleep 1000 Color := PixelGetColor( 40, 20 ) MsgBox '(0x87C5D2) => ' Color This code doesn't work (without Sleep ) #Requires Autoh...
- Today, 14:54
- Forum: Ask for Help (v2)
- Topic: CheckColor / WaitColor - Color names of HEX color
- Replies: 8
- Views: 112
Re: CheckColor / WaitColor - Color names of HEX color
I find it difficult to know when a window has been opened. I haven't found the right solution. This doesn't work. 1) Run 'notepad.exe',,, &tstPID 2) if !WinWaitActive(WinName,, actMin) 3) if PixelSearch(&Px, &Py, xPos1, yPos1, xPos2, yPos2, hexColor, cDiff ) This works! 1) Run 'notepad.exe',,, &tstP...
- Today, 11:23
- Forum: Ask for Help (v2)
- Topic: CheckColor / WaitColor - Color names of HEX color
- Replies: 8
- Views: 112
Re: CheckColor / WaitColor - Color names of HEX color
OK!
Thank you!
Thank you!
- Today, 10:31
- Forum: Ask for Help (v2)
- Topic: CheckColor / WaitColor - Color names of HEX color
- Replies: 8
- Views: 112
Re: CheckColor / WaitColor - Color names of HEX color
I try to understand...
If I add this instructions .:
The HEX values have been converted to decimal numbers (which was a surprise)
Does it always happen?
Is it easy to know if a variable contains a HEX number?
If I add this instructions .:
Code: Select all
For key, value in ColorValues
res .= key`t' = `t' value '`n'
MsgBox res
Does it always happen?
Is it easy to know if a variable contains a HEX number?
- 11 Apr 2024, 10:42
- Forum: Ask for Help (v2)
- Topic: Open a website and log in with username and password
- Replies: 0
- Views: 36
Open a website and log in with username and password
Hi! My wish is to be able to open a web page, and then fill in the user and password in the correct fields. And confirm this by AHK pressing a button. Wait until the login is completed. All this should be done by running an AHK script. Now it is not possible to test this on the desired web page with...
- 26 Mar 2024, 11:57
- Forum: Tutorials (v2)
- Topic: Detect window open and close
- Replies: 15
- Views: 5098
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...
- 26 Mar 2024, 09:10
- Forum: Ask for Help (v2)
- Topic: CheckColor / WaitColor - Color names of HEX color
- Replies: 8
- Views: 112
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...
- 26 Mar 2024, 07:40
- Forum: Tutorials (v2)
- Topic: Detect window open and close
- Replies: 15
- Views: 5098
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 {...
- 25 Mar 2024, 10:03
- Forum: Tutorials (v2)
- Topic: Detect window open and close
- Replies: 15
- Views: 5098
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...
- 15 Mar 2024, 17:26
- Forum: Ask for Help (v2)
- Topic: Manage dual GUIs
- Replies: 9
- Views: 223
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...
- 14 Mar 2024, 17:03
- Forum: Ask for Help (v2)
- Topic: UseErrorLevel -> try / catch Topic is solved
- Replies: 1
- Views: 82
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...
- 14 Mar 2024, 15:47
- Forum: Ask for Help (v2)
- Topic: Manage dual GUIs
- Replies: 9
- Views: 223
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...
- 14 Mar 2024, 13:17
- Forum: Ask for Help (v2)
- Topic: Manage dual GUIs
- Replies: 9
- Views: 223
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...
- 14 Mar 2024, 11:36
- Forum: Ask for Help (v2)
- Topic: Manage dual GUIs
- Replies: 9
- Views: 223
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 :=...
- 14 Mar 2024, 06:34
- Forum: Ask for Help (v2)
- Topic: Manage dual GUIs
- Replies: 9
- Views: 223
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...
- 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 ...
- 13 Feb 2024, 18:43
- Forum: Ask for Help (v2)
- Topic: Handle starting AHK scripts multiple times
- Replies: 11
- Views: 271
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!)
Is this the only way?
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 )
- 13 Feb 2024, 08:23
- Forum: Ask for Help (v2)
- Topic: Handle starting AHK scripts multiple times
- Replies: 11
- Views: 271
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 ...
- 13 Feb 2024, 06:39
- Forum: Ask for Help (v2)
- Topic: Handle starting AHK scripts multiple times
- Replies: 11
- Views: 271
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...
- 11 Feb 2024, 04:06
- Forum: Ask for Help (v2)
- Topic: Handle starting AHK scripts multiple times
- Replies: 11
- Views: 271
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 ...