[comp.sys.amiga.tech] determining screen size

gt5784a@prism.gatech.EDU (REYNOLDS,WALTER GERALD JR) (05/03/90)

  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..

ecarroll@vax1.tcd.ie (Eddy Carroll) (05/06/90)

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