LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

child windows

i have a problem
i have a program with child windows that used SetParent() WIN API, when the child window has the focus and i switch to another program that has its window maximize,and then i try to return to my program by clicking on the box of the program in the bottom bar
then the box was clicked but my program didn't appear
i attach a simple program that i made.
i work on CVI 5.5
OS = win2000
can you help me ?

thanks in advance
hanan
0 Kudos
Message 1 of 4
(2,862 Views)
Hello

A better way to make a child window is to use LoadPanel in the following manner

if (((*PanelHandle) = LoadPanel (ParentHandle, "test.uir", PanelConst)) < 0)
return -1;

Instead of passing the first parameter of LoadPanel as 0, pass in the panel handle to the parent window. This will load the panel (PanelConst in this case) as a child panel. And then you should not have the problem you mentioned.

Refer to the documentation for LoadPanel for more information, but its better to use the functionality provided by CVI than to use the SDK functions to do the same thing. The different behavior you notive is because initially, CVI was designed to be platform independant, so its UI and other frameworks do not behave the same like normal Win32 fra
meworks. So trying to use Windows SDK function to the CVI panels can cause unexpected results.

I hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 4
(2,862 Views)
i familiar your suggestion but its not help me at all
in first i use it but i notice that if i use CVI child windows there isnt the standart window system menus in the title so i look in this site and found out NI suggestion to use the way i describe in my first question
do you have other suggestions ?
0 Kudos
Message 3 of 4
(2,862 Views)
Hello

Replace winmain() with main(). This changes the way CVI's message loop handles panel messages. Using SDK functions to handle the GUI can cause unexpected behavior like this ,as mentioned previously. But this should fix it

I hope this helps

Bilal
Bilal Durrani
NI
0 Kudos
Message 4 of 4
(2,862 Views)