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

我住包子山

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

SubclassWindow 一個(gè)函數(shù),其實(shí)是個(gè)宏

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

這個(gè)宏是我看第七章winshellprograming看到的,很強(qiáng)大的功能,例子是用FindWindowEx找到windows開始按鈕的窗口句柄,之后用該宏加入開始按鈕的消息處理函數(shù).總之還不錯(cuò),winshell還真不是一般..
MSDN上查SubclassWindow都不是我要的這個(gè),雖然功能大體相同吧.
下面這個(gè)就是SetWindowLongPtr函數(shù):
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.

這個(gè)函數(shù)改變一個(gè)指定窗口的一個(gè)屬性.它也可設(shè)定窗口儲(chǔ)存區(qū)指定偏移位置的值。

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.
這個(gè)函數(shù)取代了SetWindowLong函數(shù),為了兼容32位64位windows os,就用這個(gè)函數(shù)吧 .

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當(dāng)擁有指定窗口的京城比用戶UI權(quán)限隔絕(??)高的時(shí)候..不知道翻譯對(duì)不

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.

這個(gè)意思大概是函數(shù)失敗如果調(diào)用進(jìn)程傳入的hWnd句柄不屬于調(diào)用包含這個(gè)函數(shù)的線程的進(jìn)程(應(yīng)用程序).

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.
這個(gè)不用翻譯了,很明了哈哈
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.
成功返回的是設(shè)置前的值LONG_PTR這個(gè)類型

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



先到這里,以后會(huì)寫更多Win32的基礎(chǔ)知識(shí),當(dāng)我學(xué)到的時(shí)候..

btw,有本叫the old new thing 似乎很強(qiáng),不知道什么時(shí)候能有一本...

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

Feedback

# re: SubclassWindow 一個(gè)函數(shù),其實(shí)是個(gè)宏 2008-06-27 18:39 hoodlum1980

你怎么翻譯的?。?
Extra Window Memory,是窗口類里面的一個(gè)成員,表示給每個(gè)窗口保留分配的一塊內(nèi)存的地址。換句話說,它是一個(gè)具體窗口自己獨(dú)占的一個(gè)存儲(chǔ)區(qū)。

再有:
Extra Class Memory:是屬于窗口類的內(nèi)存,所有屬于該類窗口的共享數(shù)據(jù)。

另外你的hwnd參數(shù)的解釋,我用的vs.net2003的文檔,和你的不一樣,我看到的msdn上說的是,如果這個(gè)窗口不屬于調(diào)用該函數(shù)的線程,則該函數(shù)會(huì)失敗。  回復(fù)  更多評(píng)論   

# re: SubclassWindow 一個(gè)函數(shù),其實(shí)是個(gè)宏 2008-06-27 23:23 Gohan

