02-20-2007 07:12 PM
02-21-2007 01:22 AM
Hello Steve,
I could not quite understand your question. In CVI you already need to specify a panel handle to install a panel popup (using the function InstallPopup). There is no other way. If the popups you are talking about are the ones displayed by MessagePopup, ConfirmPopup, etc then I do not know a "direct" solution for this.
However, when I need such functionality, I design my own popup panels and use them instead of CVI popups. I write a function that loads that panel as a child in the currently displayed panel and displays my text (which I enter the function as a parameter) and shows appropriate buttons ("OK", "Cancel", "Abort", etc) according to the message. You can position this child panel whereever you like within the parent panel.
This way you can have a very flexible message popup. One more advantage: you can design it to match your other panels' color, font, etc. I can post a sample code if you need.
Hope this helps.
02-21-2007 02:39 AM
Hello Steve,
you can use the SDK functions to achieve your goal. I found a solution but I must confess that it is not a very nice one I attached the project to this message. What I do is the following:
Before calling the MessagePopup function, I start a second thread. This thread searches for the MessagePopup window, and gets a window handle for this window. Therefore I use the FindWindow SDK function, which is described here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/wi....
When a handle is obtained, the position of this window can be adjusted using the SetWindowPos function, described here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/wi...
IMPORTANT: don't forget to include <windows.h> in your file!
This needs to be done in a second thread, because the MessagePopup function quits after the user hits the OK button, so in the meantime no User Interface adjustments can be made. The main disadvantage of this approach is that you can see the Message Popup window appear in the center of the screen, and then after a very short (but still visible) time it moves to the new position.
02-21-2007 08:42 AM
02-21-2007 09:18 AM
Steve,
SetSystemPopupsAttribute() does not seem to have such attributes.
My suggestion is for simple popups.
For complex ones like file/directory selection I think you may still consider using the method suggested by Wim.