07-17-2009 11:17 AM
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
07-20-2009 03:08 AM
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
07-20-2009 08:15 AM
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
11-09-2009 04:17 PM
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.