LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I can not set some window programs as child of my CVI panel

Hi,

 

I can set some program window as child of my CVI panel, (ex: "notepad.exe", "calc.exe" ...), but if I try with "vlc.exe" or some others, nothing happen, the vlc window do not go into my CVI panel.

What I must do to put mu vlc.exe windows into my CVI parent panel ? 

 

 

 /*WORKING WITH*/
// sprintf(filename , "C:\\WINDOWS\\SYSTEM32\\notepad.exe");
// sprintf(filename , "C:\\WINDOWS\\SYSTEM32\\calc.exe"); 
// sprintf(filename , "C:\\Program Files\\NSIS\\nsis.exe");  
 
 /*DO NOT WORKING WITH*/
 sprintf(filename , "C:\\Program Files\\VideoLAN\\VLC\\vlc.exe");

 

 if (CreateProcess(NULL, filename, NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &sInfo, &gpInfo))

 

 // using the Process ID (from the pInfo)
 EnumWindows( EnumWindowsProcCB,0);
 
 if (gfound == 1) OpenIcon(ghWindow);
 
....
 
 phParent = LoadPanel(0,"ParentPanel.uir",PANEL);
 GetPanelAttribute(phParent,ATTR_SYSTEM_WINDOW_HANDLE,&ghCVIPanel); 
 SetParent((HWND) ghWindow,(HWND) ghCVIPanel); 
 DisplayPanel(phParent);

 

Many thanks

0 Kudos
Message 1 of 4
(3,663 Views)

Because of all the extra configuration files/dlls that vlc loads, it might be that it needs its "current directory" setting correctly. Try changing your CreateProcess() call to pass the vlc directory for it to work in, instead of the CVI project one. (The 8'th parameter.)

 

JR

0 Kudos
Message 2 of 4
(3,641 Views)

Hi,

 

I try to set the VLC directory  in the 8th parameters of CreateProcess as you tell me, but the panel still appear as  child of my CVI panel.

 

Ps: I've attached my .prj for more details.

 

 

/*WORKING WITH*/
// sprintf(filename , "C:\\WINDOWS\\SYSTEM32\\notepad.exe");
// sprintf(filename , "C:\\WINDOWS\\SYSTEM32\\calc.exe"); 
// sprintf(filename , "C:\\Program Files\\NSIS\\nsis.exe");  

 

/*DO NOT WORKING WITH*/
 sprintf(filename , "C:\\Program Files\\VideoLAN\\VLC\\vlc.exe");

 sprintf(lpCurrentDirectory , "C:\\Program Files\\VideoLAN\\VLC");

 

 if (CreateProcess(NULL, filename, NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE, NULL, lpCurrentDirectory , &sInfo, &gpInfo));

 

// using the Process ID (from the pInfo)
 EnumWindows( EnumWindowsProcCB,0);
 
 if (gfound == 1) OpenIcon(ghWindow);
 
....
 
 phParent = LoadPanel(0,"ParentPanel.uir",PANEL);
 GetPanelAttribute(phParent,ATTR_SYSTEM_WINDOW_HANDLE,&ghCVIPanel); 
 SetParent((HWND) ghWindow,(HWND) ghCVIPanel); 
 DisplayPanel(phParent);

 

Thanks,

John

0 Kudos
Message 3 of 4
(3,629 Views)

I'm facing the same issue, too.  How to embed an external

application program as a child panel in my CVI UIR?  Only

windows "calc.exe" and "notepad.exe" can be done so far

as stated in the previous post.

 

Just like to know if anyone has a solution for this problem

without using ActiveX control.  Thanks in advance.

0 Kudos
Message 4 of 4
(3,402 Views)