最新下载
热门教程
- 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的所有代码。各位可根据自己的要求自行修改。
相关文章
- 碧蓝航线的里雅斯特期待的便当时间皮肤有什么 04-30
- 明日之后踏浪逐星服装展示攻略 04-30
- 深空之眼幽月塞勒涅刻印搭配核心思路 04-30
- 明日之后红杉茶会护卫队首领BOSS有哪些 04-30
- CF手游段位奖励汇总攻略 04-30
- 无期迷途5-13怎么走攻略 04-30