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

我住包子山

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 閱讀(4206) 評論(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>
            久久午夜国产精品| 国产女精品视频网站免费| 夜夜嗨一区二区| 亚洲精品日产精品乱码不卡| 欧美激情网友自拍| 亚洲区欧美区| 亚洲人成在线播放| 一个人看的www久久| 亚洲午夜精品久久| 欧美一区二区三区免费观看视频| 亚洲一区二区三区三| 亚洲一级黄色| 久久亚洲一区二区三区四区| 欧美成人综合一区| 国产精品视频精品视频| 一区二区三区中文在线观看 | 欧美巨乳波霸| 国产精品老女人精品视频| 狠狠做深爱婷婷久久综合一区| 亚洲精品国产精品国产自| 亚洲午夜激情免费视频| 欧美一区二区高清在线观看| 免费观看亚洲视频大全| 日韩视频免费看| 卡通动漫国产精品| 国产精品一区二区女厕厕| 午夜日韩在线| 蜜桃av噜噜一区二区三区| 国产精品久久久久一区二区三区共| 在线观看成人一级片| 校园春色国产精品| 亚洲精品免费一二三区| 久久精品视频在线观看| 国产精品久久久久久久9999| 亚洲国产一二三| 久久精品主播| 亚洲一区二区三区免费在线观看| 美腿丝袜亚洲色图| 国产亚洲欧美一级| 午夜精品视频| 在线亚洲精品| 欧美视频在线一区二区三区| 91久久精品国产91久久| 久久久精品久久久久| 一区二区三区欧美激情| 欧美成人四级电影| 精品成人国产| 国产自产精品| 亚洲免费观看| 欧美国产综合| 欧美国产第一页| 老司机成人网| 国产午夜精品一区理论片飘花 | 一级日韩一区在线观看| 久久看片网站| 国产色综合久久| 久久精品国产亚洲一区二区| 亚洲美女尤物影院| 欧美午夜精品久久久| 亚洲国产第一| 亚洲电影免费观看高清完整版| 午夜精品视频网站| 欧美电影电视剧在线观看| 久久国产手机看片| 久久综合色一综合色88| 亚洲国产美女| 狂野欧美激情性xxxx欧美| 久久男人资源视频| 狠狠干成人综合网| 美女视频黄a大片欧美| 欧美一区日韩一区| 亚洲黄色高清| 农夫在线精品视频免费观看| 男同欧美伦乱| 亚洲电影免费观看高清| 精品成人国产| 久久日韩精品| 能在线观看的日韩av| 亚洲毛片在线| 亚洲综合丁香| 国产综合久久久久久| 亚洲午夜一二三区视频| 一区二区三区蜜桃网| 免费观看国产成人| 中文欧美字幕免费| 99一区二区| 红桃视频一区| 亚洲第一伊人| 国产精品久久久久久久久久妞妞 | 欧美日韩精品一区二区三区四区| 中文国产亚洲喷潮| 亚洲视频电影在线| 精品不卡一区| 亚洲国产精品久久久久秋霞蜜臀 | 永久免费精品影视网站| 羞羞色国产精品| 国内精品久久久久影院色| 欧美一区二区三区日韩视频| 久久国产一区二区三区| 1769国内精品视频在线播放| 午夜视频在线观看一区二区三区| 亚洲自拍偷拍一区| 欧美视频中文在线看 | 夜夜嗨av色一区二区不卡| 亚洲精品一二三区| 欧美美女操人视频| 欧美一区2区三区4区公司二百| 欧美一区二区精品| 亚洲黄色免费| 亚洲午夜日本在线观看| 国产一二精品视频| 一区二区三区日韩精品| 好吊视频一区二区三区四区| 日韩午夜激情av| 国产主播一区| 亚洲自拍16p| 99re视频这里只有精品| 久久亚洲不卡| 香蕉久久夜色| 国产精品久久久久久户外露出| 欧美xxx成人| 国产一区二区三区精品欧美日韩一区二区三区 | 一区视频在线看| 99re6热只有精品免费观看| 亚洲亚洲精品在线观看| 亚洲国产成人av好男人在线观看| 99re6热在线精品视频播放速度 | 亚洲午夜未删减在线观看| 欧美专区第一页| 久久精品国产69国产精品亚洲| 欧美成人免费观看| 欧美国产精品日韩| 国产专区综合网| 欧美综合第一页| 亚洲欧美日韩国产综合| 国产精品亚洲第一区在线暖暖韩国| 欧美激情一区二区三区 | 亚洲电影观看| 欧美成人乱码一区二区三区| 久久亚洲综合网| 一色屋精品亚洲香蕉网站| 亚洲直播在线一区| 久久国产精彩视频| 国产精品福利在线观看| 中文网丁香综合网| 一区二区欧美激情| 欧美性事免费在线观看| 亚洲精品视频在线| 亚洲先锋成人| 欧美日韩中文字幕| 亚洲男女毛片无遮挡| 亚洲免费在线观看视频| 久久久久.com| 亚洲欧美www| 久久久久久久999| 国产精品一卡二卡| 久久国产精品亚洲77777| 久久国产一区| 亚洲欧洲午夜| 欧美激情久久久久久| 一区二区精品| 久久久夜精品| 在线观看欧美亚洲| 欧美日韩精品一区二区三区四区| 亚洲精品美女91| 午夜日韩视频| 国产日韩欧美综合| 美女精品网站| 亚洲一区二区三区四区五区午夜| 亚洲欧美成人在线| 在线观看日韩欧美| 欧美刺激性大交免费视频 | 国产午夜精品久久久| 欧美在线观看日本一区| 欧美成人免费全部观看天天性色| 亚洲福利一区| 国产精品青草综合久久久久99| 亚洲欧美日本伦理| 亚洲黄色免费网站| 激情小说另类小说亚洲欧美| 欧美韩日一区二区| 中文久久乱码一区二区| 久久精品视频免费播放| 日韩一区二区免费看| 国产精品一区二区久久国产| 免费在线视频一区| 亚洲一区二区三区777| 欧美国产亚洲精品久久久8v| 亚洲一级影院| 亚洲靠逼com| 国产精品爽爽爽| 欧美日韩亚洲高清| 亚洲综合首页| 亚洲六月丁香色婷婷综合久久| 免费观看成人| 久久久久一区二区三区| 午夜在线电影亚洲一区| 亚洲激情视频在线播放| 国产在线精品成人一区二区三区| 欧美国产日韩一二三区|