Jump to content

Resizable status bar without SBARS_SIZEGRIP


Go to solution Solved by pixelsearch,

Recommended Posts

Posted

Call for help:

If anyone is good at combining bitmaps, can you please help?

I am painting the sizegrip part in ScrollbarProc because that is the only way I could figure it out. It works, but would not be very efficient since it would constantly be opening/closing the theme file.

Ideally, if it could be painted within the CreateDots function and become part of $hBitmap, that would be the best.

Please keep in mind that the size box window (Scrollbar class) is generally the height of the statusbar and therefore slightly larger than the sizegrip part. 

Posted (edited)
On 3/8/2026 at 11:27 AM, WildByDesign said:

Call for help:

If anyone is good at combining bitmaps, can you please help?

I ended up solving this. I didn't think that I could do it. But I never seem to give up, for better or worse. 😆

We already had a graphics object. And I needed a DC for it. Therefore, _GDIPlus_GraphicsGetDC() was required. So this is what ended up doing the job:

EDIT: The code below failed. No success. Back to the drawing board. More coffee.

EDIT2: Actually it is working. Maybe less coffee now. 😁

EDIT3: This method for painting the SP_GRIPPER seems to negate the need for the _WinAPI_RedrawWindow($g_hSizebox) in WM_MOVE and therefore negates the need for WM_MOVE completely. I remember the WM_MOVE would solve the issue when you drag the sizebox area off screen and back because it would redraw it because otherwise the dots would be scrambled up. This issue does not seem to occur with the SP_GRIPPER method and we may be able to get rid of WM_MOVE entirely.

Func CreateDots($iWidth, $iHeight, $iBackgroundColor, $iDotsColor) ; Andreik

    Local Const $SP_GRIPPER = 3
    Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight)
    Local $hGraphics = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    Local $hBrush = _GDIPlus_BrushCreateSolid($iDotsColor)
    _GDIPlus_GraphicsClear($hGraphics, $iBackgroundColor)

    ; SP_GRIPPER
    Local $hStatus = _WinAPI_OpenThemeData($g_hGui, 'Status')
    Local $tSIZE = _WinAPI_GetThemePartSize($hStatus, $SP_GRIPPER, 0, Null, Null, $TS_TRUE)
    $g_hGripSize = $tSIZE.X
    Local $hDC = _GDIPlus_GraphicsGetDC($hGraphics)
    Local $tRECT = _WinAPI_CreateRectEx($g_hGripSize, $g_hGripSize, $g_hGripSize, $g_hGripSize)
    _WinAPI_DrawThemeBackground($hStatus, 3, 0, $hDC, $tRECT)
    _WinAPI_CloseThemeData($hStatus)
    _GDIPlus_GraphicsReleaseDC($hGraphics, $hDC)

    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($hGraphics)
    Return $hBitmap
EndFunc   ;==>CreateDots

 

Edited by WildByDesign

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...