- 博客(226)
- 资源 (6)
- 收藏
- 关注
原创 Chromium 如何在c++里面控制扩展加载
扩展安装 主要是通过UserMayLoad 函数控制,true允许加载,否则禁用。引自chromiun参考。【一般可以根据扩展ID禁用】
2023-08-15 22:47:26 332
原创 windows 如何强杀其他用户进程
管理员权限kill当前windows账号可以,kill启动的会失败。kill进程需要开启SE_DEBUG_NAME权限。直接上代码:调试权限允许某人调试他们本来无权访问的进程。例如,在其令牌上启用了调试权限的用户身份运行的进程可以调试作为本地系统运行的服务。调试权限是一种安全策略设置,允许用户将调试器附加到进程或内核。管理员可以修改用户组的安全策略,以包括或删除此功能。调试自己的应用程序的开发人员不需要此用户权限。正在调试系统组件或正在调试远程组件的开发人员将需要此用户权限。
2023-08-15 22:27:17 392
原创 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 2233 1
原创 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 736
原创 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 399
原创 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 1431 1
原创 系统环境变量 注册表键值
直接修改注册表键值,比用api来的快,[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment]Path 下就是对应值
2020-06-23 14:35:46 454
原创 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 281 1
原创 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 650
原创 操作系统UAC检测
操作系统UAC检测在控制面板中的 “用户账户设置”可以看到当前设置,其实这些设置在注册表中可以查看到的:1、注册表中位置 以及【高 ->中 ->低-> 关闭】键值组合= 注册表位置 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/System= ConsentPromptBehaviorAdmin:通知强度级别= EnableLUA:是否关闭UAC= PromptOnSecure.
2020-05-28 23:11:34 1356
原创 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 1722
原创 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 1799 1
原创 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 4725
原创 关于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 2207 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 2612
原创 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 747
原创 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 1869 1
原创 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 815
原创 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 710 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 1805
原创 利用 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 5061
原创 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 748
原创 opencv 枚举机器所有摄像头!!
// ----------------------------------------------------------------------// Our static function for finding num devices available etc// 摘自cap_dshow.cpp 文件// ---------------------------------------...
2019-10-17 18:07:53 2548 1
原创 关于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 2916
原创 禁用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 5028
原创 枚举会话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 1304
原创 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 1581
原创 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 680
原创 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 1147
原创 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 8901
原创 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 1888
原创 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 2382
原创 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 2434 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 11424 3
AcEdInputPointMonitor CAD鼠标提示信息反应器
2014-07-29
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人