jlada Posted May 5, 2004 Report Share Posted May 5, 2004 I have written a time tracking application (Application Builder in LV 7.0) which works well enough. It has a (configurable) 'reminder' function which pops up a small window, asking whether to continue tracking the task or not. The popup counts itself down to zero and closes if no response is given. This is in case I leave the computer and forget to shut off the tracking manually. The problem is that I cannot ensure that the popup window will open up on top of whatever program it is that I may be working on. In this case, it times out and shuts off the tracking function in the main app - behind whatever I'm working on. I'm using an Open VI Reference and a Property Node (w/ FP.Open & FP.IsFrontMost True) to try and open it on top. The IsFrontMost property notes that "Setting this property will wait until the user interface is not busy". The meaning of this note isn't clear to me. I have tried, unsuccessfully, to have the popup itself continuously calling the IsFrontMost property on it's own reference, but either I'm calling it incorrectly or it doesn't work that way. I'm going to explore the 'events' functions in order that the main app doesn't bother to call the popup if there's any activity on the computer, but I would still like to be able to place the popup on top. Any help is appreciated. Thanks, Jeff :headbang: Quote Link to comment
Michael Aivaliotis Posted May 7, 2004 Report Share Posted May 7, 2004 You can't do this using any of the built-in LabVIEW functions or capabilities. For this to work you need to make a call to the user32.dll in Windows. There is a collection of VI's available from many sources that will do this for you. Here is a link to NI's site where you can get them: Windows API Function Utilities (32-bit) for LabVIEW In any case, I've put together a LV7.0 version of a VI that will do exactly what you ask. I've attached this. Download File:post-19-1083913103.llb Quote Link to comment
jlada Posted May 7, 2004 Author Report Share Posted May 7, 2004 Thanks Michael; I did find that set of utilities after posting the question. In experimenting I found that yes, the window will popup over all other LabView windows but will not popup over any other applications running. This seems to be exactly what happens with your vi as well. I compiled your vi to an executable and tried it again, in case that changed the behaviour - but it didn't. I'm running Windows 2000 if that has any bearing. Jeff Quote Link to comment
Michael Aivaliotis Posted May 8, 2004 Report Share Posted May 8, 2004 I found that yes, the window will popup over all other LabView windows but will not popup over any other applications running. This seems to be exactly what happens with your vi as well. I compiled your vi to an executable and tried it again, in case that changed the behaviour - but it didn't. Windows 2K should not matter and running an executable should not matter as well. This is strange, I've never had a problem with this method on any platform. I'm not sure what is different on your computer. You should try this on another machine and see it it has the same behaviour. Since you have all the utilities, you will see another one called: make window always on top. This will make the widow frontmost always even if you click another app. Try this one and let us know. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.