ATTENTIONThis 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 |
#1
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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) |