预编译.h
这里面包含一些常用的头文件
#pragma once
#include<SDKDDKVer.h>
#include<stdio.h>
#include<tchar.h>
#include<bitset>
#include<conio.h>
#include"atlstr.h"
#include<atlimage.h>
#include<iostream>
#include<winSock2.h>
#include"winhttp.h"
#define INITGUID
#include<Guiddef.h>
#include<GPEdit.h>
#include<Shlwapi.h>
#pragma warning (disable:4996)
#include<ctime>
#include<tlhelp32.h>
#include<TlHelp32.h>
#include<Psapi.h>
#include<io.h>
#include<iphlpapi.h>
#include<fstream>
#include<string>
#include<Process.h>
#define WIN32_LEAN_AND_MEAN
#include<Windows.h>
#include<sys/timeb.h>
#include<Shlwapi.h>
#include<ShlObj.h>
#pragma comment(lib,"Iphlpapi.lib")
#pragma comment(lib,"winhttp.lib")
#pragma comment(lib,"ws2_32.lib")
#pragma comment(lib,"psapi.lib")
#pragma comment(lib,"shlwapi.lib")
#define mythons(A)(((WORD)(A)&OXFF00)>>8)|(((WORD))(A)&0X00FF<<8)
#define SIO_RCVALL_WSAIOW(IOC_VENDOR,l)
using namespace std;
VOID 随机种子()
{
srand(time(0));
}
FLOAT 随机数(FLOAT 底数, WORD 增加数, WORD 除数)
{
float 浮点数 = rand() % (增加数 + 1) + 底数;
浮点数 = 浮点数 / 除数;
return 浮点数;
}
VOID ST()
{
system("pause");
}
VOID st()
{
system("pause>nul");
}
预编译.cpp
mian.cpp
先写一个打印窗口
#include<iostream>
#include<windows.h>
#include<tchar.h>
#include<stdio.h>
#pragma warning(disable:4996)
//exe应用程序
VOID PrintUI(CONST CHAR* ExeName, CONST CHAR* UIName, CONST CHAR* color, SHORT X坐标, SHORT y坐标, WORD UIwide, WORD UIHigh)
{
AllocConsole();
freopen("conin$", "r+t", stdin);
freopen("conout$", "w+t", stdout);
SetConsoleTitleA(UIName);
system(color);
}
int _tmain(int argc, _TCHAR* argv[])
{
PrintUI("新程序.exe", "MYWINDOW", "color 0A", 500, 500, 800, 800);
printf("你好,hello\r\n");
Sleep(200000);
}
不过这里奇怪为什么printf没有打印
结果一看,打错了
后面持续更新,先写这么多