Search found 20 matches

by Giresharu
06 Sep 2024, 01:31
Forum: Ask for Help (v2)
Topic: Can I determine if a audio output device exists by name?
Replies: 1
Views: 274

Can I determine if a audio output device exists by name?

I have used NirCmd to conveniently set audio devices, but since NirCmd does not provide the functionality to query all current audio devices.
by Giresharu
09 Aug 2024, 06:00
Forum: Ask for Help (v2)
Topic: “Access is denied” occurs under administrator privileges
Replies: 1
Views: 159

“Access is denied” occurs under administrator privileges

I discovered such a situation, but I don’t know the reason: When the window pointed to by hWnd becomes unresponsive, it is still possible for WinGetProcessName(hWnd) to throw an error “Access is denied”, even if my AHK script is running with administrator privileges. Since the unresponsive situation...
by Giresharu
23 Jun 2024, 11:41
Forum: Ask for Help (v2)
Topic: Target window not found when WinGetID("A")
Replies: 2
Views: 454

Target window not found when WinGetID("A")

Here's my code: previoursHWnd := 0 previoursPID := 0 loop { temp := A_DetectHiddenWindows A_DetectHiddenWindows := true ; FIXME throw Error: "Target window not found." when desktop or taskbar is active. hWnd := WinGetID("A") A_DetectHiddenWindows := temp ; Active window change if (hWnd && hWnd != pr...
by Giresharu
28 May 2024, 09:57
Forum: Ask for Help (v2)
Topic: Is there a way to read the value of a certain system setting in Win10? Topic is solved
Replies: 2
Views: 373

Re: Is there a way to read the value of a certain system setting in Win10? Topic is solved

teadrinker Thank you for your answer! In addition, I spend a few days searching search engines for answers before I ask questions, but I am always disturbed by irrelevant content, and maybe the keywords are not used correctly. I feel like ChatGPT is always a bit silly, I don't know if it's the reas...
by Giresharu
28 May 2024, 09:40
Forum: Ask for Help (v2)
Topic: The keyboard layout set by the SendMessage 0x50 message on Explorer is not persistent
Replies: 0
Views: 236

The keyboard layout set by the SendMessage 0x50 message on Explorer is not persistent

I consulted this issue on Microsoft’s Q&A platform a few days ago. Their staff said that they couldn’t reproduce the problem in C++ and believed that I was asking an XY question. However, my C++ skills are very poor, and my knowledge of programming is limited to game development scripts. I really do...
by Giresharu
28 May 2024, 04:47
Forum: Ask for Help (v2)
Topic: Is there a way to read the value of a certain system setting in Win10? Topic is solved
Replies: 2
Views: 373

Is there a way to read the value of a certain system setting in Win10? Topic is solved

For example, if I want to read/set `Let me use a different input method for each app window` in `Language`, what kind of API should I use?
If we are using the registry, how to know where a setting is in the registry?
by Giresharu
22 May 2024, 15:55
Forum: Ask for Help (v2)
Topic: How to modify the text in the GUI?
Replies: 3
Views: 343

Re: How to modify the text in the GUI?

boiler There seems to be a problem with writing this way, the initial string of myGui.Add determines the range of the text, if the initial text is very short, such as an empty string, and the rest of the code remains the same, Pressing ctrl will only show a "N". #Requires AutoHotkey v2.0 myGui := G...
by Giresharu
22 May 2024, 15:16
Forum: Ask for Help (v2)
Topic: How to modify the text in the GUI?
Replies: 3
Views: 343

How to modify the text in the GUI?

I tried using Gui.Destroy() and then creating a new Gui, but even if I destroy it and create a new window immediately, then show it right away, there is often a brief flicker. Is there any API that allows modifying the text without destroying the window? Here's my code of gui: Shift:: { static myGui...
by Giresharu
22 May 2024, 04:15
Forum: Ask for Help (v2)
Topic: How to modify the position of the GuiControl after Gui.Add? Topic is solved
Replies: 2
Views: 355

How to modify the position of the GuiControl after Gui.Add? Topic is solved

First, let me explain my goal: I want to display a small window with text centered on it, regardless of the specified text size. The window's size should remain fixed, even if the text cannot fit entirely. Adding +Center option in Gui.Add doesn't achieve this because it doesn't adjust the text posit...
by Giresharu
17 May 2024, 10:29
Forum: Ask for Help (v2)
Topic: Does the triggering of CapsLock's hotkey be faster than the change of the CapsLock state itself?
Replies: 2
Views: 284

Re: Does the triggering of CapsLock's hotkey be faster than the change of the CapsLock state itself?

@ Noitalommi_2
Oh, it looks like the problem might be with my keyboard.
Thank you for your answer!
by Giresharu
17 May 2024, 09:30
Forum: Ask for Help (v2)
Topic: Does the triggering of CapsLock's hotkey be faster than the change of the CapsLock state itself?
Replies: 2
Views: 284

