ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 02-24-2011
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default Using windowshow in a DLL

I'm using the windowshow function inside a DLL. But there it expects an unsigned int. Does this mean that I can only use that function to hide or show one of the system windows (1 = output etc)?
Or is there an other way to hide or show a control on a GUI.

Steven
  #2  
Old 02-24-2011
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

windowshow technically takes an HWND handle to a window, but since flexscript doesn't recognize the HWND type, we use an unsigned int.

The windowfromnode() command will convert a node reference into that node's associated HWND handle. You can also use getviewhwnd() to define which HWND you want, since depending on the window type, one node can have several HWND's associated with it (i.e. a tree view has 1. and HWND that is the tree, 2. an HWND that shows node data, i.e. code, and 3. an HWND that lets you edit a node's name)
The Following User Says Thank You to Anthony Johnson For This Useful Post:
Steven Hamoen (02-24-2011)
  #3  
Old 03-10-2011
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Anthony,

It does seems there is a problem with the systemwindow command. If I type in Flexscript: windowshow( systemwindow(1), 1) it opens a "console" window but not the output console, systemwindow(2) opens also a large console window () but higher numbers do nothing anymore.

Actually I was looking for a way to open the output console from within a DLL, so I wrote:

windowshow( (int)systemwindow(1), 1 );

This does open a "console" window just as in Flexscript, but I think something has been broken?

And is there a way to check if the window is already opened (or closed)?


Steven

(I found a way around the opening by using executestring, but that doesn't solve things like windowmove)
  #4  
Old 03-10-2011
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

windowshow() hides or unhides an existing window. It doesn't create windows. It is a wrapper around the C++ function ShowWindow (http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx) using SW_HIDE and SW_SHOW.

You should use applicationcommand() to open a console window. Use the following code to open and move the output console:

applicationcommand("outputconsole");
windowmove(systemwindow(1),50,50,500,500);

If you can't compile applicationcommand(), then it needs added to your FlexsimFuncs. It is already defined as visible and used in C++ code in defaultproject.
The Following User Says Thank You to Phil BoBo For This Useful Post:
Brandon Peterson (03-10-2011)
  #5  
Old 03-10-2011
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

Use the UI's method for showing an output console: applicationcommand("outputconsole"). In recent versions, the output, compiler and system consoles are available in the active view tree, so you should probably manipulate them through that and using windowfromnode() instead of systemwindow().
The Following 3 Users Say Thank You to Anthony Johnson For This Useful Post:
RalfGruber (03-10-2011)

Tags
dll, windowshandle, windowshow



All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.