-
GETWINDOWRECT نمایش باتن ساخته شده در InputBox
پنجشنبه 28 شهریور 1398 19:12
دادن ابعاد مستطیل پنجره ی مشخص شده ( ابعاد در مختصات صفحه داده میشود ) در ClientRect عدد x و y گوشه ی بالایی صفر است Retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the upper-left .corner of the screen برای اضافه کردن باتن...
-
NCPAINT
پنجشنبه 28 شهریور 1398 15:05
Region GetDCExFlags Const DCX_WINDOW=&H1 Const DCX_CACHE=&H2 Const DCX_NORESETATTRS=&H4 Const DCX_CLIPCHILDREN=&H8 Const DCX_CLIPSIBLINGS=&H10 Const DCX_PARENTCLIP=&H20 Const DCX_EXCLUDERGN=&H40 Const DCX_INTERSECTRGN=&H80 Const DCX_EXCLUDEUPDATE=&H100 : Message WM_NCPAINT HDC hdc...
-
Custom Caption
پنجشنبه 28 شهریور 1398 14:41
(LONG lStyle=GetWindowLong(Hwnd, GWL_STYLE SetWindowLong Hwnd,GWL_STYLE, lStyle And Not WS_SYSMENU If I removed the caption and then changed the client area on WM_NCCALCSIZE that would alow me to alocate some space for the nonclient caption that I need to draw! I really think this could work... I'm already modifying...
-
Custom Button
چهارشنبه 27 شهریور 1398 23:52
1) Do not use BeginPaint/EndPaint in WM_ERASEBKGND. Move that code in a WM_PAINT handler. 2) Use SetWindowLong and the GWL_USERDATA index for storing the button state (UP or DOWN) and use GetWindowLong for retrieving the current state. 3) Use SetCapture for capturing the mouse, starting with WM_LBUTTONDOWN. Update the...
-
Button Menu
چهارشنبه 27 شهریور 1398 23:44
docs.appendmenua (SubclassWindow(hWnd Somewhere in WM_INITDIALOG handler (btnMenu =GetDlgItem(IDC_BTN_ABOUT ("btnMenu.AddMenuItem(IDC_MNU_ONE,"Windows ("btnMenu.AddMenuItem(IDC_MNU_TWO,"Template (btnMenu.AddMenuItem(IDC_MNU_THREE,"",MF_SEPARATOR...
-
CUSTOM CAPTION
چهارشنبه 27 شهریور 1398 20:39
case WM_PAINT Dim ps As PAINTSTRUCT ps hdc =BeginPaint(hwnd,ps) 'fill the window with a color HBRUSH hbrush=CreateSolidBrush(RGB(33, 33, 33)) FillRect hdc,ps.rcPaint,hbrush DeleteObject(hbrush) 'get a drawing area Dim Crect As RECT GetClientRect hwnd,Crect Crect.bottom=Crect.top+GetSystemMetrics(SM_CYCAPTION)+...
-
CLIENTRECT
چهارشنبه 27 شهریور 1398 20:02
RECT rWindow RECT rClient HRGN hRgnWindow HRGN hRgnClient HRGN hNCRgn Get the window and client rectangles for the window.' GetWindowRect hWnd,rWindow GetClientRect hWnd,rClient Translate the Client rectangle into screen coordinates.' {POINT pt = {0,0 MapWindowPoints hWnd,0,pt1 OffsetRect rClient,pt.x,pt.y Create...
-
PAINT-BUTTON
چهارشنبه 27 شهریور 1398 18:53
احتملا Rec در پیام WMPAINT باید Global یا Static تعیین شود. تست نشده ولی روال بدین شکل است . Private Pressed As Boolean Private FocusLost As Boolean Private TRect As RECT Border3D_Y, Border_Thickness, Btn_Width,Button_Width, Button_Height (GetWindowDC(FrmMainForm.Handle (Border3D_Y=GetSystemMetrics( SM_CYEDGE...
-
ساب کلاس کردن
چهارشنبه 27 شهریور 1398 12:40
Option Compare Database Public WinProcOld As LongPtr (Public Function SubClassWnd(hwnd As LongPtr ( WinProcOld = SetWindowLongPtr(hwnd, GWL_WNDPROC, AddressOf WindProc End Function (Public Function UnSubclassWnd(hwnd As LongPtr SetWindowLongPtr hwnd, GWL_WNDPROC, WinProcOld WinProcOld = 0 End Function 'This is your...
-
Balloon Tooltips
سهشنبه 26 شهریور 1398 18:20
(TTM_TRACKACTIVATE=(&H400+17 (TTM_TRACKPOSITION=(&H400+18 (TTM_ACTIVATE=(&H400+1 CW_USEDEFAULT = &80000000 TTM_ADDTOOL = &404 TTM_TRACKACTIVATE = &411 TTM_UPDATETIPTEXT = &40C TTS_BALLOON = 64 TTS_ALWAYSTIP = 1 TTS_NOPREFIX = 2 WS_POPUP = &80000000 TTF_RTLREADING=&H4...
-
تایمر بستن پنجره با کلاس 32770#
سهشنبه 26 شهریور 1398 16:07
بسته شدن پنجره زمانیکه کپشن به عدد 10 رسید . : 64BIT Declare PtrSafe Function SetTimer Lib "user32" Alias "SetTimer" (ByVal hWnd As LongPtr, ByVal nIDEvent As LongPtr, ByVal uElapse As Long, ByVal lpTimerFunc As LongPtr) As LongPtr Declare PtrSafe Function KillTimer Lib "user32" Alias...
-
PtInRect در کنترل Edit مربوط به پنجره InputBox
دوشنبه 25 شهریور 1398 17:19
کار سختی نیست از منبعی که در انتهای صفحه آمده استفاده شده که تابع ویندوزی است Declare PtrSafe Function PtInRect Lib "user32" (lpRect As RECT, pt As POINTAPI) As Long' Use Belows Only Declare PtrSafe Function PtInRect Lib "user32" (lpRect As RECT, ByVal x As Long, ByVal y As Long) As Long _ , Public...
-
محصور کردن کرسر به منطقه مستطیل شکل در صفحه
دوشنبه 25 شهریور 1398 00:17
ClipCurSor .Confines the cursor to a rectangular area on the screen Parameters lpRect Type: const RECT* A pointer to the structure that contains the screen coordinates of the upper-left and lower-right corners of the confining rectangle. If this parameter is NULL, .the cursor is free to move anywhere on the screen...
-
آیدی کنترل های InputBox
یکشنبه 24 شهریور 1398 20:27
ارسال تکست به کپشن پنجره در صورت فشردن باتن Ok در صورتیکه تعداد کاراکتر داخل کنترل ادیت بیشتر از 13 باشد Edit Control Notification Codes ' EN_SETFOCUS=&H100 EN_KILLFOCUS=&H200 EN_CHANGE=&H300 Parameters wParam The LOWORD contains the identifier of the edit control .The HIWORD specifies the notification...
-
NCCALCSIZE TO MAKE A SPACE
یکشنبه 24 شهریور 1398 18:18
WVR_ALIGNBOTTOM = 64 WVR_ALIGNLEFT = 32 WVR_ALIGNRIGHT = 128 WVR_ALIGNTOP = 16 WVR_HREDRAW = 256 WVR_REDRAW = WVR_HREDRAW + WVR_VREDRAW WVR_VALIDRECTS = 1024 WVR_VREDRAW = 512 Type RECT left As Long right As Long top As Long bottom As Long End Typd Type NCCALCSIZE_PARAMS rgrc(3) As RECT lppos As WINDOWPOS End Type...
-
lParam LoWord/HiWord
یکشنبه 24 شهریور 1398 14:04
Dim pt As POINTAPI Dim rrr As RECT (pt.x = CLng( lParam And 65535 ( pt.y = CLng( lParam / 65535 ClientToScreen hwnd, pt GetWindowRect hwnd, rrr
-
نمایش بالن راهنما در EDIT CONTROL
شنبه 23 شهریور 1398 22:57
EM_SHOWBALLOONTIP displays a balloon tip associated with an edit control Parameters : wParam Not used; must be zero lParam این پارامتر یک نشانگر به ساختار EDITBALLONTIP ( ممبر یا عضوهای ساختار در ادامه آمده ) که حاوی اطلاعات درباره ی بالن راهنمای جهت نمایش است . A pointer to an EDITBALLOONTIP structure that contains...
-
تنظیم نشانه ی متن در EDIT CONTROL
شنبه 23 شهریور 1398 20:56
ارسال توسط تابع SendMessageA : SendMessageA hwndEdit,EM_SETCUEBANNER,0,ByVal "User Name" ECM_FIRST =&H1500 The following messages need Unicode strings ( EM_SETCUEBANNER =(ECM_FIRST + 1 (EM_GETCUEBANNER=(ECM_FIRST + 2 (EM_SHOWBALLOONTIP=(ECM_FIRST + 3 (EM_HIDEBALLOONTIP=(ECM_FIRST + 4...
-
تنظیم رنگ پس زمینه ی EDIT CONTROL
شنبه 23 شهریور 1398 20:13
EM_SETBKGNDCOLOR The EM_SETBKGNDCOLOR message sets the background color for a rich edit control. wParam Specifies whether to use the system color. If this parameter is a nonzero value, the background is set to the window background system color. Otherwise, the .background is set to the specified color lParam A...
-
تنظیم حاشیه ها در EDIT CONTROL
شنبه 23 شهریور 1398 19:46
: wParam EC_LEFTMARGIN EC_RIGHTMARGIN : lParam The LOWORD specifies the new width of the left margin, in pixels. This value is ignored if wParam does not include EC_LEFTMARGIN The HIWORD specifies the new width of the right margin, in pixels. This value is ignored if wParam does not include EC_RIGHTMARGIN. EM_SETRECT...
-
WM_CTLCOLORDLG
دوشنبه 18 شهریور 1398 17:08
win32api/reference/Message/WM_CTLCOLORDLG.htm WM_CTLCOLORDLG Static wBrush If wBrush<>0 Then (hBM=LoadImage(0,"tile.bmp",0,0,0,0x2010 (wBrush=CreatePatternBrush(hBM Function=wBrush
-
FrameRect
دوشنبه 18 شهریور 1398 14:22
Const SM_CXFRAME=32 Const SM_CYFRAME=33 Const SM_CYSIZE 31 The height of a button in a window caption or title bar' .in pixels framerect setrect fillrect ()Sub Button2_on Dim fWidth As Long Dim fHeight As Long Dim RndCol As Long Dim hBrush As Long Dim Ret As Long fWidth=GetSystemMetrics(SM_CXFRAME)*2...
-
WM_LBUTTONDOWN
دوشنبه 18 شهریور 1398 13:09
using-brushes case WM_LBUTTONDOWN Store the mouse coordinates in a POINT structure' ptlHit=MAKEPOINTS((POINTS FAR *)lParam Create a rectangular region with dimensions and' coordinates that correspond to those of the grid window ,hrgnCell=CreateRectRgn(rctGrid.left, rctGrid.top (rctGrid.right, rctGrid.bottom Retrieve a...
-
CreateHatchBrush/ CreatePatternBrush
دوشنبه 18 شهریور 1398 12:14
hatch-brush ((hBrush=CreateSolidBrush (RGB(0, 0, 255 Associate the brush with the display device context' SelectObject hdc, hBrush Draw a rectangle with blue background' Rectangle hdc, 400,40,800,400 Create a hatch brush that draws horizontal red line' ,hBrush=CreateHatchBrush(HatchStyleHorizontal ((RGB(255, 0, 0 Set...
-
EDIT CONTROL اعلان ( Notification) / محدودیت تکست / ارسال تکست Edit به کپشن پنجره اصلی
یکشنبه 17 شهریور 1398 23:48
EN_CHANGE wParam The LOWORD contains the identifier of the edit control. The HIWORD specifies the notification code. lParam A handle to the edit control. ' Edit styles const' ES_LEFT = 0x0000 ES_CENTER = 0x0001 ES_RIGHT = 0x0002 ES_MULTILINE = 0x0004 ES_UPPERCASE = 0x0008 ES_LOWERCASE = 0x0010 ES_PASSWORD = 0x0020...
-
PushButton
یکشنبه 17 شهریور 1398 23:29
-
MOUSEMOVE / XPOS
یکشنبه 17 شهریور 1398 17:16
WParwm : LBUTTON Or RBUTTON lParam Lo مختصات x کرسر را مشخص میکند . مختصات مرتبط با گوشه چپ بالایی از منطقه Client The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area ho مختصات y کرسر را مشخص میکند . مختصات مرتبط با گوشه چپ بالایی منطقه...
-
NCCALCSIZE ( محاسبه ی اندازه در Non Client )
شنبه 16 شهریور 1398 17:33
اولین مستطیل یا Rectangle حاوی مختصات جدید پنجره که جابجا یا تغییر سایز شده است طبق داکیومنت زیر When the window procedure receives the WM_NCCALCSIZE message, the first rectangle contains the new coordinates of a window that has been moved or resized , that is, it is the proposed new window coordinates. The second...
-
HITTEST
شنبه 16 شهریور 1398 14:53
Type MARGINS cxLeftWidth As Long cxRightWidth As Long cyTopHeight As Long cyBottomHeight As Long End Type Extends the window frame into the client area' DwmExtendFrameIntoClientArea (hWnd, ByRef (MARGINS ------------------------------------------------------------- if (m.Msg=&H83 And WParam=1) Then Dim nccsp As...
-
WM_MOUSEACTIVATE
شنبه 16 شهریور 1398 11:42
.wParam: Handle to the active top-level parent window LOWORD (lParam): Hit test value where the mouse is clicked. If you clicked the work area, the HTCLIENT .value is passed HIWORD (lParam): The ID of the mouse message that caused this message. Depending on the return value of this message, mouse messages are either...