亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dipslib.cpp

?? Windows via C/C++, Fifth Edition圖書源代碼
?? CPP
字號:
/******************************************************************************
Module:  DIPSLib.cpp
Notices: Copyright (c) 2008 Jeffrey Richter & Christophe Nasarre
******************************************************************************/


#include "..\CommonFiles\CmnHdr.h"     /* See Appendix A. */
#include <WindowsX.h>
#include <CommCtrl.h>

#define DIPSLIBAPI __declspec(dllexport)
#include "DIPSLib.h"
#include "Resource.h"


///////////////////////////////////////////////////////////////////////////////


#ifdef _DEBUG
// This function forces the debugger to be invoked
void ForceDebugBreak() {
   __try { DebugBreak(); }
   __except(UnhandledExceptionFilter(GetExceptionInformation())) { }
}
#else
#define ForceDebugBreak()
#endif


///////////////////////////////////////////////////////////////////////////////


// Forward references
LRESULT WINAPI GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam);

INT_PTR WINAPI Dlg_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);


///////////////////////////////////////////////////////////////////////////////


// Instruct the compiler to put the g_hHook data variable in 
// its own data section called Shared. We then instruct the 
// linker that we want to share the data in this section 
// with all instances of this application.
#pragma data_seg("Shared")
HHOOK g_hHook = NULL;
DWORD g_dwThreadIdDIPS = 0;
#pragma data_seg()

// Instruct the linker to make the Shared section
// readable, writable, and shared.
#pragma comment(linker, "/section:Shared,rws")


///////////////////////////////////////////////////////////////////////////////


// Nonshared variables
HINSTANCE g_hInstDll = NULL;


///////////////////////////////////////////////////////////////////////////////


BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD fdwReason, PVOID fImpLoad) {

   switch (fdwReason) {

      case DLL_PROCESS_ATTACH:
         // DLL is attaching to the address space of the current process.
         g_hInstDll = hInstDll;
         break;

      case DLL_THREAD_ATTACH:
         // A new thread is being created in the current process.
         break;

      case DLL_THREAD_DETACH:
         // A thread is exiting cleanly.
         break;

      case DLL_PROCESS_DETACH:
         // The calling process is detaching the DLL from its address space.
         break;
   }
   return(TRUE);
}


///////////////////////////////////////////////////////////////////////////////


BOOL WINAPI SetDIPSHook(DWORD dwThreadId) {

   BOOL bOk = FALSE;
   
   if (dwThreadId != 0) {
      // Make sure that the hook is not already installed.
      chASSERT(g_hHook == NULL);

      // Save our thread ID in a shared variable so that our GetMsgProc 
      // function can post a message back to the thread when the server 
      // window has been created.
      g_dwThreadIdDIPS = GetCurrentThreadId();

      // Install the hook on the specified thread
      g_hHook = SetWindowsHookEx(WH_GETMESSAGE, GetMsgProc, g_hInstDll, 
         dwThreadId);

      bOk = (g_hHook != NULL);
      if (bOk) {
         // The hook was installed successfully; force a benign message to 
         // the thread's queue so that the hook function gets called.
         bOk = PostThreadMessage(dwThreadId, WM_NULL, 0, 0);
      }
   } else {

      // Make sure that a hook has been installed.
      chASSERT(g_hHook != NULL);
      bOk = UnhookWindowsHookEx(g_hHook);
      g_hHook = NULL;
   }

   return(bOk);
}


///////////////////////////////////////////////////////////////////////////////


LRESULT WINAPI GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam) {

   static BOOL bFirstTime = TRUE;

   if (bFirstTime) {
      // The DLL just got injected.
      bFirstTime = FALSE;

      // Uncomment the line below to invoke the debugger 
      // on the process that just got the injected DLL.
      // ForceDebugBreak();

      // Create the DIPS Server window to handle the client request.
      CreateDialog(g_hInstDll, MAKEINTRESOURCE(IDD_DIPS), NULL, Dlg_Proc);

      // Tell the DIPS application that the server is up 
      // and ready to handle requests.
      PostThreadMessage(g_dwThreadIdDIPS, WM_NULL, 0, 0);
   }

   return(CallNextHookEx(g_hHook, nCode, wParam, lParam));
}


///////////////////////////////////////////////////////////////////////////////


void Dlg_OnClose(HWND hWnd) {

   DestroyWindow(hWnd);
}


///////////////////////////////////////////////////////////////////////////////


static const TCHAR g_szRegSubKey[] = 
   TEXT("Software\\Wintellect\\Desktop Item Position Saver");


///////////////////////////////////////////////////////////////////////////////


