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

我住包子山

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>
            久久se精品一区二区| 久久九九国产| 欧美三级不卡| 亚洲一区网站| 亚洲欧美怡红院| 国产欧美日韩在线| 久久久久欧美精品| 欧美成人第一页| 亚洲图片在区色| 亚洲欧美日韩精品在线| 国产在线欧美日韩| 欧美激情视频在线免费观看 欧美视频免费一 | 亚洲自拍啪啪| 亚洲图片激情小说| 精品96久久久久久中文字幕无| 国产欧美精品日韩| 久久久福利视频| 鲁鲁狠狠狠7777一区二区| 9久re热视频在线精品| 亚洲欧美福利一区二区| 一区二区三区亚洲| 亚洲国产精品久久久久秋霞不卡| 99精品国产在热久久婷婷| 国产精品www| 久久野战av| 欧美日韩无遮挡| 久久精品国产清高在天天线| 蜜月aⅴ免费一区二区三区| 亚洲一级在线观看| 久久久水蜜桃| 香蕉精品999视频一区二区| 久久综合色播五月| 性8sex亚洲区入口| 欧美日韩国产色视频| 久久夜色精品国产亚洲aⅴ| 欧美日韩三级一区二区| 欧美aⅴ99久久黑人专区| 国产精品久久网| 亚洲欧洲一区二区在线观看| 国产欧美视频一区二区| 亚洲精品日韩欧美| 影音先锋中文字幕一区| 亚洲欧美日韩精品| 亚洲私人影院在线观看| 欧美88av| 免费欧美日韩| 国产亚洲一区二区在线观看| 夜夜夜久久久| 日韩一区二区精品在线观看| 久久久91精品国产| 久久国产视频网站| 国产精品你懂的| 日韩午夜一区| 在线视频欧美精品| 欧美日本精品| 亚洲高清视频中文字幕| 精品av久久707| 久久动漫亚洲| 久久精品导航| 国产午夜久久| 午夜在线精品| 久久精品夜色噜噜亚洲a∨| 国产精品你懂的在线| 国产伦精品一区二区三区免费| 亚洲手机视频| 欧美日韩在线免费观看| 亚洲美女中出| 在线亚洲一区观看| 欧美日韩一区二区欧美激情| 最新成人av在线| 一区二区不卡在线视频 午夜欧美不卡在 | 亚洲福利免费| 亚洲高清自拍| 欧美jizz19性欧美| 亚洲激情视频网| 亚洲少妇一区| 国产精品视频免费在线观看| 亚洲一区免费网站| 久久天天狠狠| 亚洲国产欧美日韩| 欧美精品一区二区三区视频| 日韩一级大片| 亚洲男人的天堂在线观看 | 久久综合亚洲社区| 亚洲第一天堂无码专区| 久久综合99re88久久爱| 亚洲日本一区二区三区| 99综合在线| 国产欧美69| 久久久欧美精品sm网站| 亚洲日本激情| 羞羞答答国产精品www一本| 国产又爽又黄的激情精品视频 | 亚洲综合激情| 国产一区二区激情| 欧美激情免费观看| 亚洲男女毛片无遮挡| 欧美一区二区三区视频免费播放 | 亚洲精品美女在线观看播放| 亚洲一区www| 国内外成人免费激情在线视频网站 | 99pao成人国产永久免费视频| 国产偷国产偷精品高清尤物| 久久久久久电影| 亚洲精品日韩精品| 久久免费视频网站| 一本色道久久88精品综合| 国产欧美日韩精品一区| 欧美福利视频网站| 午夜在线观看免费一区| 亚洲国内在线| 久久久综合免费视频| 中文国产一区| 伊人婷婷久久| 国产欧美日韩亚洲一区二区三区| 日韩性生活视频| 免播放器亚洲| 午夜久久tv| 一区二区欧美视频| 在线观看亚洲精品视频| 国产精品综合久久久| 免费成人激情视频| 性视频1819p久久| 日韩一级精品| 国自产拍偷拍福利精品免费一| 午夜亚洲福利在线老司机| 亚洲精品老司机| 欧美激情在线观看| 免费欧美在线| 久久综合给合久久狠狠狠97色69| 国产专区欧美专区| 国产精品久久久久久影视| 欧美精品三级在线观看| 欧美+亚洲+精品+三区| 午夜亚洲一区| 亚洲免费网站| 亚洲欧美精品中文字幕在线| 一区二区三区日韩| 99国产精品99久久久久久粉嫩| 亚洲在线视频观看| 中文成人激情娱乐网| 日韩一区二区精品在线观看| 亚洲欧洲午夜| 亚洲精品乱码久久久久久黑人| 欧美国产精品日韩| 欧美成人性生活| 欧美国产1区2区| 欧美精品日韩综合在线| 欧美日韩精品一区二区三区四区| 中文一区二区在线观看| 99精品国产一区二区青青牛奶| 午夜天堂精品久久久久 | 久久久久国色av免费观看性色| 久久久精品日韩欧美| 久久久欧美精品| 噜噜噜91成人网| 欧美国产一区视频在线观看| 欧美激情一区二区三区高清视频| 亚洲视频1区2区| 亚洲女人天堂av| 欧美在线视频免费播放| 亚洲永久精品国产| 欧美在线视频免费| 蜜桃av噜噜一区二区三区| 亚洲国产成人久久| 一本久道久久综合中文字幕| 亚洲主播在线观看| 久久精品国产第一区二区三区最新章节| 欧美激情中文字幕在线| 亚洲每日在线| 午夜精品视频在线观看| 久久久久国产精品一区三寸| 毛片一区二区三区| 国产精品成人aaaaa网站| 国产欧美日韩综合一区在线观看| 欧美另类视频| 国产亚洲激情在线| 亚洲第一精品夜夜躁人人躁| 99伊人成综合| 久久精品免费播放| 91久久精品日日躁夜夜躁国产| 久久免费视频在线| 亚洲人屁股眼子交8| 小黄鸭视频精品导航| 欧美成人资源网| 国产亚洲精品久久久久婷婷瑜伽| 欧美日韩国内| 精品动漫3d一区二区三区免费| 国产精品欧美日韩久久| 国产一区二区三区四区三区四 | 久久国产88| 欧美日本在线播放| 国产日韩欧美在线播放| 亚洲美女视频在线免费观看| 久久国产主播| 亚洲美洲欧洲综合国产一区| 久久久噜噜噜久久狠狠50岁| 欧美色大人视频| 亚洲精品久久久久久下一站| 久久av资源网|