C++ Gui & Execute

Okay, listen up, cause I need a lot of help here:

I want to make a C++ Gui that executes a program (In this case Windows defender)

I have the Gui code:

1
2
3
4
5
6
7
8
#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
    LPSTR lpCmdLine, int nCmdShow)
{
    MessageBox(NULL, "Your Computer Has Been Infected!", "Warning", MB_OK);
    return 0;
}


I want it to run windows defender after it pops up. Please help!
Also, could it wait 3 seconds before running it, and then do a scan?

If you are wondering, it's a joke for my dad.
Last edited on
Use CreateProcess() to run C:\Program Files\Windows Defender\MSASCui.exe.
It comes up with an error when I do that. Will it still work without MS-DOS, because I'm making a gui.
Just so you know, I am a noob to some functions in C++, so don't scream at me if I don't understand something that is second nature to you.
It is not enough to say it comes up with an error. You MUST show the error in order to receive further help. Also please show your updated code.
Topic archived. No new replies allowed.