🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #3470

Re: determining screen size

#3470
From: Eddy Carroll
Date: Sat, 05 May 1990 17:02
29 lines
1722 bytes
In article <8859@hydra.gatech.EDU>, gt5784a@prism.gatech.EDU
(REYNOLDS,WALTER GERALD JR) writes:
>   Many of you have said again and again how easy it is to obtain
> the current screen size.  Could someone please netemail the code to
> accomplish this?  Or, better yet, post it to the net so that
> everyone can have it.. I'm sure I can't be the only one that doesnt
> know how to do this.
> 
> thanx in advance..

Try this:

struct NewScreen myscreen = { ..... };	/* Usual new screen stuff */

    struct Screen wbscreen;

    ...
    GetScreenData(&wbscreen, sizeof(struct Screen), WBENCHSCREEN, NULL);
    myscreen.Width  = wbscreen.Width;
    myscreen.Height = wbscreen.Height;
    /* Now go ahead and open custom screen; width/height will be correct */

Exactly the same method can be used if you want to open a Workbench window
which is the full size of the screen, or for that matter, a smaller window
which is centered correctly in the middle of the screen.
-- 
Eddy Carroll           ----* Genuine MUD Wizard  | "You haven't lived until
ecarroll@vax1.tcd.ie                             |    you've died in MUD!"
ecarroll%vax1.tcd.ie@cunyvm.cuny.edu             |  -- Richard Bartle
Technical Details
Message-ID: <5988.2643073b@vax1.tcd.ie>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!eru!luth!sunic!mcsun!ukc!tcdcs!swift.cs.tcd.ie!vax1.tcd.ie!ecarroll
References: <8859@hydra.gatech.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!eru!luth!sunic!mcsun!ukc!tcdcs!swift.cs.tcd.ie!vax1.tcd.ie!ecarroll
From: ecarroll@vax1.tcd.ie (Eddy Carroll)
Newsgroups: comp.sys.amiga.tech
Subject: Re: determining screen size
Message-ID: <5988.2643073b@vax1.tcd.ie>
Date: 5 May 90 17:02:51 GMT
References: <8859@hydra.gatech.EDU>
Distribution: comp.sys.amiga.tech
Organization: Computer Laboratory, Trinity College Dublin
Lines: 29