Manually resizing with $RESIZE:ON
#8
Unfortunately WS_CHILD does not change the appearance. In fact, it adds an undesirable lack of focus. Run it, bring up the browser full screen then try to click the task bar icon. The window should pop up, right? Wrong. It won't regain focus as a child window. It probably needs instructions to do so. Anyway, since it doesn't make a difference, I tossed it.

So resize is now enabled but that ugly black row is still present. Half way home.


[Image: Screenshot-780.png]


Code: (Select All)
$RESIZE:ON
DECLARE DYNAMIC LIBRARY "user32"
    FUNCTION GetWindowLongA& (BYVAL hwnd AS LONG, BYVAL nIndex AS LONG)
    FUNCTION SetWindowLongA& (BYVAL hwnd AS LONG, BYVAL nIndex AS LONG, BYVAL dwNewLong AS LONG)
    FUNCTION SetWindowPos& (BYVAL hwnd AS LONG, BYVAL hWndInsertAfter AS LONG, BYVAL x AS LONG, BYVAL y AS LONG, BYVAL cx AS LONG, BYVAL cy AS LONG, BYVAL wFlags AS LONG)
END DECLARE
DIM hWnd AS LONG
hWnd = _WINDOWHANDLE
_DELAY .1
GWL_STYLE = -16
WS_SIZEBOX = &H40000 ' Same as WS_THICKBORDER = &H40000
WS_POPUP = &H4800000 ' Can be used to make a razor thin border but is not resizable.
ws_border = &H800000
WS_VISIBLE = &H10000000
WS_CHILD = &H40000000
DO
    winstyle& = GetWindowLongA&(hWnd, GWL_STYLE)
LOOP UNTIL winstyle&
DO
    a& = SetWindowLongA&(hWnd, GWL_STYLE, winstyle& AND WS_VISIBLE OR WS_SIZEBOX)
LOOP UNTIL a&
a& = SetWindowPos&(hWnd&, 0, 0, 0, 0, 0, 39) ' Required to allow printing where title bar used to be.
_DELAY .1

WIDTH 50, 25
PALETTE 7, 63
COLOR 0, 7
VIEW PRINT: CLS: LOCATE 2, 1: PRINT " Resize works, but ugly black row near top."

DO
    _LIMIT 30
    b$ = INKEY$
    IF LEN(b$) THEN
        IF b$ = CHR$(27) THEN END
        ' Restore title bar.
        a& = SetWindowLongA&(hWnd, GWL_STYLE, winstyle& OR ws_border)
        a& = SetWindowPos&(hWnd&, 0, 0, 0, 0, 0, 39)
        CLS: _DELAY .75
        LOCATE 2, 1: PRINT " Okay. Back to normal window again."
    END IF
LOOP

Pete
Reply


Messages In This Thread
Manually resizing with $RESIZE:ON - by SMcNeill - 07-24-2022, 08:28 PM
RE: Manually resizing with $RESIZE:ON - by Pete - 11-28-2022, 12:43 PM
RE: Manually resizing with $RESIZE:ON - by Dav - 11-28-2022, 04:37 PM
RE: Manually resizing with $RESIZE:ON - by Pete - 11-28-2022, 09:57 PM
RE: Manually resizing with $RESIZE:ON - by Pete - 11-28-2022, 11:42 PM



Users browsing this thread: 5 Guest(s)