调用其他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)
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)