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

我住包子山

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 閱讀(4208) 評論(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>
            亚洲国产精品成人va在线观看| 亚洲影院一区| 亚洲无限av看| 国产一区三区三区| 亚洲国产福利在线| 国产精品超碰97尤物18| 久久精彩免费视频| 欧美高清免费| 亚洲欧美一区二区三区极速播放| 欧美一区视频| 一本综合久久| 久久成人精品视频| 亚洲色无码播放| 久久久国产91| 亚洲欧美日韩国产综合精品二区| 久久久精品久久久久| 亚洲一区国产视频| 欧美aa在线视频| 久久久久一区二区| 国产精品国产三级国产aⅴ浪潮 | 亚洲视频狠狠| 亚洲高清中文字幕| 亚洲欧美日韩中文视频| aa国产精品| 久久综合九色| 久久亚洲视频| 国产婷婷色一区二区三区| 一区二区三区精品国产| 亚洲韩国青草视频| 欧美一级片一区| 午夜在线成人av| 欧美日韩中文字幕日韩欧美| 亚洲国产成人tv| 精品av久久久久电影| 亚洲欧美日韩一区二区| 亚洲一区二区免费看| 欧美激情视频免费观看| 欧美成在线观看| 在线播放中文字幕一区| 欧美永久精品| 久久久国产一区二区| 国产欧美亚洲视频| 午夜精品久久久| 欧美一区二区| 国产欧美日韩三区| 午夜天堂精品久久久久| 亚洲欧美日产图| 欧美视频在线一区二区三区| 亚洲精选在线观看| 亚洲视频中文| 欧美人与性动交a欧美精品| 亚洲国产美女| 亚洲精品一区二区三区婷婷月| 久久先锋影音| 国产一区二区三区高清播放| 午夜欧美精品| 久久琪琪电影院| 韩曰欧美视频免费观看| 久久久久久9| 欧美国产精品久久| 亚洲伦理网站| 国产精品hd| 亚洲欧美日韩国产成人精品影院| 欧美一区二区精品在线| 国产一区二区三区在线观看免费视频 | 夜夜嗨av一区二区三区免费区| 99在线视频精品| 欧美午夜精品久久久久久超碰| 一区二区三区精品在线| 欧美一区不卡| 1024日韩| 欧美日韩一区国产| 亚洲男人的天堂在线aⅴ视频| 久久精品女人| 亚洲激情另类| 国产精品毛片大码女人 | 亚洲一区二区三区在线| 国产精品一区在线观看你懂的| 性欧美video另类hd性玩具| 久久午夜精品一区二区| 亚洲精品午夜精品| 国产精品久久毛片a| 久久狠狠一本精品综合网| 亚洲国产精品激情在线观看| 亚洲无人区一区| 国精品一区二区| 欧美伦理a级免费电影| 亚洲欧美日韩精品综合在线观看| 久久在线免费观看| 亚洲视频一区二区免费在线观看| 国产精品尤物福利片在线观看| 久久亚洲国产成人| 一本色道久久综合狠狠躁篇的优点 | 一区二区三区你懂的| 久久久久久久尹人综合网亚洲 | 久久久999国产| 99精品欧美一区二区三区综合在线 | 亚洲女同性videos| 亚洲国产aⅴ天堂久久| 欧美亚洲系列| 亚洲精品系列| 精品成人一区二区| 国产精品久久97| 美日韩在线观看| 欧美一级久久久| 一区二区三区国产| 亚洲黄色片网站| 久久综合九色综合久99| 亚洲图片欧洲图片日韩av| 欧美国产精品人人做人人爱| 亚洲欧美日韩天堂一区二区| 亚洲欧洲在线看| 老司机久久99久久精品播放免费 | 欧美成人dvd在线视频| 欧美亚洲免费高清在线观看| 99re66热这里只有精品4| 蜜臀va亚洲va欧美va天堂 | 国产精品第一页第二页第三页| 玖玖国产精品视频| 久久se精品一区二区| 亚洲欧美国产精品va在线观看| 91久久亚洲| 亚洲高清久久网| 女同性一区二区三区人了人一| 久久国产精品毛片| 欧美亚洲在线视频| 欧美一级片在线播放| 亚洲一区二三| 亚洲在线播放| 午夜精品短视频| 午夜亚洲福利在线老司机| 亚洲视频狠狠| 亚洲无限av看| 亚洲永久免费精品| 亚洲自拍偷拍福利| 午夜在线电影亚洲一区| 欧美伊久线香蕉线新在线| 亚洲自啪免费| 欧美一区二区三区免费看| 欧美在线观看视频| 久久成人精品一区二区三区| 欧美在线电影| 久久久夜精品| 欧美ed2k| 亚洲黄一区二区三区| 亚洲六月丁香色婷婷综合久久| 亚洲国产精品尤物yw在线观看 | 在线看国产日韩| 亚洲国产成人av好男人在线观看| 亚洲国产精品va| 亚洲国产激情| 一区二区激情视频| 午夜久久久久久| 久久天堂国产精品| 欧美高清一区二区| 亚洲精品在线电影| 亚洲男人第一网站| 久久久精品动漫| 欧美成人精品三级在线观看| 欧美另类一区二区三区| 国产精品乱人伦中文| 国产亚洲精品激情久久| **网站欧美大片在线观看| 亚洲精品一区二区网址 | 你懂的国产精品| 欧美日韩岛国| 国产欧美视频一区二区三区| 娇妻被交换粗又大又硬视频欧美| 亚洲国产精彩中文乱码av在线播放| 亚洲美女中文字幕| 欧美亚洲系列| 亚洲高清毛片| 亚洲伊人网站| 老司机67194精品线观看| 欧美日韩亚洲国产精品| 国产视频一区二区三区在线观看| 亚洲成在线观看| 亚洲一区二区三区乱码aⅴ| 久久精品国内一区二区三区| 亚洲电影有码| 亚洲欧美日本日韩| 欧美大片第1页| 国产欧美一区二区三区久久 | 亚洲欧美一区二区三区久久| 午夜精品视频| 老巨人导航500精品| 欧美午夜在线| 亚洲黑丝在线| 久久成人精品一区二区三区| 亚洲韩国日本中文字幕| 欧美一区二区三区视频| 欧美日韩视频在线观看一区二区三区 | 亚洲精品国偷自产在线99热| 亚洲欧美视频在线| 欧美二区视频| 欧美一区二区啪啪| 欧美午夜免费电影| 亚洲激情电影中文字幕| 久久久久久伊人| 亚洲午夜激情|