上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 37 下一页
摘要: DWORD WINAPI ThreadFunction( LPVOID lpParam ) { (void)lpParam; //make happy compiler for unused variable while (TRUE) //Once created the thread runs a 阅读全文
posted @ 2020-03-12 11:35 strive-sun 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 主要是依靠NtQueryObject函数,其中需要传入ObjectBasicInformation参数 PUBLIC_OBJECT_BASIC_INFORMATION结构包含可用于对象的全部信息的子集。 typedef struct _PUBLIC_OBJECT_BASIC_INFORMATION 阅读全文
posted @ 2020-03-04 11:06 strive-sun 阅读(1026) 评论(0) 推荐(0) 编辑
摘要: 注意: AssignProcessToJobObject仅适用于win32 desktop app, 比如notepad是适用的,calculator是不适用的 下面的demo是将notepad的句柄分配给作业,然后由TerminateJobObject统一kill #define _CRT_SEC 阅读全文
posted @ 2020-03-04 10:48 strive-sun 阅读(510) 评论(0) 推荐(0) 编辑
摘要: 一般情况下 char* string = "abc"; 编译后会出现标题中的错误。 我们只需要在字符串前加上const_cast<char*>即可,这个作用是丢弃变量的const声明,但不能改变变量所指向的对象的const属性。即:const_cast用于原本非const的对象;如果用于原本cons 阅读全文
posted @ 2020-02-28 16:34 strive-sun 阅读(3707) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <Windows.h> #include <d2d1.h> #include <wincodec.h> #pragma comment(lib, "d2d1.lib 阅读全文
posted @ 2020-02-18 23:13 strive-sun 阅读(585) 评论(0) 推荐(0) 编辑
摘要: case WM_CONTEXTMENU: { m_hMenu = CreatePopupMenu(); g_BitMap = (HBITMAP)LoadImage(NULL, L"1.bmp", IMAGE_BITMAP, 16, 16, LR_LOADFROMFILE | LR_CREATEDIB 阅读全文
posted @ 2020-02-14 16:52 strive-sun 阅读(292) 评论(0) 推荐(0) 编辑
摘要: HWND static_ = CreateWindow(L"STATIC", NULL, WS_CHILD | WS_VISIBLE | SS_LEFT, 100, 100, 100, 16, hWnd, NULL, hInst, NULL); LOGFONT font; font.lfHeight 阅读全文
posted @ 2020-01-21 14:44 strive-sun 阅读(860) 评论(0) 推荐(0) 编辑
摘要: // Edit_1.cpp : Defines the entry point for the application. // #include "stdafx.h" #include "Edit_1.h" #include <windowsx.h> #include <RichEdit.h> #i 阅读全文
posted @ 2020-01-17 17:05 strive-sun 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 要设置dpi 意识,一般是使用SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE)来设置 具体可参考:Setting the default DPI awareness for a process 不过官方更建议使用清单文件来设置dpi意识,我介 阅读全文
posted @ 2020-01-17 17:01 strive-sun 阅读(1753) 评论(0) 推荐(0) 编辑
摘要: 在创建GDI对象时,比如创建笔,画刷等对象时,在调用完之后忘记删除对象了,会造成内存泄漏 我们可以通过任务管理器来快速的查看 启动任务管理器(右键单击Windows任务栏以选择任务管理器) 在Windows 10中,转到“ 详细信息”选项卡。对于Windows 7,请转到“ 进程”选项卡。 右键单击 阅读全文
posted @ 2020-01-15 11:15 strive-sun 阅读(232) 评论(0) 推荐(0) 编辑
上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 37 下一页