minimize and maximize box

BelaB

New Member
hi!

i used the example from global-shard.com/api to remove the min/max buttons from the title bar!
But how do I create new if they are removed?

Thanks
 
If the Window Hasn't been realised you can use:

Code:
Wwin:min-button = true.
Wwin:max-button = true.

If the window has been realised you can use:

Code:
def var li_hwnd as int no-undo.

procedure SetWindowLongA external "user32.dll":
    def input parameter hwnd as long.
    def input parameter nIndex as long.
    def input parameter dwNewLong as long.
end procedure.

procedure GetParent external "user32.dll":
    def input parameter hwnd as long.
    def return parameter WinLong as long.
end procedure.

run GetParent({&WINDOW-NAME}:hwnd, output li_hwnd).
run SetWindowLongA(li_hwnd, -16, 348848128).


the 3488... number contains the windows attributes and you can use GetWindowLongA(li_hwnd, -16, output li_long) to enquire on the current window attributes to set other options (eg disable X in top right of window)
 
Hi

Thx for your quick reply - BelaB has posted this question for
me but now he is ill - an i have to solve this problem.
The Window is already realized and i have to manage
the min/max button...
But my know how on progress is not that good - so please can
you post me or mail me an example ?
Thx in advance for a quick reply.
Kind Rgds

Nobby

email teuber@ess-wowi.de
 
After testing my example solution Nobby reported that the window buttons didn't redraw unless you hide/viewed the window.
From the microsoft documentation on SetWindowPos
If you have changed certain window data using SetWindowLong, you must call SetWindowPos to have the changes take effect. Use the following combination for uFlags: SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED
The updated method when windows have been realised is as follows
Code:
def var li_hwnd as int no-undo.

procedure GetParent external "user32.dll":
    def input parameter hwnd as long.
    def return parameter WinLong as long.
end procedure.

procedure SetWindowLongA external "user32.dll":
    def input parameter hwnd as long.
    def input parameter nIndex as long.
    def input parameter dwNewLong as long.
end procedure.

procedure SetWindowPos external "user32.dll":
    def input parameter hwnd as long.
    def input parameter InsAfter as long.
    def input parameter x as short.
    def input parameter y as short.
    def input parameter cx as short.
    def input parameter xy as short.
    def input parameter uFlags as unsigned-short.
end procedure

run GetParent({&WINDOW-NAME}:hwnd, output li_hwnd).
run SetWindowLongA(li_hwnd, -16, 348848128).
run SetWindowPos(li_hwnd, 0, 0, 0, 0, 0, 2 + 1 + 4 + 32). /*SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED */
 
Back
Top