06 2016 档案
摘要:第一种实现 // 第一种void HelloWorld::spriteToGrey(Sprite* sprite_chess){ Point point = sprite_chess->getPosition(); sprite_chess->setPosition(sprite_chess->getContentSize().width / 2, sprite_chess->get...
阅读全文
摘要:#include #include #include #define nullptr NULL// 去除首尾空格int strRemoveSpace(char* distination, char* source){ if (distination == nullptr || source == nullptr) { return -1; } char* p1...
阅读全文
摘要:框架及测试用例 #include #include #if 0//////////////////////////////////////////////////////////////////////////// 做一个键值对读取的函数,根据key读取value// key = "value"//int getKeybyValue(char* pKeyValude, char* pKey, c...
阅读全文
摘要:1.07 坐标体系一、UI坐标系(屏幕坐标系) 及 openGL坐标系 图示二、UI 坐标系 和 GL 坐标系 量化关系三、转化函数四、单点触摸开启及环境搭建bool T05Coordinate::init( ){ CCLayer::init( ); setTouchEnabled( true ); //打开触摸 setTouchMode( kCCTouchesOneByOne ); //单...
阅读全文
摘要:CCLayerColor 及 CCLayerGradient一、CCLayerColorcode CCLayerColor::initWithColor( ccc4( 255, 0, 0, 100 ) ); //CCLayerColor::initWithColor( ccc4( 255, 0, 0, 100 ), 100, 100 ); //ignoreAnchorPointForPosi...
阅读全文
摘要:1.04 锚点一、锚点影响了什么 1、锚点影响 放置位置 2、锚点影响 缩放 --- 缩放是围绕锚点旋转的 3、锚点影响 旋转 --- 通常情况下,旋转是围绕锚点进行二、忽略锚点 1、忽略锚点 --- 将锚点置成 0,0 2、通常情况下,Scene 是忽略锚点的三、源代码1、头文件#ifndef _T01LayerAnchorPoint_H_ #define _T01...
阅读全文
摘要:1.05 精灵一、精灵图创建的三种理论 5 种实现1、create直接创建 CCSprite::create2、createWithTexture创建 CCSprite::createWithTexture( texture ) //需要 CCTexture2D* 创建 CCTexture2D CCTexture2D* texture = new CCTex...
阅读全文
摘要:1.02 main.cpp研究 // create the application instance AppDelegate app; CCEGLView* eglView = CCEGLView::sharedOpenGLView(); eglView->setViewName("Fei"); eglView->setFrameSize(480, 320); ...
阅读全文
摘要:1.03 游戏架构二、Create 函数所遵循的规则 1、new 2、判断不为空 3、不为空托管三、工厂方法四、CCScene和CCLayer合文件的根源 可以用父类代替继承过来的子类(子类什么事也没干的)来自为知笔记(Wiz)
阅读全文
摘要:1.01 开发环境搭建一、安装步骤 1、安装Python 2、解压 cocos2d二、命令coco2d-x-2.2.6 创建命令G:\cocos2d-x-2.2.6\tools\project-creator>create_project.py -project TianZhan -package com.TianZhan.Game -language cppcocos2d-x-3.9...
阅读全文
摘要:MFC应用程序编程MFC的发展VC5.0 -->VC6.0 -->VS2008 Sp1 --> VS2010含义(存之根本)MFC:微软基础类库 采用类的方式,将Win32 API等进行封装,形成的库属性(存之方式)MFC相关的头文件 afx.h (application framework, X,x比较神秘,比喻强大的意思) afxwin.h (类似于windows.h...
阅读全文
摘要:MFC的控制台程序含义(存之根本)属性(存之方式)1、MFC控制台和Win32控制台差异 1.1 包含 afx 系列的头文件 1.2 CWinApp theApp -- MFC的应用程序类 封装了应用程序的启动过程 1.3 AfxWinInit 将应用程序的信息初始化分类(存之类型)简略使用步骤(存之骨架)详细使用步骤语法(存之血肉)额外引入函数(社...
阅读全文
摘要:#include using namespace std;templateclass Array{public: Array(int s); virtual ~Array(); virtual const T& Entry(int index)const; virtual void Enter(int index, const T& value);protected: ...
阅读全文
摘要:/* 如果让实现一个比大小的函数,而被比大小的数据环境又比较复杂, 如各种换类型,该用何种方案解决? 1、宏定义 2、函数重载 3、函数模板 其中,第一种、绕过了类型检查机制。第二种、需要写诸多函数。 只有第三种较简单*/#include using namespace std;template T1 whoIsMax(T1 numA, T1 numB){...
阅读全文
摘要:正常析构及析构在多继承基类中产生的不足 #include using namespace std;//////////////////////////////////////////////////////////////////////////// 正常析构解决不了父类new子类时析构函数调用的问题// 也就是构造函数被调用了四次,而析构函数却被调用了三次//// 正常析构不能解决父子类同台出...
阅读全文
摘要:多继承产生的问题 #include using namespace std;// 多继承产生的问题:如果一个继承的多继承有同一个父类,// 则父类的构造函数会被调用两次//////////////////////////////////////////////////////////////////////////// 多继承,多基类混乱的问题// 以下代码的结果/* 总类 A 构造函数被...
阅读全文
摘要:C 语言关键字 auto 局部变量(自动储存) break无条件退出程序最内层循环 case switch语句中选择项 char单字节整型数据 const定义不可更改的常量值 continue中断本次循环,并转向下一次循环 default switch语句中的默认选择项 do 用于构成do…..while循环语句 double定义双精度浮点型数据 else构成if…..e...
阅读全文
摘要:unix 第一章 目录及文件操作命令 1.1 ls 语法: ls [-RadCxmlnogrtucpFbqisf1] [目录或文件……] 说明: ls 命令列出指定目录下的文件,缺省目录为当前目录 ./,缺省输出顺序为纵向按字符顺序排列。 -R 递归地列出每个子目录的内容 -a 列出所有文件,包括第一个字符为“.”的隐藏文件 -d 若后面参数是目录,则只列出目录名而不列出目录内容,...
阅读全文
摘要:OSX 的文件系统 OSX 采用的Unix文件系统,所有文件都挂在跟目录 / 下面,所以不在要有Windows 下的盘符概念。 你在桌面上看到的硬盘都挂在 /Volumes 下。 比如接上个叫做 USBHD的移动硬盘,桌面上会显示出一个硬盘图标,它实际在哪里呢? 在终端里执行 ls /Volumes/USBHD, 看看显示出的是不是这个移动硬盘的内容。 根目录位置是 / 核心 Mach_...
阅读全文
摘要:Linux系统信息 arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统部件 - (SMBIOS / DMI) hdparm -i /dev/hda 罗列一个磁盘的架构特性 hdparm -tT /dev/sda 在磁盘上执行测试性读取操作 cat /proc/...
阅读全文
摘要:CMD命令 CMD命令:开始->运行->键入cmd或command(在命令行里可以看到系统版本、文件系统版本) appwiz.cpl:程序和功能 calc:启动计算器 certmgr.msc:证书管理实用程序 charmap:启动字符映射表 chkdsk.exe:Chkdsk磁盘检查(管理员身份运行命令提示符) cleanmgr: 打开磁盘清理工具 cliconfg:SQL SE...
阅读全文
摘要:windows_41_Thread_Semaphore 线程 - 信号 // windows_41_Thread_Semaphore.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "windows.h"/* 效果:前面很快出五个,后面一秒出一个*///1、创建信号量//CreateSemaphore//2、等候信号量//WaitForS...
阅读全文
摘要:windows_42_Thread_WaitableTimer 线程 - 等候线程 // windows_42_Thread_WaitableTimer.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "windows.h"HANDLE g_hTimer = NULL;//等候线程DWORD WINAPI TimerThread( LPVO...
阅读全文
摘要:windows_40_Thread_Mutex 线程 - 互斥 // windows_39_Thread_Mutex.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "windows.h"//互斥排队等候问题,谁先等候谁先执行HANDLE g_hMutex = NULL;DWORD WINAPI ThreadProc1( LPVOID pP...
阅读全文
摘要:windows_39_Thread_Event 线程 - 事件 // windows_39_Thread_Event.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "windows.h"HANDLE g_hEvent = NULL;HANDLE g_hEvent2 = NULL;//发送线程DWORD WINAPI ThreadSend(...
阅读全文
摘要:windows_38_thread_CriticalSection 线程-临界区 // windows_38_thread_CriticalSection.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "windows.h"CRITICAL_SECTION g_cs = { 0 };long g_nValue = 0;void Print...
阅读全文
摘要:windows_37_Thread_InterLock 线程-原子锁 // windows_37_Thread_InterLock.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "windows.h"long g_nValue1 = 0;long g_nValue2 = 0;DWORD WINAPI InterProc1( LPVOID ...
阅读全文
摘要:windows_37_windows_Sync // windows_37_windows_Sync.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include CHAR *g_pszText = NULL; DWORD g_nTlsIndex = NULL; //全局索引号void print( ){ printf( "%s\n", g_pszT...
阅读全文
摘要:windows_35_Thread_Tls 线程局部存储 // windows_35_Thread_Tls.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include int g_AddVar = 0;CHAR *g_pszText1 = NULL;__declspec(thread)CHAR *g_pszText2...
阅读全文
摘要:windows_34_Thread_Base 线程基础 // windows_34_Thread_Base.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include //1、定义线程处理函数//ThreadProcDWORD WINAPI ThreadProc1( LPVOID pParam){ DWORD nValue = (...
阅读全文
摘要:windows_33_Proc_windows_job 进程,windows作业 // windows_33_Proc_windows_job.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include HANDLE Create( LPSTR pszPath ){ //创建一个进程,把句柄返回,交给后续的函数来处理 START...
阅读全文
摘要:windows_32_ProcUse 进程使用 // windows_32_ProcUse.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include void Wait( ){ //创建一个进程 STARTUPINFO si = { 0 }; PROCESS_INFORMATION pi = { 0 }; si.cb = sizeof( si...
阅读全文
摘要:windows_30_ProcInfo // windows_30_ProcInfo.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include void EnvVariable( LPSTR pszVar ){ //二、环境 变量 //1、环境变量的设置 //SetEnvironmentVariable SetEnvironmentVari...
阅读全文
摘要:windows_31_ProcBase 进程基础 // windows_31_ProcBase.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include //另一块进程操作APIvoid ProcModule( ){ printf( "All Modules:\n" ); //当前进程句柄 HANDLE hProc = Ge...
阅读全文
摘要:windows_27_windows_Virtual_Memory 虚拟内存 // windows_27_windows_Virtual_Memory.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include void Status( ){ MEMORYSTATUS status = { 0 }; status.dwLength...
阅读全文
摘要:windows_28_windows_heap 堆 // windows_28_windows_heap.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include void HeapInfo( ){ //默认堆句柄 HANDLE hHeap = GetProcessHeap( ); printf( "Default Heap:...
阅读全文
摘要:windows_26_windows_system 系统信息 // windows_26_windows_system.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include void ShowSys( ){ SYSTEM_INFO info = { 0 }; GetSystemInfo( &info ); printf( "内存页的大小:%...
阅读全文
摘要:windows_25_windows_File_Find 文件查找 // windows_25_windows_File_Find.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include void FindAdv1( LPSTR pszPath,LPSTR pszType ){ //构造一个查找字符串 CHAR szFind[MAX_PATH]...
阅读全文
摘要:windows_24_windows_file 文件系统 - 文件 // windows_24_windows_file.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include void Create( ){ //创建文件 HANDLE hFile = CreateFile( "D:\\MyTest.txt", GENERIC_READ...
阅读全文
摘要:windows_22_windows_Directory 文件系统 - 目录 // windows_22_windows_Directory.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include void UseDirectory( ){ //创建目录 CreateDirectory( "D:\\Test", NULL ); //删除目录 ...
阅读全文
摘要:windows_22_windows_file 文件系统-卷// windows_22_windows_file.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include void RenameDisk( ){ SetVolumeLabel( "C:\\", "SYSTEM" );}void ShowSpace( LPSTR pszDrive ){ D...
阅读全文
摘要:21.7 windows_21_Library_Variable_DLL_USE 动态库补充7 // windows_21_Library_Variable_DLL_USE.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"//第三步,导入lib文件#pragma comment(lib,"../debug/windows_21_Library_Variab...
阅读全文
摘要:// windows_21_Library_use_DLL_Invoke.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include //2.2.2 定义函数指针,在开发工程中,一般都是大写typedef int( *DLL_ADD )( int nAdd1, int nAdd2 );typedef int( *DLL_SUB )( int nSub1, i...
阅读全文
摘要:windows_21_Library_Variable_DLL&&CPP&&DEF 动态库补充6 CPP//第二步,增加导出声明__declspec( dllexport )/*增加导出声明*///第一步,定义全局变量int g_nValue1 = 100; // global Variable//第一步,定义DEF导出变量int g_nValue2 = 200;DEFLIBRARY E...
阅读全文
摘要:windows_21_Library_use_DLL 动态库补充4 #include using namespace std;//第2.1.1步 导入 lib#pragma comment(lib,"../debug/windows_21_Library_DLL_test.lib")//第2.1.2步 定义函数原型int Dll_Add( int nAdd1, int nAdd2 );ex...
阅读全文
摘要:windows_21_Library_DLL_test&&CPP&&DEF 动态库补充3 //1.1 创建DLL的项目//1.2 增加动态库函数__declspec( dllexport ) //C++导出方式int Dll_Add( int nAdd1, int nAdd2 ){ return nAdd1 + nAdd2;}//导出函数关键字__declspec( dllexport ...
阅读全文
摘要:windows_21_Library_Class_DLL_USE 动态库补充2 // windows_21_Library_Class_DLL_USE.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"//导入DLL文件#pragma comment(lib,"../bin/windows_21_Library_Class_DLL.lib")//需要声明一个类...
阅读全文
摘要:windows_21_Library_Class_DLL 动态库补充1 #include "windows_21_Library_Class_DLL.h"int CMath::Add( int nAdd1, int nAdd2 ){ return nAdd1 + nAdd2;}int CMath::Sub( int nSub1, int nSub2 ){ return nSub1 - n...
阅读全文
摘要:19windows_19_OwnerDraw自制按钮DIYBUTTON#include #include CHAR szText[256] = { 0 };#define PrintLog(x) WriteConsole(g_hStdout, x, strlen(x), NULL, NULL)HINSTANCE g_hInst = NULL; //窗口句柄HANDLE g_hStdout = NU...
阅读全文
摘要:21window_21_Dynamic_library动态库 DLL创建//1.1 创建DLL的项目//1.2 增加动态库函数__declspec( dllexport ) //C++导出方式int Dll_Add( int nAdd1, int nAdd2 ){ return nAdd1 + nAdd2;} //导出函数关键字__declspec( dllexport )extern "...
阅读全文
摘要:17windows_17_listbox列表框#include #include #include "resource.h"CHAR szText[256] = { 0 };#define PrintLog(x) WriteConsole(g_hStdout, x, strlen(x), NULL, NULL)HINSTANCE g_hInst = NULL; //窗口句柄HANDLE g_hSt...
阅读全文
摘要:15windows_15_Edit编辑框#include #include #include "resource.h"CHAR szText[256] = { 0 };#define PrintLog(x) WriteConsole(g_hStdout, x, strlen(x), NULL, NULL)HINSTANCE g_hInst = NULL; //窗口句柄HANDLE g_hStdou...
阅读全文
摘要:14win32_14_button按钮#include #include CHAR szText[256] = { 0 };#define PrintLog(x) WriteConsole(g_hStdout, x, strlen(x), NULL, NULL)HINSTANCE g_hInst = NULL; //窗口句柄HANDLE g_hStdout = NULL; //控制台句柄//OnC...
阅读全文
摘要:13windows_static静态标签#include #include #include "resource.h"/***dat : 2015-05-22 10:59:53*file : F:\long\win32 study\Win32_Project\13Windows_static\13windows_static.cpp*file base: 13windows_static*say...
阅读全文
摘要:12Windows_Modeless_Dialog对话框#include #include #include "resource.h"CHAR szText[256] = { 0 };#define PrintLog(x) WriteConsole(g_hStdout, x, strlen(x), NULL, NULL)HINSTANCE g_hInst = NULL; //窗口句柄HANDLE ...
阅读全文
摘要:#include #include #include "resource.h"CHAR szText[256] = { 0 };#define PrintLog(x) WriteConsole(g_hStdout, x, strlen(x), NULL, NULL)HINSTANCE g_hInst = NULL; //窗口句柄HANDLE g_hStdout = NULL; //控制台句柄//D...
阅读全文
摘要:#include #include CHAR szText[256] = { 0 };#define PrintLog(x) WriteConsole(g_hStdout, x, strlen(x), NULL, NULL)HINSTANCE g_hInst = NULL; //窗口句柄HANDLE g_hStdout = NULL; //控制台句柄//OnPaintvoid OnPaint(HW...
阅读全文
摘要:#include #include CHAR szText[256] = { 0 };#define PrintLog(x) WriteConsole(g_hStdout, x, strlen(x), NULL, NULL)HINSTANCE g_hInst = NULL; //窗口句柄HANDLE g_hStdout = NULL; //控制台句柄//OnPaintvoid OnPaint(HW...
阅读全文
摘要:#include #include #include "resource1.h"//宏定义输出函数#define PrintLog(x) WriteConsole(g_hStdout, x, strlen(x), NULL, NULL);HINSTANCE g_hInst;HANDLE g_hStdout = NULL;CHAR szText[256] = { 0 };//DrawBmpvoid ...
阅读全文
摘要:// 7Windows_paint.cpp : 定义应用程序的入口点。//#include "stdafx.h"#include "7Windows_paint.h"#include "resource.h"#include HINSTANCE g_hInst = NULL;HANDLE g_hStdout = NULL; //控制台int g_DrawType = 0;COLORREF g_nP...
阅读全文
摘要:// 6WinRes.cpp : 定义应用程序的入口点。//#include "stdafx.h"#include "6WinRes.h"#include "Resource.h"#include #define PrintLog(x) WriteConsole(g_hStdout, x, strlen(x), NULL, NULL)HINSTANCE g_hInst = NULL; //窗口句柄...
阅读全文
摘要:// 3Windows_menu.cpp : 定义应用程序的入口点。//#include "stdafx.h"#include "3Windows_menu.h"#include HINSTANCE g_hInst;HANDLE g_hStdout = NULL;BOOL g_bCheckCut = FALSE; //是看Cut项有没有被选择上//宏定义输入函数#define PrintLog(x...
阅读全文
摘要:// 4Windows_System_menu.cpp : 定义应用程序的入口点。//#include "stdafx.h"#include "4Windows_System_menu.h"#include #define PrintLog(x) WriteConsole(g_hStdout, x, strlen(x), NULL, NULL)HINSTANCE g_hInst = NULL; /...
阅读全文
摘要:5Windows_system_right_menu右键菜单 // 5Windows_system_right_menu右键菜单.cpp : 定义应用程序的入口点。//#include "stdafx.h"#include "5Windows_system_right_menu右键菜单.h"// 4Windows_System_menu.cpp : 定义应用程序的入口点。//#include...
阅读全文
摘要:// 2Window_Timer.cpp : 定义应用程序的入口点。//#include "stdafx.h"#include "2Window_Timer.h"#include HINSTANCE g_hInst;HANDLE g_hStdout = NULL;//宏定义输入函数#define PrintLog(x) WriteConsole(g_hStdout, x, strlen(x), N...
阅读全文
摘要:// WIN_PAINT_MESSAGE.cpp : 定义应用程序的入口点。//#include "stdafx.h"#include "windows_Mouse.h"#include HINSTANCE g_hInst = NULL;HANDLE g_hStdout = NULL;CHAR szText[256] = { 0 };//第二步,窗口处理函数void OnPaint(HWND hW...
阅读全文
摘要:GetMessage GetMessage函数从调用线程的消息队列中检索消息并将其放入指定的结构。这个函数可以检索信息关联到一个指定的窗口和线程信息通过PostThreadMessage功能。函数检索消息,躺在指定值范围的消息。GetMessage不检索消息属于其他线程或windows应用程序。保龄球GetMessage(LPMSG LPMSG,/ /地址信息的结构HWND HWND,/ /处理的...
阅读全文
摘要:做完棋盘之后却无法完成左键点击棋盘,而切换棋盘BMP图片 解决办法:目前推测可能是因为HDC的原因造成无法切换,HDC只能在WM_PAINT消息中使用,其它消息中使用都不会被执行。有了原因就想出对策,把需要HDC的函数全部放在WM_PAINT消息中去处理,这样就可以共用WM_PAINT中的HDC了代码:HINSTANCE g_hInst = NULL;HANDLE g_hStdout = N...
阅读全文
摘要:多线程和定时器之间的关系 总结: 1、并行和串行说 多线程更像并行 定时器实际是串行 2、缺点 多线程因为竞抢资源,会造线程锁死 定时器会造成UI堵塞,因为并非真正的多线程 3、多线程是“同时”执行的多任务 定时器更像是本线程插入的任务1 软件定时器很多同学在工程中喜欢使用软件定时器,因为其使用简单,仅需设置一...
阅读全文
摘要://语法习惯 unsigned int nCmdID; DWORD dwCmdID; WORD wCmdId; //可以直接用 nCmdID 定义,代表数字 来自为知笔记(Wiz)
阅读全文
摘要:输入盘符或者每串字符以0分隔,最后以00结尾 CHAR * szText = "A:\0C:\0D:\00"; CHAR *pszTmp = szText; while (0!=pszTmp[0]) { //用户代码 pszTmp = strlen( pszTmp ) + 1 + pszTmp; }来自为知笔记(Wiz)
阅读全文
摘要:练习三碰到的问题 一、窗口创建出来却显示不出来 出错原因: CW_USEDEFAULT 写成了 CW_DEFAULT 造成二、定时器 OnTimer 函数触发不了 出错原因: SetTimer(hWnd, 9001, 2 * 1000, TimerProc); 这个函数用回调函数了, 改成 SetTimer(hWnd, 9001, 2 * 1000, NULL);...
阅读全文
摘要://OnPaintvoid OnPaint(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam){ PAINTSTRUCT ps = { 0 }; HDC hDC = BeginPaint(hWnd, &ps); int marc = 0; //控制棋盘所在位置 for (int i = 0; i < 10; i++) //画九格横线 { Mo...
阅读全文
摘要://让Edit铺满整个客户区void OnSize(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam){ int nWidth = LOWORD(lParam); int nHeight = HIWORD(lParam); if (g_hEdit != NULL) { MoveWindow(g_hEdit, 0, 0, nWidth, nHei...
阅读全文
摘要:/*读取文件到字符串pszBuff */ //打开文件,读取数据 FILE *pFile = NULL; fopen_s(&pFile, "c:\\1.txt", "r"); fseek(pFile, 0, SEEK_END);//把fseek移动到文件结尾 long nFileLen = ftell(pFile); //获得文件结尾的长度 fseek(pFile, 0, SEEK_SET); /...
阅读全文
摘要:/*保存pszBuff字符串到文件*/ FILE *pFile = NULL; fopen_s(&pFile, "c:\\1.txt", "w+"); //打开文件 fwrite(pszBuff, nTextLen, 1, pFile); //把文件写进文件 fclose(pFile);来自为知笔记(Wiz)
阅读全文
摘要:Win32简单模板// 2Window_Timer.cpp : 定义应用程序的入口点。//#include #include #include "resource1.h"//宏定义输出函数#define PrintLog(x) WriteConsole(g_hStdout, x, strlen(x), NULL, NULL);HINSTANCE g_hInst;HANDLE g_hStdout =...
阅读全文
摘要://显示菜单POINT point = { 0 }; //转换时需要POINT数据结构point.x = LOWORD(lParam); //客户区坐标point.y = HIWORD(lParam);//转换成屏幕坐标ClientToScreen(hWnd, &point);//point.x//point.y 这两个坐标可以直接使用 来自为知笔记(Wiz)
阅读全文
摘要:bool flag if (flag) { xPost += 5; } if (!flag) { xPost -= 5; } if (xPost == 1000 || xPost == -5) //小技巧,这里的一定要是上面位移的倍数,否则会出现判断不正常的情况 { flag = !flag; } 来自为知笔记(Wiz)
阅读全文

浙公网安备 33010602011771号