最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
使用VB.net调用WinAPI方法介绍
时间:2022-07-02 11:34:43 编辑:袖梨 来源:一聚教程网
本贴精华段:
Declare Auto Function MBox Lib "user32.dll" _
Alias "MessageBox" (ByVal hWnd As Integer, _
ByVal txt As String, ByVal caption As String, _
ByVal Typ As Integer) As Integer
'定义一些要调用参数
Const MB_ICONQUESTION = &H20L
Const MB_YESNO = &H4
Const IDYES = 6
Const IDNO = 7
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim RetVal As Integer ' 存储返回的值.
RetVal = MBox(0, "调用WinApi成功否?", "Windows API 信息框", _
MB_ICONQUESTION Or MB_YESNO)
' Check the return value.
If RetVal = IDYES Then
MsgBox("您选择了是")
Else
MsgBox("您选择了不是")
End If
End Sub
以下附上本CALLAPI.VB的所有代码。各位可根据自己的要求自行修改。
Declare Auto Function MBox Lib "user32.dll" _
Alias "MessageBox" (ByVal hWnd As Integer, _
ByVal txt As String, ByVal caption As String, _
ByVal Typ As Integer) As Integer
'定义一些要调用参数
Const MB_ICONQUESTION = &H20L
Const MB_YESNO = &H4
Const IDYES = 6
Const IDNO = 7
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim RetVal As Integer ' 存储返回的值.
RetVal = MBox(0, "调用WinApi成功否?", "Windows API 信息框", _
MB_ICONQUESTION Or MB_YESNO)
' Check the return value.
If RetVal = IDYES Then
MsgBox("您选择了是")
Else
MsgBox("您选择了不是")
End If
End Sub
以下附上本CALLAPI.VB的所有代码。各位可根据自己的要求自行修改。
相关文章
- 王者荣耀侦探能力大测试攻略 王者荣耀侦探能力大测试怎么过 11-22
- 无期迷途主线前瞻兑换码是什么 11-22
- 原神欧洛伦怎么培养 11-22
- 炉石传说网易云音乐联动怎么玩 11-22
- 永劫无间手游确幸转盘怎么样 11-22
- 无期迷途主线前瞻兑换码是什么 无期迷途主线前瞻直播兑换码介绍 11-22