Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

All open Windows

Status
Not open for further replies.

Scott24x7

Programmer
Jul 12, 2001
2,828
JP
Is there a way to programatically get the names of all windows that are open within the Fox application, and then list them in a drop-down Menu dynamically, so that users can just "jump" to that window if it is open but otherwise hidden from them?


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 

Scott,

Very easy. In fact, you don't need any coding. Just add a Window menu to your menu system, and you'll get what you are asking for.

To do that, start a menu in the menu designer. Choose the Quick Menu option. Then delete all the pads except the Window pad. Generate the menu, and DO it from your application.

If you prefer to display the list in a different way, you can do it by looping through _SCREEN.Forms. You would have to display the results in a list box or grid, the calls the relevant form's Activate when the user clicks on a form name.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,
I tried this but my Window menu item is disabled... there is no "Skip for" clause, so I don't know what's wrong with it....


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 

Scott,

What have you got in the Prompt Options dialogue (in the Menu designer) for the top-level Window pad? The pad name should be _msm_windo.

Also, check the code in the generated MPR file. It should look something like this:

Code:
DEFINE PAD _msm_windo OF _MSYSMENU PROMPT "\<Window" ;
  NEGOTIATE  RIGHT, LEFT ;
  KEY ALT+W, "" ;
  MESSAGE "Manipulates windows ..."
ON PAD _msm_windo OF _MSYSMENU ACTIVATE POPUP _mwindow

In fact, you could try pasting the above code into a file and executing it.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top