快照方式枚舉 ProcessID

 //擷取ProcessID#include "stdafx.h"#include #include #include #include using namespace std; int main() { HANDLE hsnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); PROCESSENTRY32 *processinfo = new PROCESSENTRY32;

載入BMP檔案 並繪製

BOOL LoadBitmapFromBMPFile( LPTSTR szFileName, HBITMAP *phBitmap, HPALETTE *phPalette ){  BITMAP  bm;  *phBitmap = NULL;  *phPalette = NULL;  // Use LoadImage() to get the image loaded into a DIBSection  *phBitmap = LoadImage( NULL, szFileName, IMAGE

擷取應用程式版本資訊

#pragma comment(lib, "VERSION.LIB")int CheckVersion(LPTSTR lpszFullPath, VS_FIXEDFILEINFO *pVerInfo){ BOOL bRet = 0; DWORD dwVerHnd; DWORD dwVerInfoSize = GetFileVersionInfoSize(lpszFullPath, &dwVerHnd); if (dwVerInfoSize) { HANDLE hMem;

我的調試輸出_TRACE 第二版

#ifdef _DEBUG class __CTrace { CString szFileAndLine; public: __CTrace(LPCTSTR szFile, int nLien) { szFileAndLine.Format(_T("%s(%d): "), szFile, nLien); } void __cdecl operator()(LPCTSTR format, ...) const { TCHAR

調出Activex控制項屬性頁面

BOOL ViewControl_PropertyPage(HWND hParent, CWnd *pCtrl){ LCID m_lcid=GetUserDefaultLCID(); //User locale IDispatch *m_pIDispatch = (IDispatch *)pCtrl->GetControlUnknown(); //Object in use

在MFC ODBC 中 使 CRecordSet 指定欄位變為唯讀欄位

void CFsaSet::DoFieldExchange(CFieldExchange* pFX){ //{{AFX_FIELD_MAP(CFsaSet) pFX->SetFieldType(CFieldExchange::outputColumn); switch(pFX->m_nOperation) { case(CFieldExchange::Name): // append dirty field name

應用程式檢查必要的檔案和自動註冊控制項

 #include <shlwapi.h>#pragma comment(lib, "shlwapi.lib")//檢測需要的檔案是否存在//並且對需要註冊的檔案進行註冊//輸入參數用於指示檔案所在的路徑//返回TRUE表示成功BOOL Check_Environment(LPCTSTR lpszAppPath) //傳入檔案路徑{ //列出所需要的檔案清單 typedef struct _FILE_CELL { LPCTSTR szFileName; //檔案名稱

RGB和HLS色彩空間互相轉換的類

#pragma once#include <shlwapi.h>#pragma comment(lib, "shlwapi.lib")class CColor_RGB_HLS{ #define HLSMAX 240 /* H,L, and S vary over 0-HLSMAX */ #define RGBMAX 255 /* R,G, and B vary over 0-RGBMAX */ /* HLSMAX BEST IF

讓我們迴歸

讓我們迴歸BY 默難        個人感受,文字粗糙,語言無條理,望多多見諒       

使用SetLayeredWindowAttributes API 實現透明視窗

//bAlpha form 0 to 255//When bAlpha is 0, the window is completely transparent.//When bAlpha is 255, the window is opaque.BOOL SetWindowAlpha(HWND hwnd, BYTE bAlpha){ BOOL bRet = 0; HMODULE hModule = GetModuleHandle(_T("User32.dll")); if(hModule)

通過MSDN上的例子學習管道讀寫技術

/******************************************************************************/* This is a part of the Microsoft Source Code Samples.* Copyright (C) 1993-1997 Microsoft Corporation.* All rights reserved.* This source code is

映像灰階化處理

//映像灰階化處理void ImageGrayProcess(HBITMAP hBitmap, BOOL bAvgType=TRUE){ if(hBitmap) { CBitmap *bmpSrc = CBitmap::FromHandle(hBitmap); BITMAP bmSrcInfo; bmpSrc->GetBitmap( &bmSrcInfo ); DWORD dwBmByteSize = bmSrcInfo.bmWidthBytes *

使用_stscanf和_sntprintf進行GUID和字串互相轉換

#include <stdio.h>BOOL LPCTSR2GUID(LPCTSTR szGUID, GUID &Guid){ memset(&Guid, 0, sizeof(Guid)); int nRet = _stscanf(szGUID, _T("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x"), &Guid.Data1, &Guid.Data2,

計算兩個時間之間的時間差

#define TIME_START_YEAR 2000 //起始年份typedef struct _TIME{ short year; short month; short day; short hour; short minute; short second;}TIME, *LPTIME;double Time_to_Second(LPTIME tm) //時間轉換成秒{ int year, month; unsigned long spanDay =0; double

通過文件範本-文檔枚舉視窗視控制代碼

CWinApp *pApp = AfxGetApp(); POSITION PosDocTemplate = pApp->GetFirstDocTemplatePosition(); while(PosDocTemplate) { CDocTemplate* pDocTemplate = pApp->GetNextDocTemplate( PosDocTemplate ); POSITION PosDoc =

MD5 計算類

#pragma once//參考RFC1321標準//參考資料見 http://www.ietf.org/rfc/rfc1321.txtclass CMD5Sum{private:#define S11 7#define S12 12#define S13 17#define S14 22#define S21 5#define S22 9#define S23 14#define S24 20#define S31 4#define S32 11#define S33 16#define S3

我的調試跟蹤函數_TRACE

#include <comdef.h>#ifdef _DEBUG void _TRACE( LPCTSTR szInfo, _variant_t Val) { try { WCHAR szBuff[1024]; memset(szBuff, 0, sizeof(szBuff)); if(szInfo) { _variant_t vs( szInfo ); vs.ChangeType( VT_BSTR

使用 IActiveDesktop 介面擷取設定案頭背景圖片

#ifndef AD_GETWP_LAST_APPLIED#define AD_GETWP_LAST_APPLIED 0x00000002#endif //BOOL GetWallPaper(CStringW &szFile, BOOL &dwStyle){BOOL bRet = 0;IActiveDesktop *pActiveDesktop;HRESULT hr = CoCreateInstance(CLSID_ActiveDesktop, NULL,

從檔案資源擷取檔案資訊

#pragma comment(lib, "version.lib")DWORD QueryFileInfo(LPTSTR szFullPath){ DWORD dwErr = ERROR_SUCCESS; DWORD dwVerHnd=0; // An 'ignored' parameter, always '0' DWORD dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd); if

Send Raw Data to a Printer by Using the Win32 API

// RawDataToPrinter - sends binary data directly to a printer//// Params:// szPrinterName - NULL terminated string specifying printer name// lpData - Pointer to raw data bytes// dwCount - Length of lpData in bytes//// Returns:

總頁數: 61357 1 .... 17740 17741 17742 17743 17744 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.