#include <windows.h>
#include <shellapi.h>
int main(int argc, char* argv[])
{
ShellExecute(NULL,"open","C:/Windows/System32/calc.exe",NULL,"C:/Windows/System32/",SW_HIDE);
Sleep(1000);
ShowWindow(FindWindow(NULL, "Calculator"), SW_HIDE);
return 0;
}
ok well if i dont have the sleep(1000); there it doesnt hide the window.
i want it to load the window hidden, not hide it once its loaded.
Does anyone have any suggestions.
Note: I have also tried CreateProcess() with the startup params.