IonicWind Software

IWBasic => General Questions => Topic started by: Brian on July 24, 2013, 12:46:52 PM

Title: Opening a Window
Post by: Brian on July 24, 2013, 12:46:52 PM
Erm, I'm sure this has been asked before, but:

I'm opening a program window, and I want it to be the full size of the screen, but not
counting the taskbar at the bottom. I've also got a statusbar.
I've been experimenting with getscreensize, etc, but getting nowhere.
What's the correct procedure to open a program window whatever your screen size is, please?

Brian
Title: Re: Opening a Window
Post by: billhsln on July 24, 2013, 01:46:19 PM
I found this in the forum:

http://www.ionicwind.com/forums/index.php?topic=4954.0

Bill
Title: Re: Opening a Window
Post by: aurelCB on July 24, 2013, 02:25:14 PM
I will try to guess...
resize to @maximize
getwindowsize
setwindowsize-32 vartical
;)
Title: Re: Opening a Window
Post by: LarryMc on July 24, 2013, 06:08:59 PM
The following is the proper way to do it.
It takes into account whether or not the task bar is in auto-hide mode, where the taskbar is located (bottom, left, top, right) and whether or not the taskbar is set for small icons or large icons.
AUTODEFINE "OFF"
const SPI_GETWORKAREA = 0x0030
DECLARE IMPORT,SystemParametersInfo ALIAS SystemParametersInfoA(uiAction as UINT,uiParam as UINT,pvParam as POINTER,fWinIni as UINT),INT

winrect srect
int l,t,w,h
window w1

SystemParametersInfo(SPI_GETWORKAREA,0,srect,0)

l = srect.left
t = srect.top
w = srect.right-srect.left
h = srect.bottom-srect.top

openwindow w1, l, t, w, h, @CAPTION|@SYSMENU, 0, "Dodge the Taskbar", &mainHandler
WAITUNTIL ISWINDOWCLOSED w1
END

SUB mainHandler(),INT
   SELECT @MESSAGE
CASE @IDCLOSEWINDOW
closewindow w1
ENDSELECT
RETURN 0
ENDSUB
Title: Re: Opening a Window
Post by: Brian on July 25, 2013, 01:47:32 AM
That's great, Larry - got some kind of code working already but, of course
you always come up trumps!

Brian