青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

我住包子山

this->blog.MoveTo("blog.baozishan.in")

SubclassWindow 一個函數,其實是個宏

#define     SubclassWindow(hwnd, lpfn)       \
              ((WNDPROC)SetWindowLongPtr((hwnd), GWLP_WNDPROC, (LPARAM)(WNDPROC)(lpfn)))

這個宏是我看第七章winshellprograming看到的,很強大的功能,例子是用FindWindowEx找到windows開始按鈕的窗口句柄,之后用該宏加入開始按鈕的消息處理函數.總之還不錯,winshell還真不是一般..
MSDN上查SubclassWindow都不是我要的這個,雖然功能大體相同吧.
下面這個就是SetWindowLongPtr函數:
SetWindowLongPtr Function

The SetWindowLongPtr function changes an attribute of the specified window. The function also sets a value at the specified offset in the extra window memory.

這個函數改變一個指定窗口的一個屬性.它也可設定窗口儲存區指定偏移位置的值。

This function supersedes the SetWindowLong function. To write code that is compatible with both 32-bit and 64-bit versions of Microsoft Windows, use SetWindowLongPtr.
這個函數取代了SetWindowLong函數,為了兼容32位64位windows os,就用這個函數吧 .

Syntax

LONG_PTR SetWindowLongPtr(      
    HWND hWnd,
    int nIndex,
    LONG_PTR dwNewLong
);

Parameters

hWnd
[in] Handle to the window and, indirectly, the class to which the window belongs. The SetWindowLongPtr function fails if the process that owns the window specified by the hWnd parameter is at a higher process privilege in the User Interface Privilege Isolation (UIPI) hierarchy than the process the calling thread resides in.
返回fail當擁有指定窗口的京城比用戶UI權限隔絕(??)高的時候..不知道翻譯對不

Microsoft Windows XP and earlier: The SetWindowLongPtr function fails if the window specified by the hWnd parameter does not belong to the same process as the calling thread.

這個意思大概是函數失敗如果調用進程傳入的hWnd句柄不屬于調用包含這個函數的線程的進程(應用程序).

nIndex
[in] Specifies the zero-based offset to the value to be set. Valid values are in the range zero through the number of bytes of extra window memory, minus the size of an integer. To set any other value, specify one of the following values.
這個不用翻譯了,很明了哈哈
GWL_EXSTYLE
Sets a new extended window style. For more information, see CreateWindowEx.
GWL_STYLE
Sets a new window style.
GWLP_WNDPROC
Sets a new address for the window procedure.
GWLP_HINSTANCE
Sets a new application instance handle.
GWLP_ID
Sets a new identifier of the window.
GWLP_USERDATA
Sets the user data associated with the window. This data is intended for use by the application that created the window. Its value is initially zero.
The following values are also available when the hWnd parameter identifies a dialog box.
DWLP_DLGPROC
Sets the new pointer to the dialog box procedure.
DWLP_MSGRESULT
Sets the return value of a message processed in the dialog box procedure.
DWLP_USER
Sets new extra information that is private to the application, such as handles or pointers.
dwNewLong
[in] Specifies the replacement value.

Return Value

If the function succeeds, the return value is the previous value of the specified offset.
成功返回的是設置前的值LONG_PTR這個類型

If the function fails, the return value is zero. To get extended error information, call GetLastError.

If the previous value is zero and the function succeeds, the return value is zero, but the function does not clear the last error information. To determine success or failure, clear the last error information by calling SetLastError(0), then call SetWindowLongPtr. Function failure will be indicated by a return value of zero and a GetLastError result that is nonzero.


Remarks

Certain window data is cached, so changes you make using SetWindowLongPtr will not take effect until you call the SetWindowPos function.

If you use SetWindowLongPtr with the GWLP_WNDPROC index to replace the window procedure, the window procedure must conform to the guidelines specified in the description of the WindowProc callback function.

If you use SetWindowLongPtr with the DWLP_MSGRESULT index to set the return value for a message processed by a dialog box procedure, the dialog box procedure should return TRUE directly afterward. Otherwise, if you call any function that results in your dialog box procedure receiving a window message, the nested window message could overwrite the return value you set by using DWLP_MSGRESULT.