@hoodlum1980
謝謝大哥你的指點(diǎn),已經(jīng)根據(jù)你的回復(fù)改正了翻譯,有任何問題歡迎指出。小弟還是初學(xué),向大哥學(xué)習(xí)了。  回復(fù)  更多評(píng)論   

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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精品久久久不卡综合| 欧美中文字幕在线| 亚洲一区二区免费视频| 欧美日韩视频| 一区二区三区精密机械公司 | 欧美韩日一区二区| 亚洲电影观看| 国产午夜精品在线观看| 亚洲欧美电影院| 在线一区二区日韩| 国产精品99免费看 | 裸体女人亚洲精品一区| 国产欧美不卡| 欧美在线高清| 亚洲美女少妇无套啪啪呻吟| 欧美成人在线影院| 99国产精品久久久久老师| 欧美激情一区二区三区四区| 美日韩免费视频| 一本久道久久综合中文字幕 | 亚洲大片免费看| 亚洲综合第一| 国产欧美日本一区二区三区| 久久久999成人| 久久综合999| av成人激情| 亚洲先锋成人| 黄色日韩精品| 亚洲国产综合视频在线观看| 久久久久国产精品一区三寸| 麻豆精品一区二区av白丝在线| 久久久久久69| 99国产精品自拍| 亚洲女ⅴideoshd黑人| 好看的日韩av电影| 亚洲经典一区| 国产精品美女黄网| 欧美.www| 国产精品久久久久久久久搜平片| 久久久久国内| 欧美激情欧美激情在线五月| 欧美一区91| 欧美**人妖| 欧美日韩综合精品| 久久精品在线| 欧美乱妇高清无乱码| 久久精品国产视频| 欧美激情视频一区二区三区免费| 亚洲免费网址| 久久久久久久综合狠狠综合| 9i看片成人免费高清| 亚洲免费在线观看| 性欧美办公室18xxxxhd| 欧美大片在线影院| 欧美一级久久| 欧美伦理一区二区| 蜜桃av一区| 国产精品一区二区三区四区 | 久久国产天堂福利天堂| 一区二区三区视频在线观看| 久久狠狠一本精品综合网| 一区二区三区高清在线| 久久久久久一区二区| 亚洲精品在线免费| 一本久道久久综合中文字幕| 久久精品欧美| 欧美色视频在线| 模特精品裸拍一区| 国产日韩欧美二区| 宅男噜噜噜66一区二区| 亚洲精品乱码久久久久久按摩观| 午夜精品在线视频| 亚洲一区二区综合| 欧美精品三级在线观看| 另类天堂av| 亚洲精品中文字幕女同| 久久精品国产精品| 久久久久久一区| 国产精品国产a级| 亚洲日韩成人| 亚洲老板91色精品久久| 午夜精品久久久久久久99樱桃| 日韩亚洲视频| 暖暖成人免费视频| 久久亚裔精品欧美| 国内精品福利| 亚洲一区二区少妇| 中文在线资源观看网站视频免费不卡 | 久久综合99re88久久爱| 久久精品九九| 国产亚洲精品aa午夜观看| 亚洲精品一区在线| 亚洲精品欧美激情| 欧美理论视频| 亚洲黄色影院| 一区二区三区欧美在线| 欧美日韩一区二区免费在线观看| 久久久国际精品| 欧美一区二区三区另类 | 国内成+人亚洲| 久久激情网站| 欧美v国产在线一区二区三区| 伊人夜夜躁av伊人久久| 六月婷婷一区| 亚洲精选视频免费看| 99亚洲一区二区| 欧美体内she精视频| 国产精品99久久99久久久二8| 亚洲综合不卡| 国产一区二区三区四区hd| 欧美sm视频| 在线亚洲观看| 国产午夜一区二区三区| 久久亚洲精品一区| 亚洲国产日韩美| 亚洲欧美一区二区三区在线| 国产欧美亚洲日本| 久久免费视频网站| 日韩视频三区| 国产精品日韩在线播放| 久久国产精品久久精品国产| 一区在线观看| 欧美日韩国产一级| 午夜精品一区二区三区在线视 | 亚洲图片你懂的| 久久精品免费| 日韩一级在线| 国产一区二区黄| 欧美大尺度在线| 亚洲一区在线直播| 欧美jizzhd精品欧美喷水| 亚洲主播在线观看| 尤物yw午夜国产精品视频明星| 亚洲激情在线观看视频免费| 欧美一级艳片视频免费观看| 亚洲国产高潮在线观看| 亚洲一区二区日本| 欧美在线三级| 99视频超级精品| 欧美www视频在线观看| 欧美一级在线播放| 99精品热视频| 黄色精品一二区| 日韩午夜电影| 伊人影院久久| 国产麻豆综合| 欧美日韩成人| 麻豆成人在线观看| 欧美一区二区三区精品| 亚洲伦理中文字幕| 欧美成人免费大片| 久久动漫亚洲| 亚洲综合视频一区| 日韩视频免费观看高清在线视频| 国产综合av| 国产美女精品视频免费观看| 欧美日韩综合不卡| 欧美日韩大陆在线| 欧美黄色影院| 欧美成人免费va影院高清| 久久精品欧美日韩精品| 欧美成在线观看| 久久婷婷久久| 久久亚洲春色中文字幕久久久| 欧美一区二区视频在线观看2020| 亚洲一区二区免费视频| 一区二区三区久久精品| 亚洲理论在线观看| 亚洲美女一区| 亚洲精品人人| 亚洲人成毛片在线播放女女| 一区视频在线| 久久黄色小说| 久久精品首页| 99re6热只有精品免费观看| 亚洲一区免费观看| 亚洲天堂偷拍| 亚洲影院在线| 午夜日韩福利| 久久精品99国产精品日本| 久久国产主播| 你懂的国产精品| 亚洲国产精品v| 亚洲精品视频在线观看免费| 亚洲精品一区二区三区在线观看 | 欧美精品电影| 欧美日韩亚洲一区二区| 国产精品高潮久久| 国产精品一页| 久久网站热最新地址| 麻豆成人av| 欧美三级资源在线| 国产视频亚洲精品| 激情成人av在线| 亚洲精品乱码视频|