void SaveListViewItemPositions(HWND hWndLV) {

   int nMaxItems = ListView_GetItemCount(hWndLV);

   // When saving new positions, delete the old position 
   // information that is currently in the registry.
   LONG l = RegDeleteKey(HKEY_CURRENT_USER, g_szRegSubKey);

   // Create the registry key to hold the info
   HKEY hkey;
   l = RegCreateKeyEx(HKEY_CURRENT_USER, g_szRegSubKey, 0, NULL, 
      REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hkey, NULL);
   chASSERT(l == ERROR_SUCCESS);

   for (int nItem = 0; nItem < nMaxItems; nItem++) {

      // Get the name and position of a ListView item.
      TCHAR szName[MAX_PATH];
      ListView_GetItemText(hWndLV, nItem, 0, szName, _countof(szName));

      POINT pt;
      ListView_GetItemPosition(hWndLV, nItem, &pt);

      // Save the name and position in the registry.
      l = RegSetValueEx(hkey, szName, 0, REG_BINARY, (PBYTE) &pt, sizeof(pt));
      chASSERT(l == ERROR_SUCCESS);
   }
   RegCloseKey(hkey);
}


///////////////////////////////////////////////////////////////////////////////


void RestoreListViewItemPositions(HWND hWndLV) {

   HKEY hkey;
   LONG l = RegOpenKeyEx(HKEY_CURRENT_USER, g_szRegSubKey,
      0, KEY_QUERY_VALUE, &hkey);
   if (l == ERROR_SUCCESS) {

      // If the ListView has AutoArrange on, temporarily turn it off.
      DWORD dwStyle = GetWindowStyle(hWndLV);
      if (dwStyle & LVS_AUTOARRANGE) 
         SetWindowLong(hWndLV, GWL_STYLE, dwStyle & ~LVS_AUTOARRANGE);

      l = NO_ERROR;
      for (int nIndex = 0; l != ERROR_NO_MORE_ITEMS; nIndex++) {
         TCHAR szName[MAX_PATH];
         DWORD cbValueName = _countof(szName);

         POINT pt;
         DWORD cbData = sizeof(pt), nItem;

         // Read a value name and position from the registry.
         DWORD dwType;
         l = RegEnumValue(hkey, nIndex, szName, &cbValueName, 
            NULL, &dwType, (PBYTE) &pt, &cbData);

         if (l == ERROR_NO_MORE_ITEMS) 
            continue;

         if ((dwType == REG_BINARY) && (cbData == sizeof(pt))) {
            // The value is something that we recognize; try to find
            // an item in the ListView control that matches the name.
            LV_FINDINFO lvfi;
            lvfi.flags = LVFI_STRING; 
            lvfi.psz = szName; 
            nItem = ListView_FindItem(hWndLV, -1, &lvfi);
            if (nItem != -1) {
               // We found a match; change the item's position.
               ListView_SetItemPosition(hWndLV, nItem, pt.x, pt.y);	
            }
         }
      }
      // Turn AutoArrange back on if it was originally on.
      SetWindowLong(hWndLV, GWL_STYLE, dwStyle);
      RegCloseKey(hkey);
   }
}


///////////////////////////////////////////////////////////////////////////////


INT_PTR WINAPI Dlg_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {

   switch (uMsg) {
      chHANDLE_DLGMSG(hWnd, WM_CLOSE, Dlg_OnClose);

      case WM_APP:
         // Uncomment the line below to invoke the debugger 
         // on the process that just got the injected DLL.
         // ForceDebugBreak();

         if (lParam) 
            SaveListViewItemPositions((HWND) wParam);
         else 
            RestoreListViewItemPositions((HWND) wParam);
         break;
   }

   return(FALSE);
}



