IExpress 制作安装包 注意事项
摘要:被打包的文件名不能超过8个字符,否则iexpress会取前6个字符 +"~1"。
阅读全文
posted @
2014-01-27 16:32
ximenchuixie
阅读(225)
推荐(0)
VC 判断网络连接函数
摘要:IsNetworkAliveBool IsNetworkAlive( _Out_LPDWORD lpdwFlags);HeaderSensapi.hLibrarySensapi.libhttp://msdn.microsoft.com/en-us/library/windows/desktop/aa377522(v=vs.85).aspx
阅读全文
posted @
2013-08-21 17:17
ximenchuixie
阅读(435)
推荐(0)
event bManualResult
摘要:MSDN:bManualReset[in]If this parameter isTRUE, the function creates a manual-reset event object, which requires the use of theResetEventfunction to set the event state to nonsignaled. If this parameter isFALSE, the function creates an auto-reset event object, and system automatically resets the even
阅读全文
posted @
2013-08-15 13:55
ximenchuixie
阅读(189)
推荐(0)
visual stdio 工程 宏
摘要:$(SolutionDir) solution目录$(ProjectDir) Project目录$(TargetDir) 目标文件夹,如编译出的exe文件所在的目录$(Configuration) Release或Debug
阅读全文
posted @
2013-07-27 13:08
ximenchuixie
阅读(138)
推荐(0)
vc 读xml文件 宏
摘要:自定义FOREACH循环,便于coding在指定xml的nodelist b中遍历每个节点#define FOREACH_NODE(a,b)\ long cnt = 0; \ CComPtr a;\ b->get_length(&cnt);\ for(int i = 0; i get_item(i,&a)); i++, a = NULL) //get_item(i,&a) // 用此函数时第二个参数要初始化为空,此例a=NULL
阅读全文
posted @
2013-07-23 14:26
ximenchuixie
阅读(271)
推荐(0)
【转】vc api 录音
摘要:一、数字音频基础知识Fourier级数:任何周期的波形可以分解成多个正弦波,这些正弦波的频率都是整数倍。级数中其他正线波的频率是基础频率的整数倍。基础频率称为一级谐波。PCM:pulse code modulation,脉冲编码调制,即对波形按照固定周期频率采样。为了保证采样后数据质量,采样频率必须是样本声音最高频率的两倍,这就是Nyquist频率。样本大小:采样后用于存储振幅级的位数,实际就是脉冲编码的阶梯数,位数越大表明精度越高,这一点学过数字逻辑电路的应该清楚。声音强度:波形振幅的平方。两个声音强度上的差常以分贝(db)为单位来度量,计算公式如下:20*log(A1/A2)分贝。A1,A
阅读全文
posted @
2013-07-10 05:12
ximenchuixie
阅读(568)
推荐(0)
win32允许前置窗口
摘要:win32允许前置窗口函数AllowSetForegroundWindow(HWND hWnd)该函数允许其他窗口调用SetForegroundWindow()(将窗口设为前置窗口),前提是调用AllowSetForegroundWindow()函数的窗口已经是前置窗口与之对应的LockSetForegroundWindow (),不允许前置窗口
阅读全文
posted @
2013-06-17 14:19
ximenchuixie
阅读(502)
推荐(0)
win32 中使用gdiplus相关
摘要:添加头文件:#include <GdiPlus.h>using namespace Gdiplus;#pragma comment(lib, "gdiplus.lib")若编译出现错误,将stdafx.h中 "#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers "注释掉即可使用GDI+前要进行初始化GdiplusStartupInput gdiplusStartupInput;ULONG_PTR gdiplusToken;GdiplusSt
阅读全文
posted @
2013-06-14 00:16
ximenchuixie
阅读(191)
推荐(0)
win32 GDI 画图
摘要:设备上下文(Device Context):位于程序和显示设备的中间层,方便编码,避免针对不同显示设备编写不同代码。win32通过DC画图.DC 通过SelectObject方法来设置属性,例如背景图,画笔颜色等等。特殊DC: 内存DC(位于内存中):例子:HDC Hdc;HBITMAP hBit2;hdc = CreateCompatibleDC(GetDC());hBit2 = CreateCompatibleBitmap(hdc,rct.right - rct.left,rct.bottom - rct.top);SelectObject(myHdc2,hBit2); ...
阅读全文
posted @
2013-06-14 00:03
ximenchuixie
阅读(540)
推荐(0)
win32 GDI 画图 防止闪烁
摘要:解决办法:双缓冲即先将要画的内容画在内存DC上,画完后再用BitBlt将内存DC的内容画到窗口中;如果要经常重画背景,需要拦截WM_ERASEBKGND消息,使之什么也不做(即不画默认背景)
阅读全文
posted @
2013-06-13 23:10
ximenchuixie
阅读(405)
推荐(0)
向窗口发送ctrl c复制 消息
摘要:两种方式:1. 模拟键盘按键:keybd_event(VK_CONTROL,0,0,0); //ctrl键按下 keybd_event(BYTE('C'),0,0,0); //c键按下 keybd_event(BYTE('C'),0,KEYEVENTF_KEYUP,0); //c键抬起 keybd_event(VK_CONTROL,0,KEYEVENTF_KEYUP,0); //ctrl键抬起2. 向窗口发送WM_COPY消息::SendMessage(::GetForegroundWindow(), WM_COPY, 0,0); /...
阅读全文
posted @
2013-05-29 20:06
ximenchuixie
阅读(788)
推荐(0)
Enabling and Disabling Privileges in C++
摘要:http://msdn.microsoft.com/en-us/library/windows/desktop/aa446619(v=vs.85).aspx例子:MSDN#include <windows.h>#include <stdio.h>#pragma comment(lib, "cmcfg32.lib")BOOL SetPrivilege( HANDLE hToken, // access token handle LPCTSTR lpszPrivilege, // name of privilege to enable/disable B
阅读全文
posted @
2013-05-29 02:43
ximenchuixie
阅读(423)
推荐(0)
【转】XP下OpenProcess( PROCESS_ALL_ACCESS...失败
摘要:转自http://hi.baidu.com/1981633/item/04c78cceb3cf563399b4983bXP下OpenProcess( PROCESS_ALL_ACCESS...失败在编译器下调试时可以打开进程,单独运行时不行。代码来自网上。解决方法:int AddPrivilege(const char *Name){HANDLE hToken;TOKEN_PRIVILEGES tp;LUID Luid;if (!OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY,&hToke
阅读全文
posted @
2013-05-29 02:26
ximenchuixie
阅读(678)
推荐(0)
VC 模拟键盘事件
摘要:本例模仿ctrl c事件keybd_event( VK_CONTROL,0x11,0,0 ); //ctrl键按下 keybd_event( 0x43,0x43,0,0 ); //c键按下 0x43为‘c’键的识别码 keybd_event( 0x43,0x43,KEYEVENTF_KEYUP,0 ); //c键抬起 keybd_event( VK_CONTROL,0x11,KEYEVENTF_KEYUP,0); //ctrl键抬起
阅读全文
posted @
2013-05-19 23:29
ximenchuixie
阅读(412)
推荐(0)
VC 读取注册表键值
摘要:输入:注册表完整路径,如:HKEY_LOCAL_MACHINE\Software\Microsoft\ABC\dwPoints输出:键值(如dwPoints对应的值)CString GetKeyValue(CString bstrRegPath){ CString strPath = _T(""); CString path = bstrRegPath; long length = path.GetLength(); int index = path.Find(_T('\\')); if (index == -1) { return L""
阅读全文
posted @
2013-04-28 20:42
ximenchuixie
阅读(926)
推荐(0)
vc 注册表操作
摘要:HKEY hkey; //注册表句柄,标示是否打开注册表成功DWORD dwSize = MAX_PATH;TCHAR string[MAX_PATH];LONG lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,pathDir,0,KEY_READ,&hkey); //打开注册表路径(不含键值),pathDir:注册表路径 if(lRet != ERROR_SUCCESS) { return S_OK; }lRet = RegQueryValueEx(hkey, keyValue, NULL, REG_NONE,(LPBYTE)string,&d.
阅读全文
posted @
2013-04-23 13:33
ximenchuixie
阅读(182)
推荐(0)
vc 创建进程
摘要:STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); ZeroMemory(&pi, sizeof(pi)); ::CreateProcess(path,NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);//path:进程路径 if (pi.hProcess != NULL) { ::CloseHandle(pi.hProcess); } if (pi.hThread != NULL) {
阅读全文
posted @
2013-04-23 13:24
ximenchuixie
阅读(199)
推荐(0)
获取HINSTANCE的方法
摘要:1,SDK API中使用HMODULE GetModuleHandle(NULL);2,MFC中使用HINSTANCE AfxGetInstanceHandle();参考:http://www.cnblogs.com/BeyondTechnology/archive/2011/02/20/1959301.html
阅读全文
posted @
2013-04-22 01:11
ximenchuixie
阅读(534)
推荐(0)
VS2010 .vcxproj文件与.vcxproj.filter文件
摘要:vcxproj文件:工程文件,其中描述了工程的各项属性,修改该文件后再重新build时vs会重新build工程vcxproj.filter文件:可理解为视图文件,定义了工程在VS中打开后的目录结构,修改该文件后重新build时vs不会重新build工程参考:http://stackoverflow.com/questions/6941868/why-do-vcxproj-filters-files-exist
阅读全文
posted @
2013-04-21 23:47
ximenchuixie
阅读(4003)
推荐(1)