VB中API的声明特殊问题

发表于:2007-05-25来源:作者:点击数: 标签:问题api声明发现特殊

 我在调用api时,发现了下面了几个问题:

1.SystemParameterInfo
vb的api声明工具中第三个参数为 ByRef lpvParam as any.
但若想用来更改桌面壁纸时必须声明为ByVal lpvParam as any.

2.SendMessage
当声明为Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

发送SendMessage(me.hwnd,&h112,&hF140,0)为开始屏幕保护
而当第四个参数声明为ByVal lParam as any则为待机对话框。
上述在Win98可以,而在Win2000中已避免了。

原文转自:http://www.ltesting.net