下面是我要找MIDForm的功能表上的名字,請幫我看一下為什麼不可以好嗎??
Public Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function GetSubMenu Lib "user32" (ByVal hmenu As Long, ByVal nPos As Long) As Long
Public Declare Function GetMenuString Lib "user32" Alias "GetMenuStringA" (ByVal hmenu As Long, ByVal wIDItem As Long, ByVal lpString As String, ByVal nMaxCount As Long, ByVal wFlag As Long) As Long
Public Declare Function GetMenuItemID Lib "user32" (ByVal hmenu As Long, ByVal nPos As Long) As Long
Private Sub Command3_Click()
Dim hmenu As Long
Dim hsubmenu As Long
Dim aaa As String
Dim menuid As Long
hmenu = GetMenu(frmMain.hwnd)
hsubmenu = GetSubMenu(hmenu, 0)
menuid = GetMenuItemID(hsubmenu, 1)
Call GetMenuString(hsubmenu, menuid, aaa, 256, MF_BYPOSITION)
Form1.Text1.Text = aaa
End Sub
我執行時會出現應用程式發生錯誤,請問各位=高手要如何改進呢???