Search found 28 matches

by wz520
07 Feb 2019, 06:25
Forum: Forum Issues
Topic: Where is the Chinese Forum ?
Replies: 68
Views: 9187

Re: Where is the Chinese Forum ?

IMHO, making that forum unwritable(cannot post) instead of inaccessible would be better. (until a moderator found)
by wz520
26 Nov 2018, 03:59
Forum: 请求帮助
Topic: 請問如何計算出文件夾中檔案的數量
Replies: 1
Views: 705

Re: 請問如何計算出文件夾中檔案的數量

Code: Select all

getFilesCount(file_pattern) {
	count := 0
	loop, %file_pattern%, 0, 1
	{
		count++
	}
	return count
}

msgbox % getFilesCount("C:\a\*.pdf")
msgbox % getFilesCount("C:\b\*.pdf")
by wz520
15 Jul 2016, 22:12
Forum: Ask For Help
Topic: Check text size Topic is solved
Replies: 6
Views: 1209

Re: Check text size Topic is solved

You don't need to do this by yourself, just specify "Limit" option when you add an edit control.

Code: Select all

Gui, Add, Edit, Limit10 vMyEdit
This would allow no more than 10 characters to be entered.
by wz520
13 Jul 2016, 11:18
Forum: 请求帮助
Topic: 哪里能找到支持NT4.0的autohotkey版本 Topic is solved
Replies: 1
Views: 1423

Re: 哪里能找到支持NT4.0的autohotkey版本 Topic is solved

AHK Basic 支持 9x/NT ,最后的版本号是 1.0.48.05
这里应该能下: https://autohotkey.com/download/1.0/
by wz520
21 Jun 2016, 02:33
Forum: 请求帮助
Topic: 【已解决】有没有操作已经打开的Excel表的例子? Topic is solved
Replies: 5
Views: 2519

Re: 有没有操作已经打开的Excel表的例子? Topic is solved

nams wrote:我自己的代码是下面这样,不知道能否帮到你
经测试很有用,非常感谢!~ :bravo:
原来把 ComObjCreate 换成 ComObjActive 就行了,这么简单,学习了~
by wz520
15 Jun 2016, 22:01
Forum: 请求帮助
Topic: 【已解决】有没有操作已经打开的Excel表的例子? Topic is solved
Replies: 5
Views: 2519

Re: 有没有操作已经打开的Excel表的例子? Topic is solved

Marcosa1020 wrote:這裡有一些說明:https://autohotkey.com/boards/viewtopic.php?f=29&t=4256
谢谢,但是正像我所说的,这个方法就是把启动 Excel 到关闭 Excel 一步到位了。
我要的不是这个,我希望是对任何已经打开的 EXCEL 窗口里的表格进行COM操作,而不是另开一个单独的EXCEL进行操作。
by wz520
11 Jun 2016, 04:43
Forum: Ask For Help
Topic: [Solved] OnMessage(WM_INITPOPUPMENU) doesn't work
Replies: 13
Views: 2621

Re: OnMessage(WM_INITPOPUPMENU) doesn't work

Hi, Commenting out the if (!INTERRUPTIBLE_IN_EMERGENCY) return false; lines in MsgMonitor() inside AutoHotkey_L's application.cpp is actually enough to make OnMessage(WM_INITMENUPOPUP) work. INTERRUPTIBLE_IN_EMERGENCY checks to see if a menu is being displayed at that point, which what lifeweaver w...
by wz520
10 Jun 2016, 02:23
Forum: Ask For Help
Topic: [Solved] OnMessage(WM_INITPOPUPMENU) doesn't work
Replies: 13
Views: 2621

Re: OnMessage(WM_INITPOPUPMENU) doesn't work

Enable, MenuItemName : Allows the user to once again select MenuItemName if was previously disabled (grayed). Disable, MenuItemName : Changes MenuItemName to a gray color to indicate that the user cannot select it. ToggleEnable, MenuItemName : Disables MenuItemName if it was previously enabled; oth...
by wz520
09 Jun 2016, 23:34
Forum: Ask For Help
Topic: [Solved] OnMessage(WM_INITPOPUPMENU) doesn't work
Replies: 13
Views: 2621

Re: OnMessage(WM_INITPOPUPMENU) doesn't work

just me wrote:
wz520 wrote:I want to enable/disable some items before a menu is about to be shown.
So why don't you do it using the Menu command?
Sorry, but I don't know how to do it...any idea please? :shock:
by wz520
09 Jun 2016, 23:34
Forum: Ask For Help
Topic: [Solved] OnMessage(WM_INITPOPUPMENU) doesn't work
Replies: 13
Views: 2621

Re: OnMessage(WM_INITPOPUPMENU) doesn't work

