C语言中怎么使用API函数 求使用方法

C语言中怎么使用API函数 求使用方法,第1张

api函数要用C++.

调用其他exe程序,c语言中用

char

my_cmd[80]="my_prog_name.exe"

system(my_cmd)

就可以了。

查询运行窗口

....

这些都是

设及

视窗

的函数,建窗口,显示窗口,关闭窗口,查询等,都有函数。你只要

包括了相关的头文件,调用相应函数,给入实际参数,就可以了。不难,只是繁杂,时不时要查帮助文件,

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

#include<stdio.h>

#include<dos.h>

#include<stdlib.h>

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)

}


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

原文地址: https://outofmemory.cn/bake/11243388.html

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

发表评论

登录后才能评论

评论列表(0条)

保存