Does the triggering of CapsLock's hotkey be faster than the change of the CapsLock state itself?

I currently have a requirement to record the CapsLock state for each process so that when I switch back, it can automatically restore. So, I want to implement a feature to record the CapsLock state when CapsLock is pressed. I tested it with the following code: ~CapsLock:: { ToolTip(GetKeyState("Caps...
by Giresharu
09 May 2024, 15:15
Forum: Ask for Help (v2)
Topic: How do you check for extra keys when LShift is set as the hotkey?
Replies: 7
Views: 477

Re: How do you check for extra keys when LShift is set as the hotkey?

mikeyww I need the ~LShift Up hotkey. What I mean is that I want to remain inactive during the timeout period, but react when it's not timed out and the Up key is pressed. After much research, I've figured out how to implement it, and here's what I've written so far. Do you have any suggestions for...
by Giresharu
09 May 2024, 09:29
Forum: Ask for Help (v2)
Topic: Is there a way to identify if Photoshop is in text editing mode?
Replies: 1
Views: 258

Is there a way to identify if Photoshop is in text editing mode?

I have tried using the code: control := ControlGetFocus("A") controlName := ControlGetClassNN(control) MsgBox(controlName) In the UI input field, I can recognize Control as EditX (where X is a number). However, if I use the Text tool on the canvas, Control displays as PSViewC34 , which is the same a...
by Giresharu
22 Apr 2024, 12:38
Forum: 请求帮助
Topic: 是否有办法切换同一个键盘布局(如简体中文)下的不同输入法?
Replies: 1
Views: 853

是否有办法切换同一个键盘布局(如简体中文)下的不同输入法?

我知道0x50的Message可以切换KBL

Code: Select all

SendMessage(0x50, , kblCode, , imeWinId, , , , 1000)
但是这样只能切换到那个键盘布局的默认IME,如果我想通过ahk切换五笔和拼音,应该用什么API来切换呢?
(除了映射到原本的快捷键这种方法)
by Giresharu
22 Apr 2024, 12:27
Forum: Ask for Help (v2)
Topic: Is there any way to switch IMEs in one KeyboardLayout?
Replies: 2
Views: 270

Is there any way to switch IMEs in one KeyboardLayout?

This code is known to toggle KeyboardLayout: SendMessage(0x50, , kblCode, , imeWinId, , , , 1000) It can switch the IME between English, Chinese, Japnese, and so on. But It can't specify which specific IME to use for the switching KeyboardLayout. In Chinese, there are often many different IMEs that ...
by Giresharu
16 Apr 2024, 13:06
Forum: Ask for Help (v2)
Topic: How do you check for extra keys when LShift is set as the hotkey?
Replies: 7
Views: 477

Re: How do you check for extra keys when LShift is set as the hotkey?

mikeyww Sorry, I was confused by some of the problems with this somewhat difficult api, so I didn't notice that InputHook can solve the problem of extra keys. But I still don't know the correct usage of InputHook: I tweaked the If statement in your code to call MsgBox when it's not Timeout, but it ...
by Giresharu
16 Apr 2024, 08:48
Forum: 请求帮助
Topic: 如何避免多余的按键被按下时的热键触发? Topic is solved
Replies: 1
Views: 1098

如何避免多余的按键被按下时的热键触发? Topic is solved

这是我的最短代码,

Code: Select all

~Shift & A:: {
    MsgBox("Pressed.")
}
结果当我按下 Ctrl+Shift+A 的时候,也会触发该热键,请问如何防止这类事情发生?
除了一个一个按键去 CheckKeyState ,每次都遍历100多个键位的话那效率也太低下了。
请问有什么办法能够限定,有且仅有指定按键触发时才执行呢?
by Giresharu
16 Apr 2024, 08:39
Forum: Ask for Help (v2)
Topic: How do you check for extra keys when LShift is set as the hotkey?
Replies: 7
Views: 477

Re: How do you check for extra keys when LShift is set as the hotkey?

mikeyww Oh, I wrote the KeyWait parameter wrong, now I changed it to KeyWait("Shift") without timeout. Also, thanks for telling me about A_PriorKey, which made my code work as expected. But then I suddenly realized a little thing: That is, A_PriorKey only returns A single key, and if I extend this ...
by Giresharu
16 Apr 2024, 07:51
Forum: Ask for Help (v2)
Topic: How do you check for extra keys when LShift is set as the hotkey?
Replies: 7
Views: 477

How do you check for extra keys when LShift is set as the hotkey?

Here is my minimul code: ~Shift:: { pressTick := A_TickCount KeyWait("Shift", 300) if (A_TickCount - pressTick >= 300) return MsgBox("Shift key pressed") } The result I expected was that the function was triggered when only a short Shift press was pressed, and not if an extra key was pressed. For ex...

Go to advanced search