I want to run an .exe file in hidden mode using vc++ in VS2010.
I have tried this code
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
Process^ p = Process::Start("Ai.exe");
IntPtr calculatorWindowHandle = p->MainWindowHandle;
void *calculatorWindowHandle1 = calculatorWindowHandle.ToPointer();
HWND pHandle = reinterpret_cast<HWND>(calculatorWindowHandle1);
ShowWindow(pHandle, SW_HIDE);
}
But it is opening the EXE but not in hidden mode.
Can anybody please tell me how it can be done.
Thanks in Advance
Yes I found the solution.
I just require to use
After
because starting a process takes some milliseconds.