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

我住包子山

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 閱讀(4195) 評論(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ⅴ片在线观看香蕉| 99re亚洲国产精品| 久久国产精品久久久久久久久久| 欧美成人免费在线观看| 国产精品99久久久久久久久| 久久精品30| 欧美午夜不卡影院在线观看完整版免费| 国产精品日本一区二区| 亚洲黄色大片| 美女黄毛**国产精品啪啪| 欧美插天视频在线播放| 国产午夜精品美女毛片视频| 亚洲理论在线观看| 免费欧美电影| 国产精品wwwwww| 久久久蜜桃一区二区人| 亚洲永久字幕| 欧美视频中文字幕在线| 日韩视频在线免费| 亚洲欧美日韩综合| 国产精品久久久久久久久久久久 | 国产精品网曝门| 美国三级日本三级久久99| 亚洲欧美一区二区三区久久| 在线看日韩欧美| 牛人盗摄一区二区三区视频| 久久精品中文字幕一区| 国产精品丝袜白浆摸在线| 欧美成人精品高清在线播放| 国产精品久久91| 亚洲国产cao| 蜜桃av久久久亚洲精品| 亚洲电影视频在线| 亚洲欧美福利一区二区| 国内精品久久久久影院 日本资源| 亚洲欧美日韩电影| 亚洲欧美激情视频| 亚洲精品一区二区三区不| 亚洲欧洲日韩女同| 欧美三区在线| 亚洲二区在线视频| 激情五月婷婷综合| 亚洲国产精品一区二区久| 欧美第一黄色网| 开心色5月久久精品| 国产日韩在线一区| 亚洲午夜91| 加勒比av一区二区| 欧美一区二区日韩一区二区| 狠狠色综合网| 亚洲第一综合天堂另类专| 国产有码一区二区| 欧美一区2区三区4区公司二百| 亚洲在线一区二区| 久久国产精品网站| 久久久久国产精品麻豆ai换脸| 久久看片网站| 国产精品99久久久久久有的能看| 欧美高清在线一区| 亚洲专区国产精品| 欧美性感一类影片在线播放 | 欧美成人资源| 亚洲国产精品t66y| 久久综合色8888| 一本大道久久a久久精二百| 亚洲欧美在线视频观看| 小嫩嫩精品导航| 国产亚洲欧美日韩美女| 亚洲国产日韩综合一区| 99精品热视频只有精品10| 欧美美女bbbb| 久久一区二区三区四区五区| 黄色成人av在线| 欧美夫妇交换俱乐部在线观看| 亚洲高清网站| 亚洲一区区二区| 国产女精品视频网站免费| 亚洲国产欧美一区二区三区久久| 亚洲精品乱码久久久久| 欧美性猛交xxxx乱大交蜜桃| 午夜精品久久久99热福利| 久久一区二区三区av| 亚洲精品国精品久久99热一| 欧美日韩专区在线| 欧美亚洲三区| 最新成人av在线| 午夜免费日韩视频| 欧美三级视频在线| 午夜精品国产更新| 亚洲国产精品成人一区二区| 亚洲影视在线| 亚洲成色777777女色窝| 欧美视频一区二区三区| 久久久久成人精品免费播放动漫| 亚洲激情综合| 久久精品一区蜜桃臀影院 | 国产乱人伦精品一区二区 | 亚洲第一视频网站| 午夜精品久久久久久久久久久久| 伊人婷婷欧美激情| 欧美视频导航| 欧美1区免费| 你懂的国产精品| 亚洲一区国产精品| 亚洲国产欧美一区二区三区同亚洲 | 亚洲永久免费视频| 亚洲国产精品va在线观看黑人 | 亚洲激情网址| 国内外成人在线| 国产精品国产三级国产普通话蜜臀 | 久久阴道视频| 亚洲免费一级电影| 99精品国产在热久久下载| 亚洲精品中文字| 在线成人黄色| 国产日韩视频| 国产精品视频自拍| 欧美系列电影免费观看| 欧美激情亚洲精品| 亚洲一区二区四区| 夜夜嗨av一区二区三区免费区| 欧美粗暴jizz性欧美20| 久久中文精品| 久久久久久一区二区三区| 亚洲欧美一区在线| 亚洲欧美区自拍先锋| 国产精品99久久不卡二区| 亚洲久久一区二区| 亚洲人成在线观看| 亚洲国产精品久久久久婷婷老年| 韩国在线一区| 国产一区二区在线免费观看| 国产日韩一区二区三区在线| 国产乱人伦精品一区二区| 国产精品最新自拍| 国产欧美日韩激情| 国内精品久久久久久久影视麻豆| 国产亚洲a∨片在线观看| 国产婷婷97碰碰久久人人蜜臀| 国产精品自拍小视频| 国产裸体写真av一区二区| 国产视频一区二区在线观看 | 欧美激情一区二区三区全黄| 欧美大片专区| 欧美日韩一区自拍| 久久精品亚洲乱码伦伦中文| 久久久亚洲精品一区二区三区| 欧美一区二区三区久久精品| 久久精品2019中文字幕| 久久青青草原一区二区| 亚洲午夜精品久久久久久浪潮| 国产精品99久久久久久久vr| 午夜精品免费| 欧美黄色一区| 欧美伊人久久| 在线性视频日韩欧美| 在线欧美日韩| 亚洲国产精品99久久久久久久久| 亚洲精品免费电影| 性色av一区二区三区| 久久青草久久| 亚洲国产精品成人综合| 亚洲线精品一区二区三区八戒| 欧美一级黄色录像| 欧美成人一区在线| 国产精品一区二区在线观看网站| 激情欧美亚洲| 亚洲视频在线观看一区| 久久久亚洲一区| 亚洲国产精品一区二区久| 亚洲午夜精品一区二区| 另类综合日韩欧美亚洲| 国产精品日本精品| 亚洲国产午夜| 欧美在线观看你懂的| 亚洲国产精品一区制服丝袜| 亚洲一区网站| 欧美日韩不卡一区| 欧美日韩三级一区二区| 韩日欧美一区二区| 亚洲小说欧美另类社区| 亚洲一区在线视频| 欧美激情国产精品| 亚洲免费一级电影| 欧美日韩在线播放一区| 在线看无码的免费网站| 午夜一区不卡| 亚洲欧洲一区二区在线观看| 久久精品视频一| 国产欧美在线观看一区| 这里是久久伊人| 亚洲第一色中文字幕| 久久久久久午夜|