Kod:
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Const GW_CHILD = 5
Private Const GW_HWNDNEXT = 2
Private Sub Form_Load()
Dim hWnd As Long
SetWindowRgn hWndAccessApp, CreateRectRgn(0, 0, 0, 0), True
CommandBars("pencereler").Enabled = True
CommandBars("pencereler").Visible = True
CommandBars("pencereler").RowIndex = 0
hWnd = GetWindow(hWndAccessApp, GW_CHILD)
PrzeniesMenuNaFormularz hWnd
End Sub
Private Sub PrzeniesMenuNaFormularz(hWnd As Long)
Dim TitleString As String * 256
Do While hWnd <> 0
GetWindowText hWnd, TitleString, 256
If TitleString Like "pencereler*" Then
SetParent hWnd, Me.hWnd
Exit Do
End If
PrzeniesMenuNaFormularz GetWindow(hWnd, GW_CHILD)
hWnd = GetWindow(hWnd, GW_HWNDNEXT)
Loop
End Sub
Private Sub Form_Unload(Cancel As Integer)
CommandBars("pencereler").Enabled = False
SetWindowRgn hWndAccessApp, 0, True
End Sub