Time of Update: 2018-12-04
//擷取ProcessID#include "stdafx.h"#include #include #include #include using namespace std; int main() { HANDLE hsnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); PROCESSENTRY32 *processinfo = new PROCESSENTRY32;
Time of Update: 2018-12-04
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
Time of Update: 2018-12-04
#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;
Time of Update: 2018-12-04
#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
Time of Update: 2018-12-04
BOOL ViewControl_PropertyPage(HWND hParent, CWnd *pCtrl){ LCID m_lcid=GetUserDefaultLCID(); //User locale IDispatch *m_pIDispatch = (IDispatch *)pCtrl->GetControlUnknown(); //Object in use
Time of Update: 2018-12-04
void CFsaSet::DoFieldExchange(CFieldExchange* pFX){ //{{AFX_FIELD_MAP(CFsaSet) pFX->SetFieldType(CFieldExchange::outputColumn); switch(pFX->m_nOperation) { case(CFieldExchange::Name): // append dirty field name
Time of Update: 2018-12-04
#include <shlwapi.h>#pragma comment(lib, "shlwapi.lib")//檢測需要的檔案是否存在//並且對需要註冊的檔案進行註冊//輸入參數用於指示檔案所在的路徑//返回TRUE表示成功BOOL Check_Environment(LPCTSTR lpszAppPath) //傳入檔案路徑{ //列出所需要的檔案清單 typedef struct _FILE_CELL { LPCTSTR szFileName; //檔案名稱
Time of Update: 2018-12-04
#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
Time of Update: 2018-12-04
讓我們迴歸BY 默難 個人感受,文字粗糙,語言無條理,望多多見諒
Time of Update: 2018-12-04
//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)
Time of Update: 2018-12-04
/******************************************************************************/* This is a part of the Microsoft Source Code Samples.* Copyright (C) 1993-1997 Microsoft Corporation.* All rights reserved.* This source code is
Time of Update: 2018-12-04
//映像灰階化處理void ImageGrayProcess(HBITMAP hBitmap, BOOL bAvgType=TRUE){ if(hBitmap) { CBitmap *bmpSrc = CBitmap::FromHandle(hBitmap); BITMAP bmSrcInfo; bmpSrc->GetBitmap( &bmSrcInfo ); DWORD dwBmByteSize = bmSrcInfo.bmWidthBytes *
Time of Update: 2018-12-04
#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,
Time of Update: 2018-12-04
#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
Time of Update: 2018-12-04
CWinApp *pApp = AfxGetApp(); POSITION PosDocTemplate = pApp->GetFirstDocTemplatePosition(); while(PosDocTemplate) { CDocTemplate* pDocTemplate = pApp->GetNextDocTemplate( PosDocTemplate ); POSITION PosDoc =
Time of Update: 2018-12-04
#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
Time of Update: 2018-12-04
#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
Time of Update: 2018-12-04
#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,
Time of Update: 2018-12-04
#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
Time of Update: 2018-12-04
// 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: