使用SetSysColors 修改系統色彩

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[

BIG5 GBT字元轉換

//---------------------------------------------------------------------------//函數輸入Big5字元,返回Gb簡體字元//---------------------------------------------------------------------------const CString Big2Gb(LPCTSTR pszBig5){ wchar_t* wszUnicode=NULL;

從檔案匯出一個位元影像資源寫成BMP位元影像檔案

try { HINSTANCE ghInstApp = AfxGetInstanceHandle(); HRSRC hRsrc = FindResource(NULL, MAKEINTRESOURCE(IDB_BITMAP1), RT_BITMAP ); ASSERT(hRsrc); DWORD dwErr = GetLastError(); DWORD dwLen = SizeofResource(ghInstApp,hRsrc);

構造MENUITEMINFO 使用InsertMenuItem給菜單插入圖片

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 |

格式化 ShellExecute 返回的錯誤值

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)

EXCEL行列座標與字串的相互轉換

//行列座標轉換為字串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,

繪製鏡像字型

//繪製鏡像字型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) //裝置控制代碼有效 {

遞迴方式搜尋檔案

int Find_special_File(LPCTSTR pszPath, //尋找起始路徑 LPCTSTR pszExt, //副檔名 BOOL include_subDirectory, //搜尋子目錄標誌 CListBox *pList) //列表{ int found_count = 0; //尋找計數器 int file_fliter_len = CString(pszExt).GetLength(); //副檔名長度

更改控制台字型和背景顏色

#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();

繪製位元影像字型

//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

從檔案載入位元影像

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};

調整視窗尺寸

#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,

使用AlphaBlend繪製透明度可調位元影像

//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)

使用PlaySound播放Wave音效檔

#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,

格式化OLE錯誤碼

#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

繪製空心字

//繪製空心字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);

混音器音量控制

//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 =

把2進位檔案寫成ASC HEX檔案

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

使用CreateProcess建立新的process 並返回process運行結束傳回值

#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

Structured Exception Handling 異常撲捉

/*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) {

總頁數: 61357 1 .... 17739 17740 17741 17742 17743 .... 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.