Calling SetWindowLongPtr with the GWLP_WNDPROC index creates a subclass of the window class used to create the window. An application can subclass a system class, but should not subclass a window class created by another process. The SetWindowLongPtr function creates the window subclass by changing the window procedure associated with a particular window class, causing the system to call the new window procedure instead of the previous one. An application must pass any messages not processed by the new window procedure to the previous window procedure by calling CallWindowProc. This allows the application to create a chain of window procedures.

Reserve extra window memory by specifying a nonzero value in the cbWndExtra member of the WNDCLASSEX structure used with the RegisterClassEx function.

Do not call SetWindowLongPtr with the GWLP_HWNDPARENT index to change the parent of a child window. Instead, use the SetParent function.

If the window has a class style of CS_CLASSDC or CS_PARENTDC, do not set the extended window styles WS_EX_COMPOSITED or WS_EX_LAYERED.

Windows XP/Vista: Calling SetWindowLongPtr to set the style on a progressbar will reset its position.

Function Information



先到這里,以后會寫更多Win32的基礎知識,當我學到的時候..

btw,有本叫the old new thing 似乎很強,不知道什么時候能有一本...

posted on 2007-06-03 00:26 Gohan 閱讀(4195) 評論(2)  編輯 收藏 引用 所屬分類: MFC/SDK

Feedback

# re: SubclassWindow 一個函數,其實是個宏 2008-06-27 18:39 hoodlum1980

你怎么翻譯的啊!
Extra Window Memory,是窗口類里面的一個成員,表示給每個窗口保留分配的一塊內存的地址。換句話說,它是一個具體窗口自己獨占的一個存儲區。

再有:
Extra Class Memory:是屬于窗口類的內存,所有屬于該類窗口的共享數據。

另外你的hwnd參數的解釋,我用的vs.net2003的文檔,和你的不一樣,我看到的msdn上說的是,如果這個窗口不屬于調用該函數的線程,則該函數會失敗。  回復  更多評論   

# re: SubclassWindow 一個函數,其實是個宏 2008-06-27 23:23 Gohan

