Responding To Mouse Click mouse-click
A hook is a mechanism by which an application can intercept events, such as
messages, mouse actions, and keystrokes
lparam موقعیتی درستی از کرسر نمیدهد پس رو ش حساب باز نکنیدچرا ؟ چون داکیومنتش داره میگه
LoadImageA loadimagea
نحوه ی اظهار یا فراخوانی در سیستم 64 بیتی :
Declare PtrSafe Function LoadImageA Lib "user32 (ByVal hInst As LongPtr, ByVal lpsz As String, ByVal ImgType As Long, ByVal cx As Long, ByVal cy As Long, ByVal ufLoad As Long) As LongPtr
(hIcon=LoadImageA(0,"D:\ico1.ico",IMAGE_ICON,16,16,LR_LOADFROMFOLE
: (LR_LOADFROMFILE(&H10
Loads the stand-alone image from the file specifiedLby lpszName(icon,cursor, or bitmap file
نمایش آیکون در حالت بزرگ زمانیکه ALT+TAB
را می فشارید و در مد کوچک در عنوان یا کپشن پنجره و ارسال با تابع ویندوزی SendMessageA که Msg همان WM_SETICON میشود wParam که در تصویر پائین ذکر شده ICON_BIG یا ICON_SMALL و lParam هم همان hIcon ذکر شده در بالا
Declare PtrSafe Function SendMessageA Lib "User32" (ByVal hwnd As LongPtr,ByVal uMsg As Long,ByVal wParam As LongPtr,ByVal lParam As LongPtr) As LongPtr
ShowWindow showwindow
نحوه ی اظهار یا فراخوانی در ویندور 64 بیت :
Declare PtrSafe Function ShowWindow Lib "user32" (ByVal lhwnd As LongPtr, ByVal nCmdShow As Long) As Long
استفاده در SetWindowLongPtrA در 64 بیت یا SetWindowLongA در 32 بیت
'\ Window Style Public Enum enWindowStyles WS_BORDER = &H800000 WS_CAPTION = &HC00000 WS_CHILD = &H40000000 WS_CLIPCHILDREN = &H2000000 WS_CLIPSIBLINGS = &H4000000 WS_DISABLED = &H8000000 WS_DLGFRAME = &H400000 WS_EX_ACCEPTFILES = &H10& WS_EX_DLGMODALFRAME = &H1& WS_EX_NOPARENTNOTIFY = &H4& WS_EX_TOPMOST = &H8& WS_EX_TRANSPARENT = &H20& WS_EX_TOOLWINDOW = &H80& WS_GROUP = &H20000 WS_HSCROLL = &H100000 WS_MAXIMIZE = &H1000000 WS_MAXIMIZEBOX = &H10000 WS_MINIMIZE = &H20000000 WS_MINIMIZEBOX = &H20000 WS_OVERLAPPED = &H0& WS_POPUP = &H80000000 WS_SYSMENU = &H80000 WS_TABSTOP = &H10000 WS_THICKFRAME = &H40000 WS_VISIBLE = &H10000000 WS_VSCROLL = &H200000
: Form_Load
wndHw=Me.Hwnd
(oldwndproc = SetWindowLongPtrA(Me.hwnd, GWL_WNDPROC, AddressOf WndProc
: Form_Unload
SetWindowLongPtrA wndHw, GWL_WNDPROC, oldwndproc
Public Function WndProc(ByVal lhwnd As LongPtr, ByVal uMsg As Long, ByVal wParam As LongPtr, ByVal lParam As LongPtr) As Long
If uMsg = 516 Then 'WM_RBUTTONDOWNU
'Debug.Print "Intercepted WM_CONTEXTMENU at " & Now
" MsgBox "Mouse Right Button Was Clicked
WndProc=-1
ElseIf uMsg = WM_KEYDOWN Then
MsgBox wParam
WndProc = True
Else ' Send all other messages to the default message handler
(WndProc = CallWindowProcA(oldwndproc, lhwnd, uMsg, wParam, lParam
End If
End Function
Const WM_NCLBUTTONDOWN As Integer = 161
Const WM_SYSCOMMAND As Integer = 274Const HTCAPTION As Integer = 2Const SC_MOVE As Integer = 61456If (Msg = WM_SYSCOMMAND) And (WParam = SC_MOVE) ThenReturnEnd IfIf (Msg = WM_NCLBUTTONDOWN) And (WParam = HTCAPTION) ThenReturnIf (Msg = WM_RBUTTONDOWN) And (WParam = WM_RBUTTONDOWN) ThenReturnEnd If
(20×16)×1.6+4=516 ( DECIMAL )
516÷16=32
516-(32×16)=4
(516÷16)×10=320
320÷16=20
List Of Windows Message SendMessageList
SetWindowSubclass hwnd,SubClassProc&,1,0
SubClassProc(Byval hwnd as Longptr,Byval uMsg As Long,Byval wParam as LongPtr,Byval lParam As LongPtr,Byval uId As Long,Byval dwRef as Long) As LongPtr
DefSubClassProc Hwnd,uMsg,wParam,lParam
RemoveWindowSubClass hwnd,SubClassProc&,1
GWL_WNDPROC=-4
lpfnOld=SetWindowLongA(hwnd,GWL_WNDPROC,Address
( Of WndProc
(Of WNDProc
( GetPropA hwnd,lPstring (Retrieve A Data Handle
SetPropA hwnd,lPstring,hData
RemovePropA hwnd,lPstring
WndPro(Byval hwnd as LongPtr,Byval uMsg
as Long,Byval wParam as LongPtr,Byval lParam as LongPtr) As LongPtr
Select Case uMsg
Case WM_NCDESTROY ' &H82
Call UnSubClass( hwnd) 'Built-In Function
End Select
)WndProc=CallWindowProcA
((GetPropA(hwnd,OldWndProc),hwnd,uMsg,wParam,lParam
WM_KEYDOWN=&H100
WM_CHAR = &H102
asciiChar مثل &H32 ارسال عدد 32
(SendMessageA(hwndEdit, WM_CHAR, asciiChar, 0
You can unhide the menu bar in Acrobat itself by pressing the “F9” key on Windows
if GetClassNameTxt(pHwnd)="AVL_AVView" And GetWindowText(pHwnd)="AVPageView" Then
((TEdit=GetWindowTxt(FindWindowEx(pHwnd,0,"RICHEDIT50W",VbNullString
End If
البته در نسخه های ۲۰۰۷ و بالاتر Alternative Color در پراپرتی شیت گزارش وجود دارد در سکشن Page Header یا Detail و روش زیر لازم نیست
MoveLayout | NextRecord | PrintSection | Effect |
True | True | True | Move to the next position, get the next record, and print the data. |
True | False | True | Move to the next position, remain on the same record, and print the data. |
True | True | False | Move to the next position, get the next record, and don't print the data. This has the effect of skipping a record and leaving a blank space. |
True | False | False | Move to the next position, remain on the same record, and don't print. This causes a blank space to appear without moving to the next record. |
False | True | True | Remain in the same position, get the next record, and print the data. This has the effect of overlaying one record on another. |
False | False | True | Not allowed. |
False | True | False | Remain in the same position, get the next record, and refrain from printing. This has the effect of skipping a record without leaving a blank space. |
False | False | False | Not allowed. |
The FormatCount property is used to evaluate the number of times the Format event has occurred for the current section of the report. The Format event occurs more than once whenever the Retreat event occurs. By checking the FormatCount property, you can ensure that complex code placed within the Format event is executed only once.
The PrintCount property is used to identify the number of times the Print event has occurred for the current section of the report. The Print event occurs more than once whenever the Retreat event occurs. By checking the value of the PrintCount property, you can ensure that logic within the Print event is executed only once.
Private Sub Report_Activate()' Used by Solutions to show toolbar that includes Show Me button.' Hide built-in Print Preview toolbar.DoCmd.ShowToolbar "Print Preview", acToolbarNo' Show Custom Print Preview toolbar.DoCmd.ShowToolbar "Custom Print Preview", acToolbarYes
End Sub
For reports, the Top property setting is the amount that the current section is offset from the top of the page. This property setting is expressed in twips. You can use this property to specify how far down the page you want a section to print in the section's Format event
procedure
مقدار جابجایی سکشن جاری از بالای صفحه را نشان میدهد سکشن میتواند Detail باشد یا Report Footer و به twips که مقدار در 1440 ضرب میشود بیان شده است. ( خیلی مهم است )
Page Footer که محل قرار گرفتن شماره صفحه یا تاریخ است در تمام صفحات و پائین آن می آید ولی Report Footer در صفحه آخر و بعد از آخرین رکورد می آید ( مهم : بعد از آخرین رکورد نه بعد از Page Footer ، جای رکورد در کجاست ؟ در رکوردست و لیست شدن در دیتیل ) و قابلیت اینکه بعد از Page Footer یا قبل از شروع آن باشد را ندارد.
قسمت آخر متن انگلیسی در بالا منظور این است که فرضا اگر دیتیل شما تمام صفحه را پر نکرده باشد میشود تا جایی که این آفست یا جابجایی ( طبق گفته ی بالا این مقدار در پراپرتی Top تنظیم شده ) کوچکتر از ارتفاع صفحه باشد رکورد آخر آن سکشن را در صفحه پرینت کرد ( NextRecord=False ) و برای عدم پرینت رکوردهای تکرارشده PrintSection باید فالز شود.( در رویداد Format ) یا مثلا میخواهید Report Footer که بعد از رکورد آخر در دیتیل شروع میشود تقریبا در پایین صفحه ( بعد از Page Footer قرار نخواهد گرفت ) بیاید.
اگر دیتیل تا قبل از Page Footer پیشروی کند (Advance ) ، صفحه جدید ایجاد شده و Report Footer در آن صفحه ی خالی قرار خواهد گرفت ( در هر صورت در صفحه ی آخر و قبل از Page Footer قرار خواهد گرفت )
برای باز کردن فایل pdf از تابع Shell استفاده کنید یا تابع Shell Execute اگر Shell بکار ببرید در ابتدا مسیر Acrobat.exe که در سیستم های 32 و 64 بیت فرق میکند را باید حتما ذکر کنید حتی مسیر اپلیکیشن اصلی Word یا Access ؛ از ساخت آبجکت Shell.Application هم به احتمال زیاد می توانید بهره ببرید
ObjShell.Shell.Open fileName
<Acrobat path> /A "<parameter>=<value>" "<PDF path>
User32.dll 64 Bit
نحوه ی اظهار توابع عنوان این مطلب در ویندوز 32 و 64 بیت یا در Vb6 یا Vb7 فرق میکند که در اینترنت جستجو کنید تابع صحیح برای موارد بالا وجود دارد.
تابع زیر نام یا کلاس را در بافر ایجاد و برمی گرداند
برای گرفتن کلاس یا نام ( پنجره )بکار برده میشود فرضا گرفتن تکست نوار عنوان پنجره ی اکسس جایی که اسم دیتابیس و نام اپلیکشن و حتی مسیر نمایان میشود
(Public Function GetClassName(h as LongPtr
Dim Buff As String*256
Dim BuffLen As Long
((Buff=String(256,Chr(0
(BuffLen=getclassnamea(h,Buff,BuffLen
If BuffLen>0 Then
(GetClassName=Left$(Buff,BuffLen
End If
Set Buff=Nothing
End Function
(Public Function GetWindowText(h as LongPtr
Dim Buff As String*256
Dim BuffLen As Long
((Buff=String(256,Chr(0
(BuffLen=getwindowtexta(h,Buff,BuffLen
If BuffLen>0 Then
(GetWindowText=Left$(Buff,BuffLen
End If
Set Buff=Nothing
End Function