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

我住包子山

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>
            久久久久久久国产| 欧美人成网站| 韩国成人理伦片免费播放| 久久av红桃一区二区小说| 亚洲欧美日韩直播| 国产真实乱子伦精品视频| 久久精品夜色噜噜亚洲a∨| 欧美中文字幕视频在线观看| 国产精品亚洲一区| 久久看片网站| 猫咪成人在线观看| 日韩一级视频免费观看在线| 宅男噜噜噜66国产日韩在线观看| 国产精品久久久免费| 久久久久9999亚洲精品| 久久亚洲欧美国产精品乐播| 亚洲区欧美区| 亚洲视频在线视频| 一区二区视频在线观看| 亚洲国产老妈| 国产精品国产三级国产aⅴ无密码| 欧美在线黄色| 蜜臀91精品一区二区三区| 中文亚洲欧美| 久久久久一区二区| 亚洲天堂网在线观看| 久久久久久国产精品mv| aaa亚洲精品一二三区| 午夜久久99| 99re6热只有精品免费观看| 午夜欧美视频| 一本色道久久综合狠狠躁篇怎么玩 | 国产欧美视频一区二区三区| 美女成人午夜| 国产精品www.| 亚洲国产精品123| 国产精品制服诱惑| 亚洲国产欧美在线| 国内精品亚洲| 亚洲一区二区免费在线| 亚洲破处大片| 久久国产精品久久久久久| 一区二区三区.www| 久久综合九色综合欧美狠狠| 欧美亚洲日本一区| 欧美日韩激情网| 欧美成人精品一区二区| 国产视频一区二区三区在线观看| 亚洲国产精品成人综合色在线婷婷 | 男人插女人欧美| 国产精品美女在线| 日韩视频免费| 99视频日韩| 欧美国产免费| 欧美国产日韩一区二区在线观看| 国产精品永久入口久久久| 99国产成+人+综合+亚洲欧美| 精品51国产黑色丝袜高跟鞋| 亚洲伊人网站| 午夜视频在线观看一区二区| 欧美日韩亚洲高清一区二区| 亚洲国产一区二区视频| 亚洲国产精品成人| 鲁大师影院一区二区三区| 久久男女视频| 伊人春色精品| 久久久水蜜桃| 欧美成人网在线| 亚洲高清二区| 欧美二区在线| 亚洲精美视频| 亚洲视频成人| 国产精品久久久久久影视| 在线一区欧美| 久久精品国产免费| 黄色在线一区| 免费一级欧美在线大片| 欧美激情日韩| av不卡在线观看| 欧美日韩在线免费| 亚洲无亚洲人成网站77777| 午夜精品久久久久久久男人的天堂 | 欧美顶级大胆免费视频| 亚洲国产精品久久久久婷婷884 | 欧美体内she精视频在线观看| av成人毛片| 欧美一区二区三区四区高清| 国产女人18毛片水18精品| 欧美一区二区在线免费播放| 另类激情亚洲| 99热这里只有成人精品国产| 欧美日韩亚洲国产一区| 亚洲欧美一区二区原创| 久久久噜噜噜久噜久久| 亚洲人成绝费网站色www| 欧美日韩理论| 欧美与欧洲交xxxx免费观看| 免费成人在线视频网站| 一区二区电影免费在线观看| 国产伦精品一区二区三| 久久一区欧美| 亚洲视频在线二区| 老司机午夜免费精品视频| 99精品免费网| 国产一区二区精品丝袜| 欧美精品亚洲| 欧美专区福利在线| 亚洲精品综合| 久久视频一区二区| 亚洲四色影视在线观看| 黄色资源网久久资源365| 欧美日韩大片| 久久久午夜精品| 亚洲午夜免费福利视频| 免费观看成人| 欧美在线播放一区| 中国女人久久久| 91久久精品www人人做人人爽| 国产精品久久久久久久久久妞妞| 麻豆成人综合网| 香蕉久久夜色精品国产使用方法| 91久久在线| 久久一区二区精品| 香蕉亚洲视频| 中日韩午夜理伦电影免费| 在线观看日韩一区| 国产一区二区精品| 国产精品午夜久久| 欧美日韩一区三区四区| 欧美成人精品高清在线播放| 欧美一区二区三区视频免费播放| 日韩亚洲成人av在线| 欧美激情中文字幕一区二区| 久久久久久一区二区| 欧美一区二区三区在线观看| 亚洲午夜高清视频| 日韩五码在线| 亚洲激情视频网站| 亚洲国产导航| 亚洲大片av| 亚洲第一区色| 在线免费观看欧美| 影音先锋一区| 在线不卡中文字幕| 亚洲第一区色| 亚洲人成在线观看一区二区| 1204国产成人精品视频| 激情久久久久久久久久久久久久久久| 国产精品羞羞答答xxdd| 国产精品系列在线播放| 国产精品羞羞答答| 国产色视频一区| 国内偷自视频区视频综合| 国产综合久久久久久鬼色| 国产真实精品久久二三区| 很黄很黄激情成人| 在线观看日韩av电影| 亚洲国产欧美在线人成| 亚洲精品一级| 亚洲性xxxx| 欧美中文字幕第一页| 久久精品中文| 欧美国产日韩视频| 亚洲精品一级| 亚洲一级片在线观看| 欧美影院视频| 男女激情久久| 欧美日韩在线播放三区四区| 国产精品国产一区二区| 国产日韩一区| 亚洲黑丝在线| 亚洲一区二区三区中文字幕在线| 欧美一级在线亚洲天堂| 久久夜色撩人精品| 日韩午夜在线视频| 午夜精品久久久久久99热| 狼狼综合久久久久综合网 | 久久综合九色综合久99| 欧美国产欧美综合 | 欧美精品高清视频| 国产精品卡一卡二卡三| 在线精品观看| 亚洲综合色在线| 免费影视亚洲| 在线视频精品| 美女脱光内衣内裤视频久久影院| 欧美日本视频在线| 国产在线精品自拍| 亚洲最新视频在线播放| 久久久999| 在线性视频日韩欧美| 玖玖玖国产精品| 国产精品一区二区在线| 亚洲精品在线免费观看视频| 性欧美18~19sex高清播放| 欧美大片91| 午夜精品在线看| 欧美午夜久久| 亚洲日韩第九十九页| 久久久精品2019中文字幕神马|