|
建立一个无边框的表单将以下代码加入表单.
'Form Code
Private Declare Function FindWindowExA Lib "user32" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, _
ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal X As Long, ByVal Y As Long, _
ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Sub Form_Load()
DoCmd.Echo False
DoCmd.Minimize
DoCmd.Echo True
Dim mHwnd As Long
mHwnd = Me.hwnd
sHwnd = FindWindowExA(0, 0, "OMain", vbNullString)
sHwnd = FindWindowExA(sHwnd, 0, "MsoCommandBarDock", "MsoDockTop")
sHwnd = FindWindowExA(sHwnd, 0, "MsoCommandBar", "功能表列")
SetParent mHwnd, sHwnd
With CommandBars("Menu Bar")
MoveWindow mHwnd, .Width - 60, 1, 60, (.Height * 0.75), 0
End With
End Sub |
|