LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Child window refresh issue with LabVIEW 8.0

Well, given that this is attempting to do something that LabVIEW wasn't designed to do, I'm not surprised that it crashes here and there. The reason why I put in the bit of code for the refresh was to deal with the issue that sometimes the window doesn't get refreshed and it gets drawn incorrectly. This was discussed earlier in the thread. Without the call to the SetWindowPos and UpdateWindow functions in the "Create Window Dependencies" subVI (which is the same code as your VI), the window still pops up and gets placed in the client area of the parent window. It's just that (a) its position is not determined by the setup of the child window's properties, and (b) sometimes the child window was not drawn correctly (see thread for example).

When I ran the most recent code I uploaded on my computer just recently the child window gets drawn properly, even with the calls to SetWindowPos and UpdateWindow functions disabled. It's possible this has to do with combinations of settings, but I did not delve too much into it since I saw the use of this technique to be quite limited. I certainly had no use for it, but it was an interesting problem to investigate.
Message 21 of 26
(1,535 Views)
>So the bottom line is, probably don't stop the parent window until all the child windows are stopped.  (I am also assuming, although I have
>not tested, that just closing a parent window does not STOP all the child VIs from continuing to RUN - i.e., they must be formally stopped
>as is normal with LabVIEW VIs).
 
 
When parent window gets closed, child windows will close with parent, and LV will not be notified.
Before close parent window, release child windows first by set parent again with parent handle equal to 0.
 
 
George Zou
 
 
George Zou
Message 22 of 26
(1,532 Views)

OK, that would likely assure a smooth close also so as not to make LabVIEW crash.  It may be redundant in my case since things are working but probably worthwhile to add it in.

Now that making a floating window a child window seems to have been addressed, is there a way to make a modal window a child window?  I tried to apply the proven technique to a modal window situation where a modal window is called from within a floating window which itself has been defined as a child window - I want the modal window to be a child to the same parent as the calling child window has.  It did not work properly, creating strange draw problems and wanting to stay within the bounds of the calling child window (which I did not ask it to do).

Sincerely,

Don

0 Kudos
Message 23 of 26
(1,528 Views)
Don't make a dialog window as a child window.  It's not recommanded by Microsoft.
 
 
George Zou
 
George Zou
Message 24 of 26
(1,515 Views)
Ok...Thanks for the help from both of you.......Don
0 Kudos
Message 25 of 26
(1,511 Views)
Here is a single VI that will allow you to make or release a child window based on George's advice.....Don
0 Kudos
Message 26 of 26
(1,487 Views)