在 *.VBS 文件中导入 WinAPI 函数 [英] Import WinAPI Function in *.VBS File
问题描述
在 Excel 中使用 Visual Basic,我可以使用 DECLARE 关键字声明 WinAPI 函数 - 例如
Using visual basic in say Excel, I am able to declare WinAPI functions using the DECLARE keyword - e.g.
Declare Function SetLocaleInfo Lib "kernel32" Alias "SetLocaleInfoA" ( _
ByVal Locale As Long,
ByVal LCType As Long,
ByVal lpLCData As String
) As Boolean
但是,在 *.VBS 文件中使用此语法时 - 它会因编译错误而失败.
However when using this syntax in a *.VBS file - it fails with a compile error.
谁能告诉我从 *.VBS 文件运行 WinAPI 函数需要做什么?
Can anyone tell me what I need to do to run WinAPI functions from *.VBS files?
推荐答案
如果没有一些额外的第三方支持,您将无法从 VBScript 运行 WinAPI 函数.
You can't run WinAPI functions from VBScript without some extra third-party support.
我相信曾经有一个 COM 组件的供应商允许 VBScript 调用标准的 dll,但我不记得它叫什么,很可能是我的想象力在欺骗我.
I believe there used to be vendor of a COM component which allowed VBScript to call into a standard dll but I can't remember what it was called and its quite possible that my imagination is playing tricks on me.
这篇关于在 *.VBS 文件中导入 WinAPI 函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!