程序写了一点,发现应该先用C++的框架创建窗口,现在在DOS下怎么调用windows的一个窗口用于画点画线
#include "stdafx.h"
#include
#include
#include
#include //用到了time函数
#include
#include
using namespace std;
//声明用来处理消息的函数
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
//窗口类对象
//函数功能:产生一个窗口
//函数功能:产生随机数
int stochastic()
{
int sto=0;//随机数
srand((unsigned)time(NULL)); //用时间做种,每次产生随机数不一样
sto= rand() % 4; //产生0-3的随机数
/*测试随机数生成的代码
int testone = 0;
cout <> testone;
*/
return sto;
}
//函数功能:让用户输入数字完成选择目标机型
int getinair_type(int atype)
{
cout << "请输入数字选择目标类型"<> atype;
while (atype > 4 || atype < 1)
{
cout << "输入有误,重新输入" << endl;
system("cls");
atype=getinair_type(atype);
}
return atype;
}
//函数功能:在随机状态下 完成对机型的赋值
int FUNCaircraft()
{
int aircraft_type = 0;
int stoc = stochastic();
aircraft_type = stoc + 1;
return aircraft_type;
}
//状态机一
int stateone()
{
int choice_model = 0;//choice_model代表用户选择是否完全随机 1是完全随机 2是指定目标类型
int aircraft_typw = 0;//aircraft_typw代表飞行目标类型
cout << "请输入数字代表想定生成方式" << endl << "1.完全随机 2.制定目标类型" << endl;
cin >> choice_model;
if (choice_model == 1)
{
cout << "选择完全随机"<>nextkey;
/*
测试代码 没啥用
int testone = 0;
cin >> testone;
if(testone==1)
*/
state2th(airtp);
while (1);
return 0;
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
可以试试OpenCV或者octave