I've created a window using the following:
OPENWINDOW win_main,0,0,ScreenX,ScreenY,@SIZE|@MINBOX|@MAXBOX|@HIDDEN,0,wtitle$,&whandler_main
It opens the window at 3/4 screen size.
At the top right of the window is the _, the box , and the x to min, max, and close
If I click the box to maximize it does just that to the window.
But instead of max box changing to a double box so you can restore the window to its previous size it remains the single maximize button.
All I can do from then on is minimize the window or maximize it.
If I go to the task bar(XP) and right click the icon for my window then the popup menu has restore disabled.
All my other programs work just fine. It's just this one program.
Anyone have any ideas?
Larry
Ummm...not without seeing more than an openwindow line. How are you unhiding it? What is the handler doing in say @IDCREATE?
The line you've provided would open a window as hidden, so there wouldn't be any min/max boxes ;).
Paul.
I'm using this(and the rest of the code that goes with it) to show the window.
if RegGetDword(REG_KEY,"FirstRun",1)
RegSetDword(REG_KEY,"FirstRun",0)
ShowWindow win_main,@SWshow
you should recognize that code.
I never hide it again
CASE @IDCREATE
CENTERWINDOW win_main
case @IDSIZE
case& @IDSIZing
GETSIZE win_main, l, t, w, h
if w< 500 then w=500
if h<400 then h=400
setsize win_main, l, t, w, h
resizeall()
and the resize function
global sub resizeall()
int w=0,h=0
GETCLIENTSIZE win_main, w, h, w, h
MoveWindow(win_index1.hwnd,4,30,440,h-34,1)
MoveWindow(win_index2.hwnd,4,30,440,h-34,1)
MoveWindow(win_index3.hwnd,4,30,440,h-34,1)
MoveWindow(win_results.hwnd,4,30,440,h-34,1)
MoveWindow(win_code.hwnd,4,30,w-8,h-34,1)
return
endsub
which only positions child windows.
Larry
I took out the :
setsize win_main, l, t, w, h
and the maximize/restore button started working correctly
Larry
Don't try and force the window to a particular size using an @IDSIZE/@IDSIZING messages , doing so will interfere with Windows when it maximizes as your SETSIZE command will override the "maximized" state. What is happening is you are getting the size of the window, and than immediately trying to resize it with the same values. When a window is maximized this will remove the restored sizes and just set the window to the same dimensions as a full screen maximized window, with nothing to restore.
Instead process the message WM_GETMINMAXINFO
select @message
case WM_GETMINMAXINFO
*<MINMAXINFO>@lparam.ptMinTrackSize.x = 500
*<MINMAXINFO>@lparam.ptMinTrackSize.y = 400
$include "windows.inc" or "windowssdk.inc" to use this.
Paul
Thanks!
Larry
Works great, but I wouldn't have expected otherwise.
As usual, it's not the language; it's the idiot coding in it. ;D
Thanks again,
Larry
Thank you from me also!
Allan