在Windows下,ShellExecute函數是在shellapi.h頭文件中聲明的。因此,在使用ShellExecute函數之前,您需要包含shellapi.h頭文件。
示例代碼:#include <windows.h>#include <shellapi.h>int main(){ // 使用ShellExecute函數 return 0;}
#include <windows.h>
#include <shellapi.h>
int main()
{
// 使用ShellExecute函數
return 0;
}
請注意,windows.h頭文件也需要被包含,因為它包含了一些必需的定義和聲明,以及其他與Windows API相關的內容。