日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
VB.NET調(diào)用WinAPI實例探討

VB.NET作為一款功能強大的面向?qū)ο笳Z言,為我們帶來了很多不一樣的體驗。我們今天可以通過對VB.NET調(diào)用WinAPI的操作技巧的掌握,來體驗一下這款語言給我們帶來的不同之處,從而初步掌握它的應(yīng)用技巧。

創(chuàng)新互聯(lián)建站憑借專業(yè)的設(shè)計團隊扎實的技術(shù)支持、優(yōu)質(zhì)高效的服務(wù)意識和豐厚的資源優(yōu)勢,提供專業(yè)的網(wǎng)站策劃、成都網(wǎng)站設(shè)計、做網(wǎng)站、成都外貿(mào)網(wǎng)站建設(shè)公司、網(wǎng)站優(yōu)化、軟件開發(fā)、網(wǎng)站改版等服務(wù),在成都10年的網(wǎng)站建設(shè)設(shè)計經(jīng)驗,為成都成百上千家中小型企業(yè)策劃設(shè)計了網(wǎng)站。

以下為VB.NET調(diào)用WinAPI的演示實例:

 
 
 
  1. Declare Auto Function MBox Lib 
    "user32.dll" _
  2. Alias "MessageBox" (ByVal hWnd 
    As Integer, _
  3. ByVal txt As String, ByVal 
    caption As String, _
  4. ByVal Typ As Integer) As Integer
  5. '定義一些要調(diào)用參數(shù)
  6. Const MB_ICONQUESTION = &H20L
  7. Const MB_YESNO = &H4
  8. Const IDYES = 6
  9. Const IDNO = 7
  10. Private Sub Button1_Click(ByVal 
    sender As System.Object, ByVal e 
    As System.EventArgs) Handles 
    Button1.Click
  11. Dim RetVal As Integer ' 存儲返回的值.
  12. RetVal = MBox(0, "調(diào)用WinApi成功否?", 
    "Windows API 信息框", _
  13. MB_ICONQUESTION Or MB_YESNO)
  14. ' Check the return value.
  15. If RetVal = IDYES Then
  16. MsgBox("您選擇了是")
  17. Else
  18. MsgBox("您選擇了不是")
  19. End If
  20. End Sub

以下附上本CALLAPI.vb的所有代碼。各位可根據(jù)自己的要求對這段VB.NET調(diào)用WinAPI代碼自行修改。

 
 
 
  1. Public Class CallApi
  2. Inherits System.Windows.Forms.Form
  3. Declare Auto Function MBox Lib 
    "user32.dll" _
  4. Alias "MessageBox" (ByVal hWnd
     As Integer, _
  5. ByVal txt As String, ByVal 
    caption As String, _
  6. ByVal Typ As Integer) As Integer
  7. '定義一些要調(diào)用參數(shù)
  8. Const MB_ICONQUESTION = &H20L
  9. Const MB_YESNO = &H4
  10. Const IDYES = 6
  11. Const IDNO = 7
  12. #Region " Windows Form Designer 
    generated code "
  13. Public Sub New()
  14. MyBase.New()
  15. 'This call is required by the 
    Windows Form Designer.
  16. InitializeComponent()
  17. 'Add any initialization after the 
    InitializeComponent() call
  18. End Sub
  19. 'Form overrides dispose to clean 
    up the component list.
  20. Protected Overloads Overrides Sub 
    Dispose(ByVal disposing As Boolean)
  21. If disposing Then
  22. If Not (components Is Nothing) Then
  23. components.Dispose()
  24. End If
  25. End If
  26. MyBase.Dispose(disposing)
  27. End Sub
  28. 'Required by the Windows 
    Form Designer
  29. Private components As System.
    ComponentModel.IContainer
  30. 'NOTE: The following procedure is 
    required by the Windows Form Designer
  31. 'It can be modified using the 
    Windows Form Designer. 
  32. 'Do not modify it using the code editor.
  33. Friend WithEvents Button1 As System.
    Windows.Forms.Button
  34.  
    Private Sub InitializeComponent()
  35. Me.Button1 = New System.Windows.Forms.Button()
  36. Me.SuspendLayout()
  37. '
  38. 'Button1
  39. '
  40. Me.Button1.Location = New System.
    Drawing.Point(88, 56)
  41. Me.Button1.Name = "Button1"
  42. Me.Button1.Size = New System.Drawing.Size(168, 48)
  43. Me.Button1.TabIndex = 0
  44. Me.Button1.Text = "調(diào)用API的信息框"
  45. '
  46. 'CallApi
  47. '
  48. Me.AutoScaleBaseSize = New System.
    Drawing.Size(5, 13)
  49. Me.ClientSize = New System.Drawing.Size(384, 205)
  50. Me.Controls.AddRange(New System.Windows.
    Forms.Control() {Me.Button1})
  51. Me.Name = "CallApi"
  52. Me.Text = "CallApi"
  53. Me.ResumeLayout(False)
  54. End Sub
  55. #End Region
  56. Private Sub Button1_Click(ByVal sender 
    As System.Object, ByVal e As System.
    EventArgs) Handles Button1.Click
  57. Dim RetVal As Integer ' 存儲返回的值.
  58. RetVal = MBox(0, "調(diào)用WinApi成功否?",
     "Windows API 信息框", _
  59. MB_ICONQUESTION Or MB_YESNO)
  60. ' Check the return value.
  61. If RetVal = IDYES Then
  62. MsgBox("您選擇了是")
  63. Else
  64. MsgBox("您選擇了不是")
  65. End If
  66. End Sub
  67. End Class

VB.NET調(diào)用WinAPI代碼示例就為大家介紹到這里。


新聞名稱:VB.NET調(diào)用WinAPI實例探討
網(wǎng)頁路徑:http://www.5511xx.com/article/dhcocij.html