Using ClassNN
-
- Posts: 84
- Joined: 23 Apr 2023, 13:03
Using ClassNN
Is it possible to use ClassNN to perform a certain function? Every program has a text box called ClassNN. I would like to click with the left mouse button on the given ClassNN and perform the ^v. it's possible?
Re: Using ClassNN
Not every program has those text box controls. And the control is not called ClassNN. Some have a text box control which have a ClassNN name (where Class is the type of control and NN is the particular number), but the ClassNN is how the actual control name is referred to. You can find out the actual ClassNN name using the Window Spy tool.Felix Siano wrote: ↑ Every program has a text box called ClassNN.
You could have a script continuously check the control that has focus of the active window, and when it has a certain ClassNN, the script could send ^v.Felix Siano wrote: ↑ I would like to click with the left mouse button on the given ClassNN and perform the ^v. it's possible?
-
- Posts: 84
- Joined: 23 Apr 2023, 13:03
Re: Using ClassNN
using Whatsapp as an example: ClassNN: ApplicationFrameInputSinkWindow1 this is the name of the conversations search box. Can you do it?
Re: Using ClassNN
I don't have WhatsApp installed, but here's an example using Notepad. It pastes the clipboard when its text entry control whose ClassNN is "Edit1" is clicked:
Code: Select all
#Requires AutoHotkey v2.0
#HotIf WinActive("ahk_exe notepad.exe") && ControlGetClassNN(ControlGetFocus("ahk_exe notepad.exe")) = "Edit1"
~LButton up::Send "^v"
-
- Posts: 84
- Joined: 23 Apr 2023, 13:03
Re: Using ClassNN
It worked here!! THANK YOU VERY MUCH! I've been trying to do this for a long time! YOU ARE GREAT!
-
- Posts: 84
- Joined: 23 Apr 2023, 13:03
Re: Using ClassNN
Perfect! You are great! It worked here.
But can you use Send with %Clipboard%?
Put what's on the clipboard.
But can you use Send with %Clipboard%?
Put what's on the clipboard.
Re: Using ClassNN
In v2, it’s not Send %Clipboard%. It’s Send A_Clipboard. Everything is expressions, and the name of the clipboard variable has changed. Yes, you can send it if you want. I don’t know why you would want to do that instead of pasting. It’s more reliable.
-
- Posts: 84
- Joined: 23 Apr 2023, 13:03
Re: Using ClassNN
There is a ClassNN that only accepts the send with the text that is in the transfer area. That's why it has to be Send A_Clipboard instead of Send "^v"
-
- Posts: 84
- Joined: 23 Apr 2023, 13:03
Re: Using ClassNN
Code: Select all
#Requires AutoHotkey v2.0
#HotIf WinActive("ahk_exe notepad.exe") && ControlGetClassNN(ControlGetFocus("ahk_exe notepad.exe")) = "Edit1"
RButton up::Send "^v"
[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]
Re: Using ClassNN
Code: Select all
RButton up::Send "{Click}^v"
-
- Posts: 84
- Joined: 23 Apr 2023, 13:03
Re: Using ClassNN
Could you give me one more help? I'm trying to use it in the program, but the error. I will try to send the prints
- Attachments
-
- SAVE_20230620_245506.jpg (20.09 KiB) Viewed 1296 times
-
- IMG_20230620_005728.jpg (33.49 KiB) Viewed 1296 times
Re: Using ClassNN
I’m not sure since you haven’t shown the whole line of code. I would try a script that just does this and nothing else and see what it says:
Code: Select all
MsgBox WinExist("ahk_exe NFe.exe")
-
- Posts: 84
- Joined: 23 Apr 2023, 13:03
Re: Using ClassNN
Code: Select all
#Requires AutoHotkey v2.0
#HotIf WinActive("ahk_exe NF.exe") && ControlGetClassNN(ControlGetFocus("ahk_exe NF.exe")) = "TcxGroupBox1"
~LButton up::Send "^v"
[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]
Re: Using ClassNN
You didn't reproduce the process name correctly. You have NF.exe and you showed it's NFe.exe. I don't know why it would be different than what the error message showed you had before.
Please use [code][/code] tags when posting code.
Please use [code][/code] tags when posting code.
-
- Posts: 84
- Joined: 23 Apr 2023, 13:03
Re: Using ClassNN
forgiveness! The code that gives the error is correct. I made a mistake sending you
#Requires AutoHotkey v2.0
#HotIf WinActive("ahk_exe NFe.exe") && ControlGetClassNN(ControlGetFocus("ahk_exe NFe.exe")) = "TcxGroupBox1"
~LButton up::Send "^v"
#Requires AutoHotkey v2.0
#HotIf WinActive("ahk_exe NFe.exe") && ControlGetClassNN(ControlGetFocus("ahk_exe NFe.exe")) = "TcxGroupBox1"
~LButton up::Send "^v"
-
- Posts: 84
- Joined: 23 Apr 2023, 13:03
Re: Using ClassNN
I'm sorry. I will use
Code: Select all
Re: Using ClassNN
Did you try this suggestion?
boiler wrote: ↑20 Jun 2023, 02:37I would try a script that just does this and nothing else and see what it says:
Code: Select all
MsgBox WinExist("ahk_exe NFe.exe")
-
- Posts: 84
- Joined: 23 Apr 2023, 13:03
Re: Using ClassNN
Is it possible to use the window title together with ClassNN:?
I used it as below. But it only works on: ahk_exe ***.exe
And a way to ignore the error I sent you earlier? I tried to read the documentation but it's difficult. The translation is not very good. Would you help me?
I used it as below. But it only works on: ahk_exe ***.exe
And a way to ignore the error I sent you earlier? I tried to read the documentation but it's difficult. The translation is not very good. Would you help me?
Code: Select all
#Requires AutoHotkey v2.0
~LButton::
{
SetTitleMatchMode(2)
If (WinActive("ahk_exe ApplicationFrameHost.exe") && ControlGetClassNN(ControlGetFocus("ahk_exe ApplicationFrameHost.exe")) = "ApplicationFrameInputSinkWindow1")
if RegExMatch(A_Clipboard, "^\d{5,6}$"){
Send(A_Clipboard)
}
}
- Attachments
-
- clans.png (30.95 KiB) Viewed 778 times
Re: Using ClassNN
No, if the ClassNN of some control is ApplicationFrameHost, then you don’t use it in a WinTitle parameter as ahk_exe ApplicationFrameHost.exe or any other way. Why would you try to use that anyway? Use only the information from the top section of Window Spy for the WinTitle parameter.
Make sure you have correct code before you try ignoring error messages. Right now, the error messages are your friend because it’s telling you when you are doing things wrong like what your just posted.
Also, you’re making it very confusing by showing a Window Spy example that has title and control info totally different than what’s in your code, so it’s not possible to advise you what to use because I can’t tell which actually matches the window and control of interest.
Make sure you have correct code before you try ignoring error messages. Right now, the error messages are your friend because it’s telling you when you are doing things wrong like what your just posted.
Also, you’re making it very confusing by showing a Window Spy example that has title and control info totally different than what’s in your code, so it’s not possible to advise you what to use because I can’t tell which actually matches the window and control of interest.
-
- Posts: 84
- Joined: 23 Apr 2023, 13:03
Re: Using ClassNN
sorry. I didn't pay attention to the error of the image and the code being different.
I use Google Translate to interact and everything becomes more difficult to understand and clear my doubts.
I use Google Translate to interact and everything becomes more difficult to understand and clear my doubts.