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

我住包子山

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 閱讀(4212) 評論(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>
            暖暖成人免费视频| 久久久久久婷| 欧美偷拍另类| 亚洲手机在线| 日韩视频一区二区三区在线播放| 欧美高清hd18日本| 一区二区免费在线播放| av不卡在线观看| 国产精品久久久| 欧美一区二区三区免费视频| 午夜宅男欧美| 亚洲黄色av| 日韩视频免费在线| 国产欧美亚洲精品| 母乳一区在线观看| 欧美日本成人| 欧美在线视频日韩| 老司机午夜免费精品视频| 亚洲精选国产| 亚洲欧美激情一区二区| 影音先锋一区| 艳妇臀荡乳欲伦亚洲一区| 国产日韩欧美综合一区| 欧美aa在线视频| 国产精品jizz在线观看美国| 久久高清免费观看| 欧美大胆成人| 欧美中文字幕第一页| 久久中文字幕导航| 亚洲永久视频| 久久久一区二区| 亚洲免费影视第一页| 久久久久免费观看| 亚洲欧美春色| 欧美成人午夜激情在线| 欧美一区二区三区四区高清| 蜜臀91精品一区二区三区| 亚洲欧美在线高清| 欧美国产日韩在线| 久久久午夜电影| 欧美三级网页| 亚洲国产黄色片| 国产手机视频精品| 99riav1国产精品视频| 一色屋精品亚洲香蕉网站| 一个人看的www久久| 亚洲国产精品va| 欧美一区二区三区久久精品 | 亚洲美女在线看| 精品成人在线观看| 亚洲午夜精品久久久久久app| 亚洲国产成人久久综合一区| 午夜精品久久久久久久男人的天堂 | 欧美亚洲在线播放| 亚洲一级二级| 欧美激情一区二区三区蜜桃视频| 久久噜噜亚洲综合| 国产精品综合网站| 这里只有精品视频在线| 夜夜嗨av一区二区三区四区 | 一区二区三区四区国产| 亚洲人精品午夜| 噜噜爱69成人精品| 老司机免费视频久久| 国产一区二区精品久久99| 亚洲一区二区三区精品动漫| 中文精品视频| 欧美视频在线播放| 99视频精品| 亚洲女ⅴideoshd黑人| 欧美日韩国产经典色站一区二区三区| 久久亚洲精品欧美| 一色屋精品视频在线观看网站| 午夜视频在线观看一区二区三区| 亚洲自拍偷拍网址| 国产精品视频免费观看www| 亚洲一区二区视频在线| 欧美一区二区黄| 国产亚洲欧美一区二区| 久久riav二区三区| 毛片一区二区| 亚洲人成高清| 欧美日韩一区二区免费在线观看 | 午夜亚洲伦理| 国产亚洲一区在线播放| 久久精品国产亚洲一区二区三区| 久久这里只有| 亚洲精品日韩精品| 欧美日韩一区精品| 亚洲欧美成人在线| 欧美不卡在线视频| 在线视频亚洲欧美| 国产精品一区二区男女羞羞无遮挡| 99re6这里只有精品| 欧美中文字幕视频| 亚洲黄色影片| 欧美天天视频| 久久久国际精品| 亚洲日韩成人| 久久国产手机看片| 91久久夜色精品国产网站| 欧美视频在线观看 亚洲欧| 午夜一级久久| 亚洲日韩欧美视频一区| 欧美亚洲一区二区在线| 亚洲激情另类| 国产精品红桃| 欧美成人精品三级在线观看| 亚洲私人黄色宅男| 欧美顶级艳妇交换群宴| 午夜精品亚洲一区二区三区嫩草| 在线观看日韩www视频免费| 欧美日韩精品在线播放| 久久精品二区| 亚洲图片自拍偷拍| 亚洲电影免费观看高清完整版在线| 亚洲欧美日韩国产一区| 亚洲激情视频在线| 国产亚洲成人一区| 欧美日韩一二三四五区| 美日韩免费视频| 欧美一区三区三区高中清蜜桃| 亚洲人成网在线播放| 另类亚洲自拍| 久久成人av少妇免费| 国产精品99久久久久久久久| 1769国内精品视频在线播放| 国产日韩欧美中文| 欧美午夜一区二区三区免费大片| 另类图片国产| 久久精品麻豆| 欧美一区精品| 亚洲欧美日本另类| 亚洲天堂激情| 一本久道久久综合狠狠爱| 亚洲高清影视| 欧美福利网址| 蜜臀a∨国产成人精品| 久久精品二区| 久久精品中文字幕免费mv| 午夜精品影院| 亚洲欧美一区二区三区在线| 亚洲午夜久久久久久久久电影网| 亚洲精品在线免费观看视频| 在线成人激情黄色| 亚洲国产成人tv| 亚洲电影在线看| 亚洲国产人成综合网站| 亚洲电影免费在线观看| 1000部国产精品成人观看| 1024成人网色www| 91久久精品一区二区别| 亚洲激情欧美| 一本久久综合亚洲鲁鲁五月天| 亚洲精品视频二区| 在线亚洲高清视频| 亚洲在线1234| 欧美在线观看视频一区二区三区| 欧美一区二区成人6969| 久久精品久久99精品久久| 久久视频一区二区| 欧美激情免费在线| 亚洲乱码国产乱码精品精天堂| 日韩视频在线观看国产| 亚洲天堂视频在线观看| 欧美一区免费视频| 嫩草伊人久久精品少妇av杨幂| 欧美美女bbbb| 欧美国产精品va在线观看| 亚洲精品国产精品乱码不99| 91久久久国产精品| 一区二区三区日韩欧美精品| 亚洲永久精品国产| 久久精品一区二区三区中文字幕 | 欧美黄色日本| 日韩视频一区二区三区| 亚洲免费一在线| 久久精品视频在线| 欧美精品一区二区精品网 | 美女黄网久久| 欧美日韩三级在线| 国产在线视频不卡二| 最新69国产成人精品视频免费 | 国产农村妇女精品| 影音先锋在线一区| 亚洲性视频网址| 久久综合网络一区二区| 日韩视频久久| 久久亚洲精品伦理| 国产精品久久久久免费a∨大胸| 伊人激情综合| 午夜精品一区二区三区在线视 | 欧美在线观看视频在线| 欧美成人国产| 亚洲欧美一级二级三级| 欧美片网站免费| 精品成人久久| 欧美在线free| 日韩一二三区视频| 麻豆精品网站|