Help! How to send clicks or keys to the CMsgBox function

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mtodd
Posts: 23
Joined: 21 Feb 2016, 19:31

Help! How to send clicks or keys to the CMsgBox function

27 Jul 2018, 18:31

I have used Custom MessageBox in several applications and like it.
I am trying to write a Tutorial which calls CMsgBox function and then is able to click any of the buttons on it.

The first button is named &Text. When I open the window, I can type a t or press the space bar and Button1, the Text named button is activated.
But, I have tried Send, ControlSend, ControlClick and cannot get any of them to work from another window. Doing Send, t will show the letter t on the following window.
I see CMsgBox has a loop that waits for buttons to be pressed. I've tried updating that also but to no avail.

If anyone uses this function regularly, can you try controlling it from another window and see what I'm talking about?

My CMsgBox code is simply:

AddType := CMsgBox("Add Item","Add which type of item?","*&Text|&Program|&Document|&Folder|&Link|&URL|&Batch|&Hotstring|&Cancel",,1)

I want to call this from one thread and activate any of the buttons from another window in the same program.

The original source code for Custom Messagebox is here https://autohotkey.com/board/topic/2957 ... m-buttons/
User avatar
divanebaba
Posts: 805
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: Help! How to send clicks or keys to the CMsgBox function

28 Jul 2018, 00:41

Try it with

Code: Select all

Control, Check,, Button1, Name of my CMsgBox Window
Which name to determine for the button, use WindowSpy.
Einfach nur ein toller Typ. :mrgreen:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: roysubs and 273 guests