How to get the 'overall' size of a Form ?

General APL language issues

How to get the 'overall' size of a Form ?

Postby PGilbert on Thu Jul 16, 2020 12:55 pm

When a Dyalog Form is created you can get the dimension and position of the area that is inside the Form (Client Area) with the properties .Size and .Posn . But how do we get the overall dimension of the Form ?

Normally I would do that in APL2000 to get that:
      h ← formname ⎕WI 'hwnd'
(Fleft Ftop Fright Fbottom) ← ⎕WCALL 'GetWindowRect' h (4⍴⎕TCNULL)


What would be the equivalent in Dyalog Apl.

Thanks.
User avatar
PGilbert
 
Posts: 436
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: How to get the 'overall' size of a Form ?

Postby Vince|Dyalog on Fri Jul 17, 2020 11:45 am

Hi Pierre,

In our supplied workspaces, we have a quadna.dws which illustrates how to use our ⎕NA system function.

One of the examples in its Windows namespace is called GetDumpWindow which takes a screenshot of a form.

That uses GetWindowRect as well.

Here is the equivalent code to find the Window Rect of a form:
      'f' ⎕wc 'form'
h←'f' ⎕wg 'handle'
⎕NA'U4 user32|GetWindowRect P >{U4 U4 U4 U4}'
res (Fleft Ftop Fright Fbottom)←GetWindowRect h(4⍴256)


Regards,

Vince
Vince|Dyalog
 
Posts: 412
Joined: Wed Oct 01, 2008 9:39 am

Re: How to get the 'overall' size of a Form ?

Postby PGilbert on Fri Jul 17, 2020 1:15 pm

Many thanks Vince it's working.
User avatar
PGilbert
 
Posts: 436
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest