LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Make a modal window created in other process

Hello,

In my application , there are 2 individual process . When loading a panel created in another process ,I want to make the popup window on the top level so
as to prevent the user to operate the other window ,How to realize this ? Thanks.

David
0 Kudos
Message 1 of 3
(3,271 Views)
By a process, do you mean a thread?
The modality of a CVI window is limited to the thread in which it was created. That includes predefined popups like MessagePopup() and popup panels created by InstallPopup(). You can structure your threads so one thread handles all user interface functions and other threads do data acquisition or analysis, etc. See the CVI help article titled "Different Approaches to Multithreaded User Interface Programming". (From any CVI window, goto Help >> Contents >> Search, then enter MODAL in the box titled Type in the word(s) to search for, then select the article title above).
Another option is to use the Windows SDK MessageBox function and specify the type as System Modal.
Add ...\CVI\sdk\lib\user32.lib to your project.
#include
.h> in your C file.
Call MessageBox like this.
int nMbReturn;
nMbReturn = MessageBox(NULL,
"Modal style is MB_APPLMODAL.\nThis window is on top the parent window in argument 1.",
"MB_APPLMODAL", MB_APPLMODAL);
nMbReturn = MessageBox(NULL,
"Modal style is MB_TASKMODAL.\nThis window is on top of top-level windows in this application.",
"MB_TASKMODAL", MB_TASKMODAL);
nMbReturn = MessageBox(NULL,
"Modal style is MB_SYSTEMMODAL.\nThis window is on top of all applications.",
"MB_SYSTEMMODAL", MB_SYSTEMMODAL);
0 Kudos
Message 2 of 3
(3,271 Views)
Hi AI_S,
Yes , what I said is "process" not "thread" . So when using CreateProcess() to popup a predefined window which created in another process ,due to the popup window's owner does not pertain to the current process, at this time , I can not make the user focus his work on the popup ,because he can switch to other window by click it .

David
0 Kudos
Message 3 of 3
(3,271 Views)