public string LancerFormControl(string stThisPathFC) { string stReturnError = "Pas d'erreur"; Process ProcessFC = new Process(); int iProcID = 0; int iProcHandle = 0; try { ProcessFC.StartInfo = new ProcessStartInfo("calc.exe"); ProcessFC.Start(); iProcHandle = ProcessFC.Handle.ToInt32(); iProcID = ProcessFC.Id; SendMessage(iProcHandle, 0x111, 304, 0); } catch (Exception exception) { stReturnError = exception.Message; } return stReturnError; }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question[DllImport("user32.dll", EntryPoint = "SendMessageA")] static extern int SendMessage(int hWnd, int wMsg, int wParam, int lParam);
public string LancerFormControl(string stThisPathFC) { string stReturnError = "Pas d'erreur"; Process ProcessFC = new Process(); int iProcID = 0; int iProcHandle = 0; int iUseLess = 0; try { ProcessFC.StartInfo = new ProcessStartInfo("calc.exe"); ProcessFC.Start(); iProcHandle = ProcessFC.MainWindowHandle.ToInt32(); iProcID = ProcessFC.Id; SendMessage(iProcHandle, 0x111, 304, iUseLess); } catch (Exception exception) { stReturnError = exception.Message; } return stReturnError; }
do { iProcHandle = ProcessFC.MainWindowHandle.ToInt32(); iProcID = ProcessFC.Id; } while (iProcHandle != 0);
private void button1_Click(object sender, EventArgs e) { Process p = Process.Start("calc.exe"); p.WaitForInputIdle(); IntPtr hWnd = p.MainWindowHandle; SendMessage(hWnd, 0x111, 304, 0); // SendMessage(hWnd, 0x111, 305, 0); Mode standard }