//////////////////////////////// End of File //////////////////////////////////

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩色一区| 中文无字幕一区二区三区| 精品国产乱子伦一区| 欧美激情一区三区| 蜜臀久久久99精品久久久久久| 成人精品免费视频| 日韩免费视频一区| 亚洲成人综合网站| 91捆绑美女网站| 日本一区二区久久| 精品午夜久久福利影院| 欧美日韩成人在线| 亚洲激情自拍视频| 91香蕉视频污| 成人免费小视频| 成人美女在线观看| 久久久精品tv| 中文无字幕一区二区三区| 免费看日韩精品| 91麻豆精品国产自产在线| 亚洲精品中文在线| 99视频有精品| 亚洲欧美二区三区| 色爱区综合激月婷婷| 日韩美女精品在线| 91美女片黄在线观看91美女| 综合久久一区二区三区| 色综合天天在线| 亚洲女同女同女同女同女同69| 99久久精品费精品国产一区二区| 国产精品久久久久影院老司| av电影在线观看一区| 亚洲欧美日韩人成在线播放| 成人深夜在线观看| 中文字幕在线不卡国产视频| 91在线一区二区三区| 亚洲人123区| 欧美精品自拍偷拍动漫精品| 国产精品乱人伦中文| 久久精品人人爽人人爽| 看电影不卡的网站| 久久一区二区三区四区| 丁香另类激情小说| 亚洲视频在线一区二区| 欧美在线免费播放| 日韩二区三区四区| 久久亚洲精品小早川怜子| 成人动漫在线一区| 亚洲高清中文字幕| 精品成人一区二区三区| 不卡视频一二三四| 午夜免费欧美电影| 久久久精品黄色| 色综合久久综合网| 奇米一区二区三区| 日本一区二区动态图| 91福利视频网站| 久久97超碰色| 亚洲少妇最新在线视频| 7777精品伊人久久久大香线蕉完整版| 经典一区二区三区| 亚洲精选视频免费看| 欧美一区二区三区播放老司机| 国产传媒久久文化传媒| 亚洲二区在线观看| 国产亚洲欧美中文| 欧美嫩在线观看| 国产精品中文字幕日韩精品| 亚洲美女一区二区三区| 欧美草草影院在线视频| 91视频在线观看免费| 美女视频黄久久| 亚洲精品一卡二卡| 国产亚洲欧洲997久久综合| 欧美性大战久久| 成人av网站在线观看免费| 亚洲国产日韩一区二区| 欧美激情艳妇裸体舞| 日韩一区二区三区在线| 色综合久久久久综合体| 国产成人在线色| 免费高清在线一区| 依依成人综合视频| 国产亚洲一区二区三区四区 | 国内外成人在线| 一区二区欧美在线观看| 国产欧美一区二区三区鸳鸯浴| 欧美一区二区三区视频在线观看| 91伊人久久大香线蕉| 国产精品18久久久久| 日本欧美一区二区在线观看| 亚洲一区二区在线观看视频| 国产精品伦一区| 久久精品人人做| 精品剧情v国产在线观看在线| 欧美久久久久久久久| 精品视频在线免费观看| 91一区二区三区在线观看| 高潮精品一区videoshd| 韩国av一区二区| 国产一区二区三区免费观看| 美腿丝袜在线亚洲一区| 日本不卡免费在线视频| 三级欧美在线一区| 亚洲成av人**亚洲成av**| 亚洲综合色网站| 亚洲综合一区二区| 亚洲午夜免费视频| 亚洲成人一二三| 亚洲电影第三页| 午夜成人在线视频| 午夜欧美视频在线观看| 视频一区欧美精品| 日韩va欧美va亚洲va久久| 奇米综合一区二区三区精品视频| 日本亚洲电影天堂| 久久99九九99精品| 国产福利91精品一区二区三区| 国产成人综合亚洲网站| av激情成人网| 在线观看www91| 777色狠狠一区二区三区| 欧美成人精品福利| 26uuu精品一区二区在线观看| 精品福利视频一区二区三区| 亚洲国产精品t66y| 亚洲精品视频一区二区| 亚洲成人综合视频| 久久成人18免费观看| 国产99久久久国产精品免费看| 99久久伊人精品| 欧美日韩精品一区二区天天拍小说 | 一本大道久久a久久综合| 91麻豆免费视频| 欧美群妇大交群中文字幕| 欧美精品色一区二区三区| 精品国产伦一区二区三区观看体验| 久久久www成人免费毛片麻豆| 自拍偷自拍亚洲精品播放| 亚洲成人av一区| 国产老肥熟一区二区三区| 91在线播放网址| 欧美一区二区三区思思人| 国产三级一区二区三区| 一区二区国产视频| 久久精品国产澳门| 东方aⅴ免费观看久久av| 色94色欧美sute亚洲线路一ni| 欧美一级日韩免费不卡| 一区精品在线播放| 日本va欧美va瓶| 99热精品一区二区| 欧美一级电影网站| 亚洲少妇最新在线视频| 麻豆精品在线观看| 99久久免费精品| 亚洲精品在线免费观看视频| 亚洲精品久久久蜜桃| 国产一区二区三区电影在线观看| 一本一道久久a久久精品 | 日韩欧美在线一区二区三区| 日本一区二区免费在线| 五月天丁香久久| 色综合久久99| 国产欧美一区视频| 卡一卡二国产精品| 在线观看国产91| 国产精品久久久久久户外露出| 日韩不卡一二三区| 91国偷自产一区二区开放时间 | 国产日产欧产精品推荐色| 日日夜夜免费精品视频| av高清不卡在线| 中文一区在线播放| 久久精品国产色蜜蜜麻豆| 欧美性猛交xxxxxx富婆| 中国色在线观看另类| 国产精品资源网| 日韩欧美二区三区| 午夜精品在线视频一区| 色综合久久久久| 综合久久久久久| 成人动漫在线一区| 国产精品麻豆欧美日韩ww| 老色鬼精品视频在线观看播放| 欧美日韩中字一区| 亚洲一区二区综合| 色94色欧美sute亚洲线路一ni| ...av二区三区久久精品| 成人午夜又粗又硬又大| 久久久91精品国产一区二区精品 | 美国毛片一区二区| 欧美一区二区三区视频免费播放 | 日本欧美一区二区在线观看| 欧美群妇大交群的观看方式| 亚洲国产综合色| 欧美精品丝袜中出| 日本 国产 欧美色综合| 欧美tk—视频vk| 国产精品伊人色|