GetDlgCtrlID | Retrieves the identifier of the specified control. |
GetDlgItem | Retrieves a handle to a control in the specified dialog box. |
MIIM_STRING = 64
MIIM_FTYPE = 256
MFT_RIGHTORDER = 0x2000
MF_BYPOSITION = 0x00000400
For j = 0 To MenuCount - 1
With mii
(BuffLen = GetMenuStringA(hMenu, j, Buff, Len(Buff) + 1, &H400
(txt = Left$(Buff, BuffLen
(cbSize = Len(mii
fMask = 64 Or 256
fTyp = &H2000
dwtypedata = arr(j) 'txt
cch = Len(.dwtypedata) + 1
.fState = &H3 'mfs_disabled
End With
SetMenuItemInfoA hSysMenu, GetMenuItemID(hMenu, j), 0, mii
Next
"InsertMenuA hSysMenu, 6, MF_BYPOSITION Or MF_STRING Or &H2000, 10200, ByVal "Salam
For j = 0 To (hc + 1) - 1
Type: HBITMAP
A handle to the bitmap to be displayed, or it can be one of the values in the following table. It is used when the MIIM_BITMAP flag is set in the fMask member
uflags: MF_BYCOMMAND
hBitmap:LoadBitmap,LoadIcon,LoadImage
Dim mim As MENUITEMINFOA
(mim.cbSize = Len(mim
mim.fMask = MIIM_BITMAP
mim.hbmpitem=1
SetMenuItemInfoA hSysMenu, 6, 1, mim
Use the GetSystemMetrics function with the CXMENUCHECK and CYMENUCHECK values to retrieve the bitmap dimensions.
تصویر بالا با استفاده از تابع زیر ( foo هندلی برای Bitmap ) و loadimagea ( در آرگومان Type حتما IMAGE_BITMAP استفاده شود ) بدست آمده ضمنا Bitmap ها در Shell32 در اینترنت وجود دارد و می توانید در سیستم خود لود نمایید و مانند زیر استفاده کنید .
SetMenuItemBitmaps hMenu, 1,MF_BYPOSITION, foo, foo
در تصویر بالا تعداد آیتم ها عدد 6 است
If the function succeeds, the return value specifies the number of characters copied to the buffer, not including the terminating null character.
If the function fails, the return value is zero.
If the specified item is not of type MIIM_STRING or MFT_STRING, then the return value is zero.
The nMaxCount parameter must be one larger than the number of characters in the text string to accommodate the terminating null character.
If nMaxCount is 0, the function returns the length of the menu string.
Type: int
اگر عملکرد موفقیت آمیزباشدمقداربرگشتی تعداد آیتم های منو خواهدبود.
If the function succeeds, the return value specifies the number of items in the menu.
If the function fails, the return value is -1
درباره تابع GetMenuItemId
Type: UINT
مقدار برگشتی شناسه ی آیتم منوی مشخص شده خواهد بود اگر شناسه ی آیتم منو نال یا شامل ساب منو باشد عدد برگشتی 1- است که اثبات و تست شده.
The return value is the identifier of the specified menu item. If the menu item identifier is NULL or if the specified item opens a submenu, the return value is -1.
درباره تابع ModifyMenu
(idItem=GetMenuItemID(hmenu, uItemPos
ModifyMenu hmenu,idItem,MF_BYCOMMAND+MF_STRING,idItem, szItem
Type: BOOL
اگر تابع ( عملکرد ) موفقیت آمیز باشد مقدار برگشتی عددی غیرصفر است خواه مثبت یا منفی و در صورت عدم موفقیت صفر را برخواهد گرداند.
If the function succeeds, the return value is nonzero
If the function fails, the return value is zero
Private Const windowsMenuClassName As String= "#32768
()Private Sub Timer1_TimerDim hMenuWnd As Long(hMenuWnd = FindWindow ("# 32768", vbNullStringIf hMenuWnd <> 0 Then(( Me.Caption = CStr (SendMessage(hMenuWnd, MN_GETHMENU, 0, 0End IfEnd Sub
Picture Property Doffice.11
stdole.SavePicture
The IDispatch interface ID is defined as a GUID with the value of {00020400-00000000-C000-000000000046}
H20400&
HC0&
H46&
در سیستم 64 بیت
Public Function LowLevelMouseProc(ByVal nCode As Long, ByVal wParam As LongPtr, ByVal lParam As LongPtr) As LongPtr
If nCode > 0 Then
Select Case wParam
Case WM_NCDESTROY, WM_DESTROY
UnhookWindowsHookEx hhk
Case WM_RBUTTONDOWN, WM_RBUTTONUP
LowLevelMouseProc = 1
Exit Function
Case Else
( LowLevelMouseProc = CallNextHookEx(hhk, nCode, wParam, lParam
End Select
End If
CallNextHookEx hhk, nCode, wParam, lParam
End Function
lparam موقعیتی درستی از کرسر نمیدهد پس رو ش حساب باز نکنیدچرا ؟ چون داکیومنتش داره میگه
استفاده در 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