Time of Update: 2018-12-04
void SetDestTopColor(){ // window elements to change int aiElements[] = { COLOR_BACKGROUND, COLOR_DESKTOP, COLOR_ACTIVEBORDER, COLOR_ACTIVECAPTION, COLOR_WINDOW }; // array of RGB values // Define the new colors. DWORD aColors[
Time of Update: 2018-12-04
//---------------------------------------------------------------------------//函數輸入Big5字元,返回Gb簡體字元//---------------------------------------------------------------------------const CString Big2Gb(LPCTSTR pszBig5){ wchar_t* wszUnicode=NULL;
Time of Update: 2018-12-04
try { HINSTANCE ghInstApp = AfxGetInstanceHandle(); HRSRC hRsrc = FindResource(NULL, MAKEINTRESOURCE(IDB_BITMAP1), RT_BITMAP ); ASSERT(hRsrc); DWORD dwErr = GetLastError(); DWORD dwLen = SizeofResource(ghInstApp,hRsrc);
Time of Update: 2018-12-04
MENUITEMINFO MenuInfo = {0};MenuInfo.cbSize = sizeof(MENUITEMINFO);MenuInfo.fMask = MIIM_ID | MIIM_STRING | MIIM_STATE | MIIM_BITMAP | MIIM_CHECKMARKS;MenuInfo.fType = MFT_STRING | MFT_BITMAP | MFT_RADIOCHECK ;MenuInfo.fState = MFS_ENABLED |
Time of Update: 2018-12-04
DWORD ExcuteCmd(HWND hParent, LPCTSTR szOperate, LPCTSTR lpszPathFolderFile, LPCTSTR lpszParam=NULL, LPCTSTR lpszDir=NULL, int nCmd=SW_SHOWNORMAL){ DWORD hRet = (DWORD)ShellExecute(hParent, szOperate, lpszPathFolderFile, lpszParam, lpszDir, nCmd)
Time of Update: 2018-12-04
//行列座標轉換為字串BOOL Conv_Row_Col_to_Str(CString &str, long row, long col){ if(row < 1 || row > 65535 || col < 1 || col > 256) return(false); col--;#define DECIMAL26_COL ('Z'-'A'+1) long r_Col[] = { col/DECIMAL26_COL,
Time of Update: 2018-12-04
//繪製鏡像字型void Draw_Mirror_Text(CDC *pDst_DC,//目標裝置控制代碼 CPoint dst_Point,//目標位置 LPCTSTR drawText,//目標字串 COLORREF textColor, //字型顏色 bool Mirror_X,//X軸鏡像 bool Mirror_Y //Y軸鏡像 ){ if(pDst_DC && pDst_DC->m_hDC) //裝置控制代碼有效 {
Time of Update: 2018-12-04
int Find_special_File(LPCTSTR pszPath, //尋找起始路徑 LPCTSTR pszExt, //副檔名 BOOL include_subDirectory, //搜尋子目錄標誌 CListBox *pList) //列表{ int found_count = 0; //尋找計數器 int file_fliter_len = CString(pszExt).GetLength(); //副檔名長度
Time of Update: 2018-12-04
#include "stdafx.h"#include <Windows.h>#include <stdio.h> int main(){ HANDLE hConsoleHandle = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO *ConsoleInfo = new CONSOLE_SCREEN_BUFFER_INFO();
Time of Update: 2018-12-04
//IDB_BITMAP1為資源中的一張BMP位元影像圖片 // 更改當前字型 LOGFONT lf; pDC->GetCurrentFont()->GetLogFont(&lf); lf.lfCharSet=134; lf.lfHeight= -MulDiv(200, pDC->GetDeviceCaps(LOGPIXELSY), 72); lf.lfWidth=0; strcpy(lf.lfFaceName, _T("隸書")); CFont
Time of Update: 2018-12-04
BOOL ImageAnalyse(LPCTSTR szBMP){ //負載檔案 HANDLE hBitmap = LoadImage (NULL, szBMP, IMAGE_BITMAP,0, 0, LR_LOADFROMFILE); ASSERT (hBitmap != NULL); //關聯到位元影像 CBitmap m_bitmap; m_bitmap.Attach (hBitmap); //擷取檔案資訊 BITMAP bm ={0};
Time of Update: 2018-12-04
#include "stdafx.h"BOOL Zoom_Window(HWND hWnd, LPRECT lpTargetRect, LPRECT mOrgRect, BOOL bZoomEx_Only){ if(hWnd) { CRect TaregetEX_Pos = lpTargetRect; BOOL IsVisable = IsWindowVisible(hWnd); //保持可見狀態 ::SetWindowPos(hWnd, 0, 0, 0, 0, 0,
Time of Update: 2018-12-04
//Transparence 0-100#pragma comment(lib, "msimg32.lib")void TranspareDraw(CDC *pDC, LPRECT lpRect, int Transparence){ CDC memDC; memDC.CreateCompatibleDC(pDC); CBitmap bitMap; bitMap.LoadBitmap(IDB_BITMAP1); BITMAP bm; bitMap.GetBitmap(&bm)
Time of Update: 2018-12-04
#include <mmsystem.h>#pragma comment(lib, "winmm.lib")void CBbbbDlg::OnOK(){ CStringArray filePathName; TCHAR szFilter[] = _T("Wave Files (*.wav)|*.wav|All Files (*.*)|*.*||"); CFileDialog dlg(true, _T("*.wav"), NULL, OFN_ALLOWMULTISELECT,
Time of Update: 2018-12-04
#include <scode.h>#include <ole2.h>#include <objbase.h>CString OleFormatScode(LPSTR lpszMsg, SCODE sc){#define CASE_SCODE(sc) case sc: szErrName.Format(_T("%s"),#sc);break;CString szErrName;switch (sc){/* SCODE's defined in SCODE.H
Time of Update: 2018-12-04
//繪製空心字void DrawHollowChar(CDC *pDC, LPCTSTR szText){ int nSaveDC = pDC->SaveDC(); // 更改當前字型 LOGFONT lf; pDC->GetCurrentFont()->GetLogFont(&lf); lf.lfCharSet=134; lf.lfHeight= -MulDiv(200, pDC->GetDeviceCaps(LOGPIXELSY), 72);
Time of Update: 2018-12-04
//MixVolumeCtrl.h#pragma once#include <mmsystem.h>#pragma comment(lib, "winmm.lib")class CMixVolumeCtrl{ HMIXER m_hMixer; DWORD dwMinVol, dwMaxVol; UINT nVolumeControlID; UINT nMuteControlID;//構析public: CMixVolumeCtrl() { m_hMixer =
Time of Update: 2018-12-04
void HEX2ASC(BYTE Hex, TCHAR uChar[3]){ //0-F 轉換成 '0'-'F'#define BIN2TXT(x) (((x) > 9) ? ((x)-10+_T('A')) : ((x)+_T('0'))) uChar[0] = BIN2TXT(Hex>>4);//高四位 uChar[1] = BIN2TXT(Hex&0x0F);//低四位 uChar[2] = 0;//結束}BYTE ASC2HEX(const
Time of Update: 2018-12-04
#include <malloc.h>DWORD run_Execute(LPCTSTR lpszFile, LPCTSTR lpszParam){ DWORD exitCode = 0; PROCESS_INFORMATION pInfo = {0}; STARTUPINFO sInfo = {0}; sInfo.cb = sizeof(STARTUPINFO); sInfo.wShowWindow
Time of Update: 2018-12-04
/*Eval_Exception輸入參數: EXCEPTION 異常代碼傳回值: 以下三個中的一個 取決於你準備如何處理EXCEPTION_EXECUTE_HANDLEREXCEPTION_CONTINUE_SEARCHEXCEPTION_CONTINUE_EXECUTION*/int Eval_Exception (DWORD n_except){ int nRet = EXCEPTION_CONTINUE_SEARCH; //0 switch(n_except) {