c++调用exe

#include 
#include 
#include 
#include 

int main(void)
{
    HINSTANCE hNewExe = ShellExecuteA(NULL, NULL, "C:/Program Files (x86)/Tencent/WeChat/WeChat.exe", NULL, NULL, SW_SHOW);
    if ((DWORD)hNewExe <= 32)
    {
        printf("return value:%d\n", (DWORD)hNewExe);
    }
    else
    {
        printf("successed!\n");
    }
    
    return 0;

}

你可能感兴趣的:(c++调用exe)