原创 win32 判斷當前窗口是否在最前端顯示

如何判斷當前窗口是否在最前端顯示? if ((m_hWnd == ::GetForegroundWindow())) {               //to do }      

原创 win32 設置窗口臨時顯示到最前面

如何設置窗口臨時顯示到桌面最前面? 關鍵點:win32 api--AttachThreadInput,SetForegroundWindow 實現代碼:     void CMainFrame::BringMainwndToForegro

原创 win32 窗口鼠標鎖定

如何實現鼠標鎖定在某一窗口中? 關鍵點:win32 api--ClipCursor 鎖定時: RECT WndRect; ::GetWindowRect(你的窗口句柄, &WndRect); ::ClipCursor(&WndRect);

原创 【c++11】 lamda表達式

1.標準樣式 [](CString itUrl)->bool {                      } 例子: 不帶參數: auto fun_helloworld = []()->void{   std::cout << "hel

原创 【c++11】基本類型與字符串轉換

1.基礎類型轉爲字符串 api: std::to_string Defined in header <string>     std::string to_string( int value ); (1) (since C++11

原创 【c++實例總結】 時間time_t轉爲字符串輸出2(std::put_time與std::get_time)

1.基礎介紹 頭文件: #include <iomanip> //io 操作,manipulator是操作的意思,英文全稱的縮寫   api: (1)std::put_time c++源碼: // TEMPLATE STRUCT _

原创 C++字符串轉換(stoi;stol;stoul;stoll;stoull;stof;stod;stold)

轉載:C++字符串轉換(stoi;stol;stoul;stoll;stoull;stof;stod;stold) 一、stoi 頭文件string int stoi (const string& str, size

原创 【c++實例總結】 位運算代替bool數組

問題:開發有時會用到多個標誌位,那麼通常如何實現呢? 方式1:普通方式,即使用bool數組 方式2:二進制位方式,參考mfc等可看到一種通過使用二進制的每一位來代替bool數組的方式,比較實用 實現方式: #define    MY_FL

原创 【C++實例總結】負數取模運算

轉載: https://www.cnblogs.com/widerg/p/7208041.html https://blog.csdn.net/u013094181/article/details/21863491   1.取模運算 (1

原创 【IE編程】給指定進程設置使用的內嵌IE的版本

1.進程如果使用內嵌IE(IWebBrowser2)時,如何給當前進程設置IE的版本號爲最新的呢? 第1步:添加頭文件browser_feature_control_helper.h #ifndef BASE_BROWSER_FEATU

原创 【IE編程】 IWebBrowser2子線程調用崩潰

1.c++調用js函數方法: #include <Mshtml.h> bool CBrowserFunc::ExecJsFun(IWebBrowser2 *pWebBrowser2, const std::wstring& lpJsF

原创 c++特殊文件類型

1.inl文件 內聯函數源文件,使用類模板時,也可以存放類模板的實現 2.hpp文件 c++聲明和定義都存放在一個文件中,相當於.h和.cpp合併到一起了,使用時只要#include包含就行了 點贊 收藏 分享

原创 VC6安裝後運行崩潰解決

去掉以兼容模式運行,以管理員運行項 點贊 收藏 分享

原创 【c++實例總結】 時間time_t轉爲字符串輸出(strftime)

1.time_t轉爲字符串輸出 api: localtime_s       --將time_t轉爲tm結構體 strftime             --將tm格式化輸出   代碼如下: #include <iostream> //

原创 win32 調試技巧-添加控制檯調試

  1.win32 調試技巧-添加控制檯調試 涉及api: AllocConsole() ; freopen/freopen_s GetStdHandle WriteConsole FreeConsole 涉及字符串: conout$,