1. David Vasconcelos
  2. PowerBuilder
  3. Thursday, 20 February 2020 16:50 PM UTC

is there a way to get a list of all open windows.  Not just sheets... looking to get popups, responses etc...

Thanks

(PB2017 R3)

Dave V

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 21 February 2020 15:14 PM UTC
  2. PowerBuilder
  3. # 1

Hi David;

  Roland has the correct reply & suggestion.

  You can see this feature at work in my framework. Its called the "Window Manager" service and it tracks all open windows regardless of their type. The WM is automatic and hidden and yo do not have to program for it like a PFC service.   Not only can you see the open windows at any time ..

Native:

Dockable:

WEB

  The framework uses the "Window Manager" service to close all open windows in the exact "reverse" order they were opened when a "Close All" request is made or the App is closing down altogether. The App Manager also produces Window (and its associated Menu) usage stats upon closure.  ;-)

  Feel free to check out how this works in the STD Integrated Framework's example OrderEntry Demo App ...

https://sourceforge.net/projects/stdfndclass/files/Applications/PowerBuilder/OrderEntry

HTH

Regards ... Chris

PS: This feature works in all Native, PowerServer Web / Mobile, and IWA deployed PB Apps.  Also, the framework is free and fully open sourced - so feel free to use this free framework or borrow this code for your framework and/or App directly.

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 20 February 2020 17:39 PM UTC
  2. PowerBuilder
  3. # 2

Not built in. You can add code to the open & close events of the base window objects. The code would keep track of the windows in a global.

Comment
  1. Miguel Leeuwe
  2. Thursday, 20 February 2020 19:01 PM UTC
Hi David,

How many windows do you have?

It's just a matter of creating an ancestor window, let's say w_master and then editing the source code replacing "from window" with "from w_master".

You could even export all windows and then use notepad++ to do a "find and replace in files".

After that, you'd only have to re-import the modified exported code.

  1. Helpful
  1. David Vasconcelos
  2. Thursday, 20 February 2020 19:14 PM UTC
By any change do any of you know how to tell if a handle is to a pb window. I was looking at the GetWindow API function and it returns a handle. how to "covert" the handle to a window so I can get to the windows Control[] array..
  1. Helpful
  1. David Peace (Powersoft)
  2. Friday, 21 February 2020 13:55 PM UTC
What Miguel described is the simplest way to retro fit inheritance then follow Rolands suggestion. Note there are two places in the Windows source where from window occurs, both need to be replaced.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.