实现查询回收站信息以及清空回收站
admin | win32 | 2013-07-11
C++
#include <stdio.h>
#include <windows.h>
#include <shellapi.h> //SHEmptyRecycleBin和SHQueryRecycleBin所需要的头文件
int main(int argc, char* argv[])
{
//初始化SHQUERYRBINFO结构
SHQUERYRBINFO RecycleBinInformation;
ZeroMemory(&RecycleBinInformation,sizeof(RecycleBinInfo... [阅读全文]
封装GetLastError,输出错误信息
admin | win32 | 2013-07-11
C++
/************************************************************************/
/*函数名:ShowLastError
/*功 能:封装GetLastError,输出错误信息
/*返回值:无
/************************************************************************/
void Utility::ShowLastError(
LPTSTR lpszFunction//自定义信... [阅读全文]
强大的字符串容器SCClString。
admin | C++ | 2013-07-11
C++
typedef struct {
// author : Jelo Wang
// notes : SCClString
// since : 20090816
// (c)TOK
char* data ;
// length of data
int length ;
int last_walker ;
// actual length of contents about the data
int add_walker ;
int get_walker ;
} SCClString ;
SCClString* SCClStrin... [阅读全文]
得到一个GUID字符串
admin | win32 | 2013-07-11
C++
CString rString;
GUID m_guid;
::CoCreateGuid(&m_guid);
CString strFormat =CString("{%08lX-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X}");
rString.Format(strFormat,m_guid.Data1, m_guid.Data2, m_guid.Data3,
m_guid.Data4[0], m_guid.Data4[1], m_guid.Data4[2], m_guid.Data4[3],
m_guid.Data4[4... [阅读全文]
通过启动一个进程,并等待其结束
admin | win32 | 2013-07-11
C++
//通过启动一个进程,并等待其结束
int ExecuteAndWaitForCompletion(CString strcmd,bool show)
{
STARTUPINFO si;
ZeroMemory( &si, sizeof(si) );
si.cb=sizeof(STARTUPINFO);
si.dwFlags=STARTF_USESHOWWINDOW;//使用wShowWindow
if(show)
{
si.wShowWindow=SW_SHOW;//... [阅读全文]
设置扩展名系统关联
admin | win32 | 2013-07-11
C++
/*
* Assoc.C - assoc internal command.
*
*
* History:
*
* 14-Mar-2009 Lee C. Baker
* - initial implementation
*
* 15-Mar-2009 Lee C. Baker
* - Don't write to (or use) HKEY_CLASSES_ROOT directly
* - Externalize strings
*
* TODO:
* - PrintAllAssociations might could be o... [阅读全文]
清除系统临时目录里的文件和目录
admin | win32 | 2013-07-11
#include <deque>
using namespace std;
TCHAR lpPath[MAX_PATH];
memset(lpPath,0,MAX_PATH);
GetTempPath(MAX_PATH,lpPath);
deque<CString>delfiles;
deque<CString>folderList;
CString path;
path.Format(“%s\\*.*”,lpPath);
delfiles.push_back(path);
while (delfiles.size()>0)
{
CFileFind delfinder;
BOOL ... [阅读全文]
Windows下提升进程权限
admin | C++, Windows api | 2013-07-11
C++
windows的每个用户登录系统后,系统会产生一个访问令牌(access token) ,其中关联了当前用户的权限信息,用户登录后创建的每一个进程都含有用户access token的拷贝,当进程试图执行某些需要特殊权限的操作或是访问受保护的内核对象时,系统会检查其acess token中的权限信息以决定是否授权操作。Administrator组成员的acc... [阅读全文]
Laplace变换(视频边界检测)
admin | C++ | 2013-07-05
C++
#include "cv.h"
#include "highgui.h"
#include <ctype.h>
#include <stdio.h>
int main(int argc , char **argv)
{
IplImage *laplace = 0;
IplImage *coloelaplace = 0;
IplImage *planes[3]={0,0,0};//多个图像面
CvCapture *capture = 0;
if (argc==1|| (argc==2 &&am... [阅读全文]