@hoodlum1980
謝謝大哥你的指點,已經根據你的回復改正了翻譯,有任何問題歡迎指出。小弟還是初學,向大哥學習了。  回復  更多評論   

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            精品999成人| 国产日韩综合一区二区性色av| 国自产拍偷拍福利精品免费一| 午夜精品一区二区在线观看| 亚洲深夜福利| 国产综合色产| 欧美成人日韩| 欧美日韩一区二| 亚洲欧美日韩在线观看a三区| 中文av字幕一区| 国产亚洲激情视频在线| 免费精品视频| 欧美日韩一区二区三| 久久激情综合网| 美女视频黄a大片欧美| 99国产精品久久久| 亚洲欧美日韩一区二区三区在线观看 | 欧美激情一区二区久久久| 亚洲精品在线一区二区| av成人免费| 国内外成人在线| 亚洲人成人77777线观看| 国产精品xxxav免费视频| 久久综合五月| 欧美日韩精品免费看| 久久久精彩视频| 欧美激情一二区| 久久人人爽人人| 欧美日韩在线免费| 久久婷婷激情| 国产精品福利网| 欧美黑人多人双交| 国产精品专区h在线观看| 亚洲福利视频网| 国产一区美女| 亚洲天天影视| 亚洲精选国产| 久久久97精品| 欧美一区午夜视频在线观看| 欧美韩日视频| 免费成人av| 国内自拍视频一区二区三区| 一本一本久久| 日韩视频一区二区三区在线播放免费观看 | 国产一区日韩二区欧美三区| 91久久精品视频| 亚洲国产欧美国产综合一区| 香蕉尹人综合在线观看| 午夜精品国产更新| 欧美日韩另类视频| 亚洲人成在线观看| 亚洲欧洲在线观看| 久久伊人一区二区| 久久夜色精品| 国语自产精品视频在线看抢先版结局| 亚洲视频免费在线观看| 亚洲图片欧洲图片av| 欧美日本一区| 亚洲人午夜精品| 亚洲精品中文字幕女同| 免费在线欧美视频| 亚洲福利在线观看| 亚洲精品日韩一| 欧美成人a∨高清免费观看| 欧美成人精品一区二区| 亚洲国产成人久久综合一区| 久久久久久噜噜噜久久久精品| 久久久国产91| 伊人久久亚洲美女图片| 久久只有精品| 亚洲国产一区在线观看| 99国产精品国产精品久久| 欧美日韩国产91| 宅男噜噜噜66国产日韩在线观看| 亚洲一区免费网站| 国产精品性做久久久久久| 翔田千里一区二区| 欧美va天堂在线| 99视频一区二区| 国产精品久久久久久户外露出| 亚洲影视九九影院在线观看| 久久婷婷成人综合色| 亚洲黄色影片| 欧美午夜免费电影| 久久av一区二区| 亚洲国产一二三| 亚洲欧美国产三级| 精品va天堂亚洲国产| 欧美激情女人20p| 亚洲资源在线观看| 欧美韩国一区| 亚洲欧美国产日韩天堂区| 狠久久av成人天堂| 欧美日韩免费一区二区三区视频 | 亚洲靠逼com| 午夜日韩激情| 亚洲人精品午夜在线观看| 国产精品久久久久久久久免费桃花| 欧美一区二区久久久| 亚洲人成亚洲人成在线观看| 欧美影院成人| 日韩视频一区二区三区| 国产一区日韩二区欧美三区| 欧美日韩国产精品自在自线| 久久国产精品99精品国产| 亚洲伦理在线| 美女爽到呻吟久久久久| 亚洲综合不卡| 亚洲久久一区| 狠狠色伊人亚洲综合成人| 欧美小视频在线观看| 另类天堂av| 久久国产福利国产秒拍| 一本一本久久a久久精品综合妖精| 久久免费视频在线观看| 亚洲一区在线直播| 日韩天天综合| 18成人免费观看视频| 国产精品一区二区久久久| 欧美精品v日韩精品v国产精品| 欧美在线啊v一区| 日韩视频国产视频| 亚洲国产欧美在线| 欧美va亚洲va国产综合| 久久天天躁狠狠躁夜夜av| 亚洲欧美日韩国产精品| 一区二区冒白浆视频| 亚洲国内欧美| 亚洲国产99| 影音先锋久久精品| 狠狠干综合网| 狠狠色伊人亚洲综合成人| 国产欧美日韩亚洲| 国产精品色婷婷久久58| 国产精品久久久久久久久借妻| 欧美另类变人与禽xxxxx| 欧美黄色aa电影| 欧美国产综合一区二区| 欧美激情亚洲精品| 欧美日韩三区| 国产精品h在线观看| 欧美视频不卡中文| 国产精品久久久久久一区二区三区| 欧美日韩国产欧| 国产精品高清在线| 国产乱人伦精品一区二区| 国产精品系列在线| 韩国精品久久久999| 尤物九九久久国产精品的分类| 狠狠色噜噜狠狠色综合久| 亚洲成人原创| 日韩视频三区| 亚洲免费网站| 久久久99久久精品女同性| 久久综合色播五月| 亚洲丁香婷深爱综合| 亚洲精品一区二区三区av| 一本色道久久88综合日韩精品| 亚洲一区中文字幕在线观看| 性久久久久久| 欧美jizz19性欧美| 欧美视频三区在线播放| 国产精品萝li| 亚洲国产高清自拍| 亚洲午夜羞羞片| 久久精品72免费观看| 母乳一区在线观看| 99在线精品免费视频九九视| 午夜精品999| 欧美a级片网| 国产精品免费看片| 尤物精品国产第一福利三区| 中国成人在线视频| 久久久久国产一区二区三区| 亚洲高清影视| 亚洲欧美国产77777| 免费观看亚洲视频大全| 国产精品入口66mio| 最近中文字幕日韩精品| 亚洲欧美卡通另类91av| 欧美高清视频在线观看| 亚洲一区二区三区四区五区黄| 久久男人av资源网站| 国产精品国产三级国产a| 在线观看日韩精品| 欧美一级视频免费在线观看| 欧美国产综合| 欧美一区二区成人| 欧美性大战久久久久久久| 亚洲成色精品| 久久久www成人免费精品| 亚洲精品日韩激情在线电影 | 亚洲在线播放| 欧美看片网站| 亚洲国产精品成人综合| 欧美与黑人午夜性猛交久久久| 亚洲三级电影全部在线观看高清| 欧美在线|欧美| 国产精品人人做人人爽| 一区二区三区视频在线播放|