怎样用C语言调用程序API

怎样用C语言调用程序API,第1张

#include <windowsh>这样就可以条用api文件了;如果只是关机的话下面的代码你可以试试

#include<stdioh>

#include<dosh>

#include<stdlibh>

void main()

{

char shut[8];

char b[81];

printf("Hello, Welcome to the TC automatic shutdown procedures\n");

printf(" Watermelon production\n");

printf("Please enter your desired automatic shutdown of time:");

scanf("%s",shut);

sprintf(b,"at %s shutdown -s",shut);

system(b);

}

C语言中打开一个应用程序可以调用system(),也可以调用 *** 作系统的API函数,比如Windows系统可以调用CreateProcess()、ShellExecuteEx()等函数来打开一个应用程序。

1

2

3

4

5

6

7

8

#include <stdioh>

#include <stdlibh>

int main()

{

printf("在windows上打开记事本程序\n");

system("notepadexe");

return 0;

}

以上就是关于怎样用C语言调用程序API全部的内容,包括:怎样用C语言调用程序API、怎么用C语言打开一个应用程序、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zz/9503673.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-29
下一篇2023-04-29

发表评论

登录后才能评论

评论列表(0条)

    保存