好象只能用API了.
具体是什么函数想不起来了.待俺会去翻翻书.
具体是什么函数想不起来了.待俺会去翻翻书.
解决方案 »
- winsck监听的端口数据流是否可以不需要建立连接,发送出去是否相同
- VB高手请进,关于listview横向显示
- 小弟的网站终于初步做成了,请各位朋友多多支持一下,散分!
- 4333d这个是一个比较难的问题 关于MTS事务!! 分也不多 50分!!
- 请教一个简单的数据库管理软件的问题!
- VB窗口的问题,,高分回报在线等。。 。
- 请问:如何用VB读取xml文件中的数据,急急急!
- vb对txt文件内容操作并纪录到数组问题~
- 怎样在VB中调用API(getprivateprofilestring)
- 开第二个问题:用SQLSERVER建数据库,要求通过MODE访问,软件具体如何做并注意什么问题?
- 郁悶中........用DATAGRID的疑問
- 如何能用DataReport打印任意表的内容!!!!!!
Load mnu(n)
mnueFile.Item(0).Caption = "1:fff"
mnueFile.Item(0).Visible = True
Load mnueFile.Item(1)
mnueFile.Item(1).Caption = "2:fffgg"
mnueFile.Item(1).Visible = True
Private Sub Form_Load()
Dim lhSysMenu As Long, lRet As Long
On Error Resume Next
'// add about menu
lhSysMenu = GetSystemMenu(hWnd, 0&)
lRet = AppendMenu(lhSysMenu, MF_SEPARATOR, 0&, vbNullString)
lRet = AppendMenu(lhSysMenu, MF_STRING, IDM_ABOUT, "About...")
Show
'// saves the previous window message handler. Always restore this value
'// AddressOf command sends the address of the WindowProc procedure
'// to windows
ProcOld = SetWindowLong(hWnd, GWL_WNDPROC, AddressOf WindowProc)
End Sub'// form_queryunload event. Return control to windows/vb
Private Sub Form_Unload(Cancel As Integer)
'// give message processing control back to VB
'// if you don't do this you WILL crash!!!
Call SetWindowLong(hWnd, GWL_WNDPROC, ProcOld)
End SubThen, add the code below to a module
'// variable that stores the previous message handler
Public ProcOld As Long
'// Windows API Call for catching messages
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
'// Windows API call for calling window procedures
Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
'// menu windows api
Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As String) As Long
Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
'// windows api constants
Public Const WM_SYSCOMMAND = &H112
Public Const MF_SEPARATOR = &H800&
Public Const MF_STRING = &H0&
Public Const GWL_WNDPROC = (-4)
Public Const IDM_ABOUT As Long = 1010Public Function WindowProc(ByVal hWnd As Long, ByVal iMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
'// ----WARNING----
'// do not attempt to debug this procedure!!
'// ----WARNING---- '// this is our implementation of the message handling routine
'// determine which message was recieved
Select Case iMsg
Case WM_SYSCOMMAND
If wParam = IDM_ABOUT Then
MsgBox "VB Web Append to System Menu Example", vbInformation, "About"
Exit Function
End If
End Select
'// pass all messages on to VB and then return the value to windows
WindowProc = CallWindowProc(ProcOld, hWnd, iMsg, wParam, lParam)
End Function
函数功能:该函数创建一个菜单。此菜单最初是空的,但可用函数InserMenultem,AppendMenu,和lnsertMenu来填入菜单项。 函数原型:HMENU CreateMenu(VOID) 参数:无。 返回值:如果函数调用成功,返回值是新创建菜单的句柄。如果函数调用失败,返回值是NULL。若想获得更多的错误信息,请调用GetLastError函数。 备注:与被分配给一个窗日的菜单相联系的资源会被自动释放。如果此菜单未被分配给一个窗口,应用程序必须在关闭之前释放与菜单相连的资源。应用程序通过调用函数DestroyMenu来释放菜单资源。