最新下载
热门教程
- 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的所有代码。各位可根据自己的要求自行修改。
相关文章
- 《职场浮生记》卡牌模组推荐 06-15
- 《纸嫁衣4红丝缠》全章节图文攻略 06-15
- 《这城有良田》奖率三军课业加点攻略 06-15
- 《纸嫁衣2奘铃村》全章节攻略汇总 06-15
- 《王者荣耀》夺宝保底次数介绍 06-15
- 《向僵尸开炮》百分比宝石选择推荐 06-15