Display of the built-in program (.exe) in the csf-window
[Dllimport ("user32.dll", entrypoint = "setparent")]
Private Static extern intptr setparent (intptr hwndchild, intptr hwndnewparent );
[Dllimport ("user32.dll", entrypoint = "showwindow")]
Public static extern int showwindow (intptr hwnd, int ncmdshow );
Private void button3_click (Object sender, eventargs E)
{
PROCESS p = new process ();
P. startinfo. filename = "cmd.exe ";
P. startinfo. windowstyle = system. Diagnostics. processwindowstyle. minimized; // This sentence is better.
P. Start ();
System. Threading. thread. Sleep (100); // Add, 100, if the effect is not, continue to increase
Setparent (P. main1_whandle, panel1.handle); // panel1.handle indicates the external displayProgramContainer
Showwindow (P. main1_whandle, 3 );
}
[Dllimport ("user32.dll", entrypoint = "setparent")]
Private Static extern intptr setparent (intptr hwndchild, intptr hwndnewparent );
[Dllimport ("user32.dll", entrypoint = "showwindow")]
Public static extern int showwindow (intptr hwnd, int ncmdshow );
Private void button3_click (Object sender, eventargs E)
{
PROCESS p = new process ();
P. startinfo. filename = "cmd.exe ";
P. startinfo. windowstyle = system. Diagnostics. processwindowstyle. minimized; // This sentence is better.
P. Start ();
System. Threading. thread. Sleep (100); // Add, 100, if the effect is not, continue to increase
Setparent (P. main1_whandle, panel1.handle); // panel1.handle is the container for displaying external programs
Showwindow (P. main1_whandle, 3 );
}