在* .VBS文件中导入WinAPI函数 [英] Import WinAPI Function in *.VBS File

查看:148
本文介绍了在* .VBS文件中导入WinAPI函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