最新下载
热门教程
- 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的所有代码。各位可根据自己的要求自行修改。
相关文章
- 超凡先锋通行密钥作用如何 08-16
- 为了吾王怎么解锁角斗士 08-16
- 冒险之星有什么射手英雄 08-16
- 村落人生怎么饲养羊 08-16
- 交错战线阿图姆有哪些技能 08-16
- 斗破仙境商店物品怎么兑换 08-16