How to know number of windows opened

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

How to know number of windows opened

Post by sudip »

Hello All,
Is there any way to know the number of windows opened?
Thanks in advance.
With best regards.
Sudip
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5481
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How to know number of windows opened

Post by Rathinagiri »

On seeing h_init.prg line no. 131 there is a system variable for all the form types defined by a HMG application.

Code: Select all

_HMG_SYSDATA [  69 ] -> _HMG_aFormType
The length of this _HMG_SYSDATA[69] will be equal to the total number of forms defined at any time.

So, you can use len(_HMG_SYSDATA[69]) to find out the number of forms.

Split child windows are also taken into account as forms. This array can have values "A","C","S","M","X"

"A" means Main Window
"C" means Child Window
"X" means Splitchild Window
"M" means Modal window
"S" means Standard window

If you want the number of main, modal and child windows use this loop. :)

Code: Select all

nCount := 0
for i := 1 to len(_HMG_SYSDATA[69])
   if (_HMG_SYSDATA[69,i] == "A" .or. _HMG_SYSDATA[69,i] == "M" .or. _HMG_SYSDATA[69,i] == "C")
      nCount++
   endif
next i
msginfo("There are "+str(nCount)+" windows defined")
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: How to know number of windows opened

Post by sudip »

Thanks a lot Rathi,
Great!!! :D
I want it to ensure that when user will try to change Accounting Year online, no other window (except main window) will be opened :)
Your code will be extremely helpful to me :)
With best regards.
Sudip
With best regards,
Sudip
User avatar
luisvasquezcl
Posts: 1261
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: How to know number of windows opened

Post by luisvasquezcl »

Hi Rathi
very interesting and instructive your comment, thanks
Best regards,
Luis Vasquez.
User avatar
Alex Gustow
Posts: 290
Joined: Thu Dec 04, 2008 1:05 pm
Location: Yekaterinburg, Russia
Contact:

Re: How to know number of windows opened

Post by Alex Gustow »

Hi Rathi! Great! Thanks!
Post Reply