|
|
Прорисовка формы - Отмена и Включение (API - SendMessage)
Option Compare Database
Option Explicit
#If VBA7 Then
Private Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As LongPtr, ByVal wMsg As Long, ByVal wParam As LongPtr, lParam As Any) As LongPtr
#Else
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
#End If
Private Const WM_SETREDRAW = &HB
Public Sub FormReDraw(frm As Form, blnReDrawON As Boolean)
On Error GoTo FormReDraw_Err
Call SendMessage(frm.hwnd, WM_SETREDRAW, blnReDrawON, 0&)
FormReDraw_End:
Exit Sub
FormReDraw_Err:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in Sub :" & _
"FormReDraw", vbCritical, "Error!"
On Error Resume Next
Call SendMessage(frm.hwnd, WM_SETREDRAW, True, 0&)
Err.Clear
End Sub
|
|