May 13, 2024, 08:44:43 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Opening a Window

Started by Brian, July 24, 2013, 12:46:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian

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

billhsln

When all else fails, get a bigger hammer.

aurelCB

I will try to guess...
resize to @maximize
getwindowsize
setwindowsize-32 vartical
;)

LarryMc

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
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

That's great, Larry - got some kind of code working already but, of course
you always come up trumps!

Brian