-
DrawBackground
سهشنبه 9 مهر 1398 19:55
HDC hdc = GetDC(m_hWnd) m_hMemDC=CreateCompatibleDC(hdc) SelectObject m_hMemDC,m_hBKbitmap m_hStretchedBitmap=CreateCompatibleBitmap(hdc,WndClintRect.right-WndClintRect.left,WndClintRect.bottom- WndClintRect.top) m_hStretchedMem=CreateCompatibleDC(hdc) SelectObject m_hStretchedMem,m_hStretchedBitmapReleaseDC m_hWnd,...
-
WM_SETCURSOR
سهشنبه 9 مهر 1398 17:04
Case &H20 ' WM_SETCURSOR (If GetClassName(wParam) = "Button" Then MsgBox GetWindowText(wParam ( SetWindowTextA Et, "Class : " & GetClassName(wParam) & " Text : " & GetWindowText(wParam
-
ثابت های Cursor
دوشنبه 8 مهر 1398 19:24
static APPSTARTING := 32650 HAND := 32649 ARROW := 32512 CROSS := 32515 IBEAM := 32513 NO := 32648 SIZE := 32646 SIZENESW := 32643 SIZENS := 32645 SIZENWSE := 32642 SIZEWE := 32644 UPARROW := 32516 WAIT := 32514 SIZEWE_BIG := 32653 SIZEALL_BIG := 32654 SIZEN_BIG := 32655 SIZES_BIG := 32656 SIZEW_BIG := 32657 SIZEE_BIG...
-
ترسیم دکمه ای شکل ( Button shaped) در InputBox استفاده از DrawFrameControl
دوشنبه 8 مهر 1398 14:24
با DrawIcon هم می توان آیکونی را در DC صفحه انداخت
-
ExcludeClipRect
شنبه 6 مهر 1398 22:52
wnd_proc Windowproc///// case WM_CTLCOLOREDIT dc = (HDC)wparam hwnd =(HWND)lparam RECT r GetClientRect hwnd,r excluding the margin, but not the border; this assumes ' a one pixel wide border ' r.left =r.right-some_margin' --r.right' r.left=r.left+2 r.right=r.right+16 r.top=r.top+2 r.bottom=r.bottom-2 ExcludeClipRect...
-
EDIT : PARTS & STATES
شنبه 6 مهر 1398 21:38
// EDITSTYLE class parts and states // # define VSCLASS_EDITSTYLE L " EDITSTYLE " # define VSCLASS_EDIT L " EDIT " enum EDITPARTS { EP_EDITTEXT = 1 , EP_CARET = 2 , EP_BACKGROUND = 3 , EP_PASSWORD = 4 , EP_BACKGROUNDWITHBORDER = 5 , EP_EDITBORDER_NOSCROLL = 6 , EP_EDITBORDER_HSCROLL = 7 ,...
-
عملگر واگذاری تفریق و جمع در C#
شنبه 6 مهر 1398 19:05
case WM_NCCALCSIZE if wparam Then ncsp--> lparam GetWindowRect HWND,rc rc.right -= rc.left pnccs->rgrc[0].right-=rc.right MoveWindow HWND,pnccs->rgrc[0].right, pnccs->rgrc[0].top,rc.right, pnccs->rgrc[0].bottom - pnccs->rgrc[0].top, TRUE End if break case WM_NCHITTEST if (lResult == HTNOWHERE) Then...
-
Change Size?
پنجشنبه 4 مهر 1398 22:09
Public Type Margins cyTopHeight As Long cxLeftWidth As Long cyBottomHeight As Long cxRightWidth As Long End Type Private dwmMargins As MARGINS ' Adjust (shrink) the client rectangle to accommodate' the border' 'about rgrc --> 0 new 1 old 2 window 'client rectangle ' 'before moved or resized ' nccsp.rgrc0.Top=0...
-
کلاس Combo در api
پنجشنبه 4 مهر 1398 20:34
Dim items() As String "FreeBSD", "OpenBSD", "NetBSD", "Solaris", "Arch" }; Case WM_CREATE,WM_SHOWWINDOW for i = 0 To 4 SendMessageW hwndCombo,CB_ADDSTRING, 0,(LPARAM) items(i) Next case WM_COMMAND if HIWORD(wParam)=BN_CLICKED Then SendMessage(hwndCombo,...
-
Drag A Window With Its Client Area
پنجشنبه 4 مهر 1398 18:30
-
MIN/MAX IN FORM
پنجشنبه 4 مهر 1398 18:05
hwnd = GetActiveWindow SetWindowLong hwnd, GWL_STYLE, GetWindowLong(hwnd,GWL_STYLE) Or p_str_Minimize_Maximize_Box SetWindowPos hwnd, 0, 0, 0, 0,0,SWP_FRAMECHANGED Or SWP_NOMOVE Or SWP_NOSIZE
-
EM_SETMARGINS پیامی برای تنظیم حاشیه در EDIT BOX
پنجشنبه 4 مهر 1398 14:27
تنظیم حاشیه در کنترل EDIT : wparam EC_LEFTMARGIN=&H1 EC_RIGHTMARGIN=&H2 : Msg EM_SETMARGINS=211 '&HD3 دسیمال 211 تبدیل به هگزا - ->> عدد دسیمال تقسیم بر 16 میشود 13 معادل آن D و حاصل تفریق عدد211 و حاصلضرب 13 در 16 میشود 3 .... نهایتا از کنار هم گذاشتن آنها D3 بدست می آید ، در تابع زیر پارامتر هندل...
-
GWL_USERDATA/GWL_ID
پنجشنبه 4 مهر 1398 12:44
hIcon2=CreateWindow('Static', nil, WS_VISIBLE or WS_CHILD or SS_ICON or WS_CLIPSIBLINGS, 507,2,3,120,hForm1,0,hInstance,nil) I put WS_CLIPSIBLINGS in these 2 Icons to prevent them from drawing on each other, remove the WS_CLIPSIBLINGS and resize the form making it wider or narrow and see what the Icons do}...
-
ترسیم خط با Polyline
چهارشنبه 3 مهر 1398 23:13
Const NUM =1000 (Const TWOPI = (2 * 3.14159 WndProc static int cxClient,cyClient Dim apt(NUM) As POINTAPI WM_PAINT (MoveToEx hdc, 0, cyClient / 2, NULL (LineTo hdc,cxClient,cyClient / 2 i=0 Do apt(i).x = i * cxClient / NUM (((apt(i).y =(cyClient / 2 * (1 - sin (TWOPI * i / NUM i=i+1 Loop Until I<NUM Polyline hdc,...
-
Polygon و توابع ترسیمی در API
چهارشنبه 3 مهر 1398 22:08
-
SETMARGINS IN EDIT CONTROL
چهارشنبه 3 مهر 1398 17:56
EC_LEFTMARGIN =&H1 EC_RIGHTMARGIN =&H2 EM_SETMARGINS=&HD3 : lParam The HIWORD specifies the new width of the right margin, in pixels. This value is ignoredif wParam does .notinclude EC_RIGHTMARGIN EM-SETMARGINS
-
ExcludeClipRect
چهارشنبه 3 مهر 1398 17:47
ExcludeClipRect ( aMessage . WParam , fButton . Left , top + 1 , fButton . Left + fButton . Width , fButton . Height );
-
زاویه
سهشنبه 2 مهر 1398 12:42
عدد پی تقسیم بر سینوس یک درجه 3.141592/0.01745240643? 180.009101472661 ? 2*(3.141592)/0.01745240643 360.018202945323 180.009101472661
-
ترسیم خط LineTo
دوشنبه 1 مهر 1398 21:32
تمام منابع خارجی Dim px As POINTAPI GetCursorPos px 'ClientToScreen hwnd, px MoveToEx hdc, 120, 30, px LineTo hdc, 140, 30 MoveToEx hdc, 120, 30, px LineTo hdc, 135, 15 ' Quarter MoveToEx hdc, 120, 30, px LineTo hdc, 134, 44 MoveToEx hdc, 120, 30, px LineTo hdc, 120, 50 ' Quarter MoveToEx hdc, 120, 30, px LineTo hdc,...
-
CreatePen ساخت قلم برای ترسیم
دوشنبه 1 مهر 1398 20:07
HPEN CreatePen( int iStyle, int cWidth, COLORREF color ); ()Edit::OnNcPaint pDC=GetDC( ) ? GetWindowDC GetWindowRect Edithwnd,Crect OffsetRect Crect,-rect.left,-rect.top 'Draw a single line around the outside (brush=RGB( 255, 0, 0 FrameRect pDC,Crect,brush ReleaseDC hwnd,pDC Const PS_SOLID = 0 Const PS_DASH = 1 Const...
-
Paint InputBox
دوشنبه 1 مهر 1398 12:35
موارد پایین تست شده ... البته اینها موارد ساده ای هستند و پیش پا افتاده Public Function CallWindProc(ByVal hwnd As LongPtr, ByVal Msg As Long, ByVal wParam As LongPtr, ByVal lParam As LongPtr) As LongPtr Dim hdc As LongPtr Select Case Msg Case WM_PAINT Dim cc As RECT GetClientRect hwnd, cc (hdc = GetDC(hwnd ((FillRect...
-
Timers and Animation
یکشنبه 31 شهریور 1398 21:59
Dim ps As PAINTSTRUCT Dim hdc As Long (hdc=BeginPaint(hWnd,ps ((hbrOld=SelectObject(hdc,GetStockObject(HOLLOW_BRUSH draw your ellipses here' Ellipse hdc, 300, 300, 500, 510 EndPaint hwnd,ps : Animation const BALL_MOVE=2 Type BALLINFO width height x y dx dy End Type dim g_ballInfo As BALLINFO const int ID_TIMER = 1 در...
-
How To Drag
یکشنبه 31 شهریور 1398 19:37
منابع : win32/controls/drag-an-image draw_a_dragging_rectangle_on_screen_dc
-
MOVECURSOR رسم مستطیل
یکشنبه 31 شهریور 1398 16:25
WM_MOUSEMOVE Dim p As POINTAPI GetCursorPos p ScreenToClient hwnd, p Dim ff As RECT Dim ff1 As RECT SetRect ff, p.x, p.y, p.x, p.y ff.Left = p.x - 15 ff.Top = p.y - 15 ff.right = p.x + 35 ff.bottom = p.y + 30 DrawFrameControl GetDC(hwnd), ff, DFC_BUTTON, DFCS_BUTTONPUSH RoundRect GetDC(hwnd), ff.Left, ff.Top,...
-
SetCursorPos
شنبه 30 شهریور 1398 23:01
انتقال کرسر به مختصات صفحه ی مشخص شده. Moves the cursor to the specified screen coordinates. If the new coordinates are not within the screen rectangle set by the most recent ClipCursor function call, the system automatically adjusts the coordinates .so that the cursor stays within the rectangle
-
BUTTON_CLICK ( ترسیم لبه در پنجره کلاس 32770# )
شنبه 30 شهریور 1398 17:10
در BS_OWNERDRAW یا خود Button کار نمی کند نتیجتا ترسیم شد ( منظور ناحیه ای که در تصویر پایین داخلش تکست Inside ترسیم شده) . DrawEdge و DrawTextA dim rr as RECT If wMsg = WM_PAINT Then z1.Left = 285 + GetSystemMetrics(SM_CYFRAME) * 3 ' 296 z1.right = 348 + GetSystemMetrics(SM_CYFRAME) * 2 ' 355 z1.Top = 63 +...
-
MOUSEMOVE
جمعه 29 شهریور 1398 20:27
کدام درست و منطقی تر است ؟ WM_MOUSEMOVE Dim rc As RECT Din pt As POINT SetRect rc, 0,0,5,5 (Pt.x=LOWORD(LParam (Pt.y=HIWORD(LParam if PtInRect(rc,pt.x,pt.y) Then Msgbox "in" Else Msgbox "Out" End If For x = rc.Left To rc.Right For y = rc.Top To rc.Bottom If PtInRect(rc, x, y) Then Msgbox...
-
Timer
جمعه 29 شهریور 1398 18:46
Private sTitle As String Private TitleHandle As Long On Load Or After (Msgbox,Inputbox) : TitleHandle=0 in Hook Window Or Timer : If TitleHandle = 0 Then TitleHandle (FindWindow("#32770", sTitle= If TitleHandle <> 0 Then . End if
-
CustomButton_MouseMove
جمعه 29 شهریور 1398 13:02
WM_MOUSEMOVE Dim pt As POINTAPI Dim cursorPoint As Longptr Dim rc As RECT (pt.x=loword(lparam (pt.y=hiword(lparam (cursorPoint=ScreenToClient (hwnd,pt??? rc.left=0 rc.right=0 rc.right=rc.left+5 rc.bottom=rc.top+5 (If PtInRect(rc, cursorPoint "SetWindowTextA hwnd,"in End if wParam : virtual keys like...
-
SETWINDOWPOS
جمعه 29 شهریور 1398 00:09
SWP_FRAMECHANGED &H20 Applies new frame styles set using the SetWindowLongfunction. Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZEis sent only when the window's size is being changed If you have changed certain window data...