LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I make a CVI message/prompt popup have focus (be on top of) the window of the application calling the CVI dll.

When using CVI dll's, called from another application, Is there some way to make the message/prompt popups always have focus, in other words always pop up on top of the other window?
0 Kudos
Message 1 of 4
(3,947 Views)
Hi Codewizard,

Generally, the message popups should initially have the focus when they are called. If this is not the case, could you provide some more information on what you are calling the DLL from that doesn't allow this behavior to occur?

I have attached a sample for you to try. It is a DLL that just does some message popups when called. The source file is also included. Hope this helps

Jeremy L.
National Instruments
Jeremy L.
National Instruments
0 Kudos
Message 2 of 4
(3,946 Views)
I have seen similar behavior where both a MessagePopup and a GenericPromptPopup have opened behind an application instead of on top. This has happened repeatedly/reliably on a system running WinXP using Measurement Studio 7.1. On a Win2K system with Measurement Studio 6, the behavior occurred the first time the dll was run but subsequent calls to the dll function (containing the popup call) had the dialog on top. If I called the "SetSystemPopupsAttribute (ATTR_MOVABLE, VI_FALSE)" function, the popup stayed behind my application window. Setting this attribute to TRUE brought it back to the top.

My application loads a UI and then runs a slave (COM) application into which the CVI dll is loaded.

Any insight as to why there is different runtime behaviors and, more importantly, how to make it always be on top would be much appreciated.

Regards,
Randy Gritton
0 Kudos
Message 3 of 4
(3,927 Views)
Hi Randy,

I'm still looking around to see if I can find any big differences in runtime engines that affect popups, but in the meantime would be feasible for you to just create a panel and call InstallPopup in place of those MessagePopups? This might be a reasonable interim solution while we investigate further. Also, can you send me some small example code that you have that exhibits this behavior predictably on your machine? I would like to reproduce the error in house and then attempt to get some developers involved if we can see the behavior you're seeing. Thanks again for your cooperation!
Jeremy L.
National Instruments
0 Kudos
Message 4 of 4
(3,913 Views)