- 博客(218)
- 资源 (6)
- 论坛 (1)
- 收藏
- 关注
原创 windows刷新桌面图标缓存API
delphi初学者SHChangeNotify函数WINSHELLAPI void WINAPI SHChangeNotify( LONG wEventID, //指定事件类型 UINT uFlags, //确定dwItem1和dwItem2作的标志 LPCVOID dwItem1, LPCVOID dwItem2);1.wEventId的取值如下:SHCNE_ASSOCCHANGED:修改文件关联SHCNE_ATTRIBUTES:改变文件属性SHCNE_CREATE:创...
2020-09-16 09:51:37
151
原创 windows默认调试器注册表位置
Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug]"UserDebuggerHotKey"=dword:00000000"Debugger"="\"C:\\Windows\\system32\\vsjitdebugger.exe\" -p %ld -e %ld"[HKEY_LOCAL_MACHINE\SOFTWARE\Micros
2020-09-16 09:47:37
112
原创 Shell_NotifyIcon xp提示无法显示问题
/* 1、解决办法一共两个 摘自msdn Setting cbSize to this value enables all the version 5.0 and 6.0 enhancements. For earlier versions, the size of the pre-6.0 structure is given by the NOTIFYICONDATA_V2_SIZE constant and the pre-5.0 struc...
2020-06-30 17:47:07
89
原创 c++ windows置顶窗体终极方案
windows置顶窗体终极方案LRESULT OnForceShow(HWND hWnd){ HWND hForeWnd = NULL; DWORD dwForeID = 0; DWORD dwCurID = 0; hForeWnd = ::GetForegroundWindow(); dwCurID = :: GetCurrentThreadId(); dwForeID = ::GetWindowThreadProcessId( hForeWnd, NULL ); :.
2020-06-29 15:03:02
226
原创 系统环境变量 注册表键值
直接修改注册表键值,比用api来的快,[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment]Path 下就是对应值
2020-06-23 14:35:46
172
原创 c++11 lambda 与stl 仿函数
#include <iostream>#include <vector>#include <algorithm>using namespace std;typedef std::vector<int>CVectAges;//c++11 lamada 与stl 仿函数 int main(){ CVectAges tmp; for (int n = 0; n < 10; n++) { tmp.push_back(10 + n).
2020-06-23 14:21:43
114
原创 windows判断进程是32或者64位
#include <stdio.h>#include <windows.h>int CrnGetImageFileMachine(char* lpFileName);int main(){ int n = CrnGetImageFileMachine("C:/Users/Administrator/AppData/Local/Google/Chrome/Application/chrome.exe");//需要检测的可执行文件 if (n == 0x014C) pr.
2020-05-28 23:55:44
104
原创 操作系统UAC检测
操作系统UAC检测在控制面板中的 “用户账户设置”可以看到当前设置,其实这些设置在注册表中可以查看到的:1、注册表中位置 以及【高 ->中 ->低-> 关闭】键值组合= 注册表位置 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/System= ConsentPromptBehaviorAdmin:通知强度级别= EnableLUA:是否关闭UAC= PromptOnSecure.
2020-05-28 23:11:34
188
原创 windows 进程降权和提权代码示例
#include "windows.h"BOOL GetTokenByName(HANDLE &hToken,LPTSTR lpName){ if(!lpName) { return FALSE; } HANDLE hProcessSnap = NULL; BOOL bRet = FALSE; PROCESSENTRY32 pe32 = {0}; hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, .
2020-05-27 18:43:52
310
原创 websocketpp 支持ws http协议例子
/* * Copyright (c) 2014, Peter Thorson. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code m.
2020-05-27 18:39:01
319
原创 websocketpp 支持wss https协议例子
/*最近要用到websockt协议做windows 网络服务开发项目。发现websocket自带的例子 就可以支持wss https 添加回调即可,研究课好久才知道,原来他有例子!!!而且这连接点模式还支持多端口, * Copyright (c) 2015, Peter Thorson. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modificati.
2020-05-27 18:36:54
1335
原创 关于c++ 无法读写[HKEY_LOCAL_MACHINE\SYSTEM]下部分注册表键值解决办法!
系统UAC限制,由于admininstator 权限低于system,当c++程序以管理员方式是读取不到,注册表某些值通常做法是,启动一个windwos服务,服务是有system权限的,方法有两个1、此时在服务里面修改注册表OK。2、从winlogon.exe[system权限]获取进程token令牌 hToken,3、将hToken 传入CreateProcessAsUser 这样就可以将新创建的进程xx.exe提升为system权限先看函数原型BOOL WINAP..
2020-05-21 23:59:29
454
2
原创 c++ 调用批处理 bat 清理浏览器缓存。
1、通过工具抓取 IE浏览器,搜狗浏览器,chrome浏览器,火狐浏览器缓存路径如下: C:\Users\Administrator\AppData\Roaming\SogouExplorer\Webkit\Default\CacheC:\Users\Administrator\AppData\Local\Google\Chrome\User Data\Default\CacheC:\Users\Administrator\AppData\Local\Mozilla\Firefox\Profil.
2020-05-21 23:37:38
412
原创 mac下利用c++ 启动进程
#include<iostream>int main(int argc, char *argv[]){ system("/Applications/Safari.app/Contents/MacOS/Safari"); system("/Applications/QQ.app/Contents/MacOS/QQ"); return 0;}
2020-03-06 17:50:43
203
原创 c++ pugixml 插入节点和设置属性例子
#include "stdafx.h"#include "pugixml1.9/pugixml.hpp"#include <iostream>/* test.xml格式<?xml version="1.0" encoding="utf-8"?><Root ErrCode="0" Status="OK"> <child01 yes="1"...
2020-01-09 15:00:20
421
原创 c++ zeromq 和 Protocol Buffers 结合例子
//客户端#include "stdafx.h"#include <zmq.h>#include "test.pb.h"#include <fstream>using namespace std;/*1、test.proto 文件syntax = "proto2";message Example1 {required bool boolVal...
2020-01-09 14:33:12
212
原创 c++ 11 std::thread std::mutex等实现线程队列演示例子!
#include <iostream> // std::cout#include <thread> // std::thread#include <mutex> // std::mutex, std::unique_lock#include <condition_variable...
2020-01-09 14:12:40
354
1
原创 并行计算例子
#include <iostream>#include <vector>#include <algorithm>#include <omp.h>#include <functional>using namespace std;typedef std::vector<int>CVectInt;typedef ...
2020-01-09 11:39:43
487
原创 利用 jsoncpp 读取数组和对象例子
/*test1.json文件 [数组][ [2.0,5.6], [5.2,9.6]]*//*test2.json文件 [对象]{ "backupIP": "localhost", "code": 0, "discovery": "http://127.0.0.1/api", "port": "8000", "priorIP": "127.0.0.1"}*...
2020-01-09 11:15:21
1119
原创 c++ 枚举指定进程子窗口以Acrobat Reader DC (AcroRd32.exe)为例
/*说明:枚举指定窗口 且可见子窗体 句柄文件:FindWindows.h作者:@jd枚举指定进程子窗口类此类以Acrobat Reader DC (AcroRd32.exe)为例*/#pragma onceclass CFindWindows{public: CFindWindows(void); ~CFindWindows(void); /*...
2019-11-20 14:30:23
172
原创 opencv 枚举机器所有摄像头!!
// ----------------------------------------------------------------------// Our static function for finding num devices available etc// 摘自cap_dshow.cpp 文件// ---------------------------------------...
2019-10-17 18:07:53
1277
原创 关于opencv采集usb摄像头,采集一帧效率低的解决办法
#include "opencv2/opencv.hpp"#include "opencv2/highgui/highgui_c.h"#include <Windows.h>#include <time.h>#include <stdio.h>using namespace cv;const char *g_szTitle = "Camera"...
2019-10-17 18:04:50
1310
原创 禁用dpi缩放功能
Windows Registry Editor Version 5.00//禁用某个程序dpi缩放功能[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]//win7"C:\\Users\\system32\\AppData\\Local\\GitHubDesktop...
2019-08-21 10:28:20
2838
原创 枚举会话ID(可以用来检测当前windows用户是否是远程登录!)
#include <Windows.h>#include <WtsApi32.h>#include <stdio.h>#include <string>#include <iostream>#pragma comment(lib,"Wtsapi32.lib")//GetSystemMetrics(SM_REMOTESESSI...
2019-06-23 00:36:50
686
原创 qt通用容器算法 介绍qSort ,qFind
#include <QCoreApplication>#include <QVector>#include <QDebug>#include <QtAlgorithms>typedef QVector<int>CMyVector;bool caseInsensitiveLessThan(const QString &...
2019-06-02 10:57:55
434
原创 c++ 操作lua脚本
1、下载lualibhttp://www.lua.org/download.html2、luasql操作数据的http://luarocks.org/modules/tomasguisasola/luasql-mysqlhttps://github.com/zsuzuki/lualibhttps://blog.csdn.net/u013517637/article/det...
2019-06-01 23:48:17
508
原创 qmap使用
#include <QCoreApplication>#include <QMap>//#include <QVector>#include <QDebug>typedef QMap<QString,int>CMyQMap;int main(int argc, char *argv[]){ QCoreApplica...
2019-06-01 23:42:02
818
原创 vs2019编译Qt5.12.3
启动x86_x64 Cross Tools Command Prompt for VS 2019cd到Qt5.12.3 源码目录执行如下命令Windows:msvc版(静态版)1、./configure -confirm-license -opensource -platform win32-msvc -debug-and-release -static -static-run...
2019-05-02 20:39:48
7914
原创 windbg调试std::mutex死锁问题!!!
注意:mutex windows vista 以上系统用SRWLOCK 实现,winxp用的是rtlocks.cppcritical_section 调用InterlockedCompareExchangePointer 来实现的 一下分别以win7 和 xp 对比下dmp#include "stdafx.h"#include "mutex_d.h"#include<th...
2019-04-25 12:26:21
854
原创 std::mutex (互斥量内部实现SRWLOCK)
注意:mutex windows vista 以上系统用SRWLOCK 实现,winxp用的是参考 rtlocks.cppcritical_section 调用InterlockedCompareExchangePointer 来实现的Windows 7下 + vs2015 微软最新c++11 std::mutex 内部实现剖析一、 先说说微软c++11 里面实现的代码,...
2019-04-25 12:17:38
1070
原创 vs2019 编译grpc和opensll1.1.1b
准备工作一、系统环境win7 64位vs2019社区版二、首先下载和编译最新版openssl (我写文章时候是1.1.1.1b) 参考我上一篇博客写的内容编译即可 附地址: https://blog.csdn.net/jiangdong2007/article/details/89429266三、 下载工具 1、安装cmake最新版本...
2019-04-21 11:57:22
1577
2
原创 vs2019编译openssl1.1.1b
一、系统环境 win7 64位 vs2019社区版本二、准备下载以下内容 1、openssl 此时最新版https://www.openssl.org/source/openssl-1.1.1b.tar.gz 2、Perl 64位和32位版本 都安装上吧http://strawberryperl.com/download/5.28.1.1/s...
2019-04-21 11:02:37
6827
3
原创 c++调用约定不一致抛出 (_CRT_DEBUGGER_HOOK(_CRT_DEBUGGER_GSFAILURE)异常
1、dll导出程序部分代码 .def文件定义LIBRARY "TestDll"EXPORTS;fnTestDll @1Add @2代码.htypedef int(WINAPI *CallBackFn)(int n); //回调函数// 这是导出函数的一个示例。int WINAPI fnTestDll(CallBackFn pfn);int WINAPI Add...
2019-04-16 00:18:37
742
原创 c++ zlib 7z解压缩
https://www.7-zip.org/a/7z920.tar.bz2 http://zlib.net/ 收集大神的demo 自己就不写了!!转:https://blog.csdn.net/what951006/article/details/81905330?utm_source=blogxgwz4 创建目录和文件方法转 :压缩参数https://blog.csdn.n...
2018-12-18 10:37:21
2872
原创 windbg分析句柄泄漏
分析命令1、!htrace -enble。2、执行重现过程,并且让进城句柄泄漏。3、通过!htrace -diff 找出有问题的栈。
2018-11-22 16:24:29
293
原创 pugixml读写 遍历节点方法
// test.cpp : Defines the entry point for the console application.//test.xml/*<?xml version="1.0" encoding="ISO-8859-1"?><bookstore><book name="0"><title lang="eng
2018-11-22 10:45:38
2845
原创 new失败情况分析
new失败操作分为两大类:一、系统和程序内存充足情况。1、token handle过多不释放,耗尽会导致 new 创建县城失败等,此时虽然内存充足,但是new会抛出异常。 age: OpenProcessToken 在新版本编译器,new 失败会抛出异常,而不是返回null。查看进程token程序,自行下载编译即可!!http://www.codeforge.cn/ar...
2018-11-22 09:58:09
1190
原创 pugixml 解析类操作xml 支持xpath
官网和下载地址https://pugixml.org/http://github.com/zeux/pugixml/releases/download/v1.9/pugixml-1.9.zip 不废话,直接上文档中的例子吧!! 从文档中加载xml文件,另外这个解析类很强大,支持xpath语法不懂的可以参考(http://www.w3school.com.cn/xpath/ind...
2018-11-12 21:50:28
495
原创 开发中常用的只允许一个程序运行的办法createmutex
//开发中常用的只允许一个程序运行的办法//程序以单例模式运行 常用办法,创建一个互斥量//由于互斥量只允许一个进程或者线程占用 会创建失败,利用这个特性可以做到单例运行改程序#include "stdafx.h"#include<windows.h>#include <stdio.h>int _tmain(int argc, _TCHAR* argv[]...
2018-08-01 22:27:00
1616
原创 再谈wcscpy_s函数异常
int _tmain(int argc, _TCHAR* argv[]){ WCHAR ch[2]={0}; wcscpy_s(ch,2,TEXT("12")); //1、eroo 需要空间 要3个字节 + ‘\0’ WCHAR ch1[1]={0}; wcscpy_s(ch1,1,TEXT("12")); //2、erro 存储空间小于 src //1 2两种情况都会报错...
2018-07-31 10:18:36
2145
AcEdInputPointMonitor CAD鼠标提示信息反应器
2014-07-29
小青峰_jd的留言板
发表于 2020-01-02 最后回复 2020-01-02
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人 TA的粉丝