کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی
کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

کلینیک فوق تخصصی اکسس ( کاربرد vba در اکسس )

به اشتراک گذاری اطلاعات کسب شده در اکسس از سایت آفیس و سایت های تخصصی خارجی

Draw TitleBr



Private tCloseRect As RECT
Private tUpdatedCloseButtonRect As RECT
Private bCloseButtonPressed As Boolean
----------------------------------------------
 : WNDPROC

GetClientRect hwnd, tClientRect

Select Case Msg 
Case WM_NCLBUTTONDOWN
SetWindowPos hwnd,HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE 

Case WM_ACTIVATE
If wParam = 0 Then 
SetWindowPos hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE SetWindowLong hwnd,
(GWL_STYLE, (GetWindowLong(hwnd, GWL_STYLE,
(And Not WS_SYSMENU
(Call DrawTitleBar(hwnd, lTitleBarColor
InvalidateRect hwnd, tClientRect, 0 

Case WM_EXITSIZEMOVE
(Call DrawTitleBar(hwnd, lTitleBarColor
InvalidateRect hwnd, tClientRect, 0

Case WM_NCPAINT 
If bDrawn = False Then bDrawn = True Call DrawTitleBar(hwnd, lTitleBarColor) Exit Function 

Case WM_SYSCOMMAND
GetHiLoword CLng(lParam), loword, hiword
tPt.x = loword
tPt.y = hiword
Dim lngPtr As LongPtr
(CopyMemory lngPtr,tPt, LenB(tPt
If PtInRect(tUpdatedCloseButtonRect, lngPtr) Then 
(Call DrawTitleBar(hwnd, lTitleBarColor, True
Do
DoEvents
Loop Until GetAsyncKeyState(vbKeyLButton) = 0 
GetCursorPos tPt
(CopyMemory lngPtr, tPt, LenB(tPt
If PtInRect(tUpdatedCloseButtonRect, lngPtr) Then 
If bCloseButtonPressed Then Sleep 200
Unload oForm 
End If 
End If 
If bCloseButtonPressed Then 
(Call DrawTitleBar(hwnd, lTitleBarColor
InvalidateRect hwnd, tClientRect, 0 
End If

Case WM_DESTROY
bCloseButtonPressed = False


: DrawTitleBar 

Dim tLb As LOGBRUSH
Dim tPs As PAINTSTRUCT

(Call BeginPaint(hwnd, tPs
(hdc=GetWindowDC(hwnd
tLb.lbColor=CaptionColor
(hBrush=CreateBrushIndirect(tLb
GetWindowRect hwnd, tFormRect


bCloseButtonPressed = PressedCloseButton
If Not PressedCloseButton Then
DrawFrameControl hdc,tCloseRect, DFC_CAPTION, DFCS_CAPTIONCLOSE
Else
DrawFrameControl hdc, tCloseRect, DFC_CAPTION, DFCS_CAPTIONCLOSE + DFCS_PUSHED
End If

SetBkMode hdc,1
SetTextColor hdc, lFontColor 
(Call CreateFont(hdc
TextOut hdc, 4, 4, sCaptionText, Len(sCaptionText
GetClientRect hwnd, tCloseRect
With tCloseRect
(Bottom = GetSystemMetrics(SM_CYCAPTION.
Left = .Right - 20.
Right = .Right +3.
Top = .Top + 4.
End With
With tCloseRect 
p1.x = .Left - 2: p1.y = .Top - 2 
p2.x = .Right: p2.y = .Bottom - GetSystemMetrics(SM_CYCAPTION) - 2 End With 
ClientToScreen hwnd, p1
ClientToScreen hwnd, p2
With tUpdatedCloseButtonRect 
.Left = p1.x: .Top = p1
(y - GetSystemMetrics(SM_CYCAPTION
Right = p2.x: .Bottom = p2.y.
End With 
ReleaseDC hwnd, hdc 
(Call EndPaint(hwnd, tPs

Private Sub GetHiLoword(lParam As Long, ByRef 
(loword As Long, ByRef hiword As Long
loword = lParam And &HFFFF& 
hiword = lParam \ &H10000 And &HFFFF&
End Sub

نظرات 0 + ارسال نظر
برای نمایش آواتار خود در این وبلاگ در سایت Gravatar.com ثبت نام کنید. (راهنما)
ایمیل شما بعد از ثبت نمایش داده نخواهد شد