调试 NSIS 插件
C++
1.dll 入口 写个 messagebox,下一行 设置个断点
2.编译debug 版本
3.复制dll 到 nsis 的plugin 目录
4.编译nsis 得到 exe
5.运行exe 弹出第一步的messagebox
6.vs 附加进程 到 此exe 进程
7.关闭messagebox ,即可进入调试
1234567
1.dll 入口 写个 messagebox,下一行 设置个断... [阅读全文]
c++ 清除ssl 状态
admin | win32 | 2015-05-09
C++
#include "stdafx.h"
#include "windows.h"
#include "tchar.h"
typedef BOOL (__stdcall *SSL_EMPTY_CACHE_FN_A) (LPSTR, DWORD);
typedef BOOL (__stdcall *SSL_EMPTY_CACHE_FN_W) (LPWSTR, DWORD);
typedef BOOL (__stdcall *INCREMENTURLCACHEHEADERDATA_FN) (DWORD, LPDWORD);
VOID ClearSslState(VOID)
{
... [阅读全文]
win32 C++ ScreenShot and save
admin | win32 | 2015-04-15
C++
BOOL ScreenShot(_In_ LPCWSTR lpFileName)
{
static HDC hSrcDC;
hSrcDC = GetDC(GetDesktopWindow());
int nx = GetSystemMetrics(SM_XVIRTUALSCREEN);
int ny = GetSystemMetrics(SM_YVIRTUALSCREEN);
int nWidth = GetSystemMetrics(SM_CXVIRTUALSCREEN);
int nHeight = GetSystemMetrics(SM_CYVIRTUAL... [阅读全文]
win32 设置本地ICON
admin | win32 | 2015-03-16
C++
//设置本地icon 图像为程序ICON
HICON t = (HICON) LoadImage( NULL,g_IconName,IMAGE_ICON,0,0,LR_LOADFROMFILE|LR_DEFAULTSIZE|LR_SHARED);
SendMessage(g_pFrame->GetHWND(), WM_SETICON, ICON_SMALL, (LPARAM)t);
SendMessage(g_pFrame->GetHWND(), WM_SETICON, ICON_BIG, (LPARAM)t);
... [阅读全文]
Coding for High-DPI Displays in Windows
admin | win32 | 2015-02-03
Deliver crisp text and images on all Windows monitors, regardless of settings.
In the first article in this two-part series on coding for high-DPI displays on the Windows desktop, I explained high-DPI configurations in Windows 8.1 and their effect on the three different kinds of applications: DPI-unaware, system-DPI aware, a... [阅读全文]
查询CPU的个数
admin | win32 | 2015-01-29
C++
void ShowProcessors()
{
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION pbuffer = NULL;
DWORD dwSize = 0;
DWORD procCoreCount;
BOOL bResult = GetLogicalProcessorInformation(pbuffer, &dwSize);
if(GetLastError() != ERROR_INSUFFICIENT_BUFFER)
{
_tprintf(TEXT("Impos... [阅读全文]
禁用USB win32
admin | win32 | 2015-01-29
C++
#include "stdafx.h"
#include <iostream>
#include <initguid.h>
#include <windows.h>
#include <setupapi.h>
#include <usbiodef.h>
#include <Usbioctl.h>
#include <cfgmgr32.h>
#include <cstring>
#include <stdlib.h>
#include <malloc.h>... [阅读全文]
c++获取电驴首页推荐 示例代码
C++
/*******************************************************************************
* @file
* @author def< qq group: 324164944 >
* @blog http://www.cnblogs.com/itdef/
* @brief
/*******************************************************************************/
... [阅读全文]
Win7程序自删除(进程优先级)的一种实现
admin | win32 | 2015-01-29
C++
/**********************************************************************************
* 程序描述: 本程序为Windows7环境下,程序自删除的一种实现方式
* 运行环境: Win7
* 开发环境: VS2012
* 调用接口函数库类型: Windows API,标准C库函数
* 程序原理: Windows加载程序后,进程无法删除进程映像,利用进程... [阅读全文]
C++的MIME库 mimetic
admin | win32 | 2014-12-13
mimetic 是一个 C++ 的类库,用来处理 MIME 数据。
示例代码:
C++
#include<iostream>
#include<mimetic/mimetic.h>
usingnamespace std;
usingnamespace mimetic;
intmain()
{
MimeEntity me;
me.header().from("me <me@domain.com>");
me.header().to("you <you@domain.com>");
me... [阅读全文]