Sorry but maybe you misunderstood something. The WM_CONTEXTMENU message is sent when the user rightclicks in a window, not when a menu is opened. I have no idea about your script. You commented out the menu creation commands, so when the user rightclicks the window, WM_CONTEXTMENU() is called, then ...
by wz520
08 Jun 2016, 22:07
Forum: Ask For Help
Topic: [Solved] OnMessage(WM_INITPOPUPMENU) doesn't work
Replies: 13
Views: 2621

Re: OnMessage(WM_INITPOPUPMENU) doesn't work

Thanks for your reply. Unfortunately, this doesn't work for me... I have read the thread you mentioned, and another thread referred by that thread. Then I changed the script to something like this: #NoEnv WM_INITMENUPOPUP(wParam, lParam, msg, hwnd) { MsgBox } WM_CONTEXTMENU(wParam, lParam, msg, hwnd...
by wz520
08 Jun 2016, 07:53
Forum: 请求帮助
Topic: 【已解决】有没有操作已经打开的Excel表的例子? Topic is solved
Replies: 5
Views: 2519

【已解决】有没有操作已经打开的Excel表的例子? Topic is solved

网上只找到了用COM实现开启Excel->打开工作表->修改->保存->关闭,一步到位。
但是如果我已经通过其他手段启动了Excel并在其中打开了一张表,如何用AHK对它进行操作?
by wz520
08 Jun 2016, 07:40
Forum: Ask For Help
Topic: [Need Help] Random Sleeps
Replies: 3
Views: 706

Re: [Need Help] Random Sleeps

Code: Select all

`::
click,left
Random rand, 20, 30
Sleep %rand%
click,left
Random rand, 520, 550
Sleep %rand%

return
by wz520
08 Jun 2016, 07:26
Forum: Ask For Help
Topic: [Solved] OnMessage(WM_INITPOPUPMENU) doesn't work
Replies: 13
Views: 2621

[Solved] OnMessage(WM_INITPOPUPMENU) doesn't work

Hi, I want to enable/disable some items before a menu is about to be shown. I know how to do this in a classic Win32 application: Process the WM_INITPOPUPMENU message. This works in my C++ application. But when I set a message handler for WM_INITMENUPOPUP using OnMessage() in an AHK script, it seems...
by wz520
22 May 2016, 03:59
Forum: 请求帮助
Topic: Joysitck (請問鍵盤如何模擬搖桿)
Replies: 5
Views: 4161

Re: Joysitck (請問鍵盤如何模擬搖桿)

AHK可以获取Joystick的状态,但无法模拟。Windows 并没有提供模拟摇杆的API。所以不从底层驱动入手的话,应该是无解。

而且,我不明白为什么要模拟摇杆呢?有什么游戏是只支持摇杆而不支持键盘/鼠标的吗?

另外请不要随便更改顶楼的帖子内容,你这样一改在别人看来就会觉得我2楼的回帖有点莫名其妙
by wz520
07 May 2016, 10:31
Forum: 请求帮助
Topic: Joysitck (請問鍵盤如何模擬搖桿)
Replies: 5
Views: 4161

Re: Joysitck

摇杆方向并不被分配在 Joy+数字 上。获取摇杆方向是这样的:

Code: Select all

GetKeyState, x, JoyX
GetKeyState, y, JoyY
然后 x 和 y 就是摇杆当前的方向, x, y 的取值范围在 0~100,不碰摇杆的话 x, y 都是 50(居中)。

你贴的那个 url 里有 “让操纵杆轴向或视点帽发送键击或鼠标点击”这一节,里面的脚本就可以用来测试摇杆方向。
by wz520
18 Dec 2015, 20:23
Forum: 请求帮助
Topic: 请问如何在Win7的底下关闭程式?
Replies: 2
Views: 2241

Re: 请问如何在Win7的底下关闭程式?

WinClose 的参数是窗口标题栏上的文本,不是进程名。
如果你要按照进程名来关闭程序,使用 "Process, Close, AAAA.exe"
by wz520
16 Dec 2015, 06:50
Forum: 请求帮助
Topic: 求问大神:如何让ahk脚本同时只运行一个实例
Replies: 2
Views: 2733

Re: 求问大神:如何让ahk脚本同时只运行一个实例

脚本开头添加 #SingleInstance ignore 不行吗?
by wz520
20 Jan 2015, 19:53
Forum: 脚本函数
Topic: 转自ahk8 @wz520 TVPath - 设置/获取 TreeView 选中项目的路径(10-10-11 更新)
Replies: 6
Views: 5731

Re: 转自ahk8 @wz520 TVPath - 设置/获取 TreeView 选中项目的路径(10-10-11 更

哦哦,感谢楼主帮忙转帖 :D

顺便说一下压缩包里的 TVGetSet.ahk 是一个测试脚本,按 #!g 可以获取鼠标指针下 SysTreeView32 控件选中项目的路径。

Go to advanced search