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

我住包子山

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開(kāi)始按鈕的窗口句柄,之后用該宏加入開(kāi)始按鈕的消息處理函數(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ì)寫(xiě)更多Win32的基礎(chǔ)知識(shí),當(dāng)我學(xué)到的時(shí)候..

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

posted on 2007-06-03 00:26 Gohan 閱讀(4195) 評(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)存的地址。換句話說(shuō),它是一個(gè)具體窗口自己獨(dú)占的一個(gè)存儲(chǔ)區(qū)。

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

另外你的hwnd參數(shù)的解釋,我用的vs.net2003的文檔,和你的不一樣,我看到的msdn上說(shuō)的是,如果這個(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ù)改正了翻譯,有任何問(wèn)題歡迎指出。小弟還是初學(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>
            国产午夜精品一区二区三区视频 | 在线观看91精品国产入口| 亚洲精品一区二区三区蜜桃久| 老巨人导航500精品| 久久精品一区二区| 亚洲黄色成人久久久| 99国产精品久久久久久久| 欧美国产一区视频在线观看| 一区二区三区视频在线看 | 久久亚洲风情| 欧美精品自拍偷拍动漫精品| 亚洲性感激情| 久久xxxx| 一区二区三区欧美亚洲| 亚洲欧美精品在线观看| 亚洲第一区中文99精品| 日韩一级黄色av| 国产一区二区在线免费观看| 亚洲第一主播视频| 欧美日韩中文字幕在线| 久久久久久久久久久一区 | 欧美三区美女| 久久久综合免费视频| 免费亚洲婷婷| 欧美专区第一页| 欧美日韩ab片| 久久亚洲精选| 欧美天天影院| 亚洲第一在线视频| 很黄很黄激情成人| 亚洲天堂成人在线视频| 亚洲国产精品一区二区www| 亚洲一级免费视频| 日韩视频在线你懂得| 久久久免费观看视频| 亚洲永久精品国产| 欧美va亚洲va日韩∨a综合色| 欧美一区二区在线免费播放| 欧美喷潮久久久xxxxx| 美女啪啪无遮挡免费久久网站| 国产精品高潮呻吟久久av黑人| 欧美福利专区| 国产日韩欧美黄色| 亚洲欧美卡通另类91av| 亚洲欧美一区二区原创| 欧美日韩亚洲一区二区| 欧美激情精品久久久久| 一区精品在线播放| 久久av资源网站| 久久久久在线| 激情欧美一区二区| 久久精品免费看| 久久国产精品99国产| 国产精品私拍pans大尺度在线| 亚洲精品一区二区三区樱花| 亚洲三级观看| 欧美二区在线播放| 亚洲人久久久| 亚洲一品av免费观看| 欧美极品色图| 亚洲欧洲日产国码二区| 日韩视频一区| 欧美激情久久久久久| 亚洲第一精品在线| 一本一本久久a久久精品综合妖精| 麻豆久久婷婷| 亚洲高清av| 在线视频你懂得一区| 欧美日韩国产bt| 日韩午夜电影在线观看| 亚洲国产一成人久久精品| 久久伊人亚洲| 精品福利av| 欧美r片在线| 欧美黄色视屏| 亚洲一级黄色片| 国产日韩欧美精品| 老司机成人在线视频| 亚洲精品在线免费观看视频| 亚洲精品视频在线| 欧美精彩视频一区二区三区| 亚洲麻豆av| 久久aⅴ国产欧美74aaa| 伊人影院久久| 欧美日韩妖精视频| 亚洲一区二区三区中文字幕在线 | 亚洲美女中文字幕| 国产精品chinese| 国产精品自在线| 欧美国产1区2区| 亚洲人成7777| 国产精品高精视频免费| 亚洲国产精品欧美一二99| 亚洲在线视频免费观看| 国产深夜精品| 久久精品国产亚洲高清剧情介绍 | 亚洲一区二区三区影院| 国产一区二区三区的电影 | 亚洲一区二区三区精品在线| 国产午夜精品久久| 欧美精品一区二区三| 欧美综合二区| 在线中文字幕日韩| 欧美www视频在线观看| 欧美一区激情视频在线观看| 亚洲精品一品区二品区三品区| 国产乱码精品一区二区三区五月婷 | 激情亚洲成人| 国产精品久久久久久久app| 老司机精品福利视频| 午夜精彩国产免费不卡不顿大片| 欧美大片在线看| 欧美中文字幕| 亚洲一区二区在线免费观看视频| 国产欧美在线观看| 欧美日韩中文字幕在线| 欧美+亚洲+精品+三区| 久久精品99| 欧美亚洲在线播放| 亚洲视频网站在线观看| 亚洲乱码国产乱码精品精98午夜| 欧美91大片| 美女精品在线| 久久久青草青青国产亚洲免观| 亚洲中无吗在线| 一本一本久久| 亚洲精品一区二区三区婷婷月| 狠狠狠色丁香婷婷综合激情| 国产精品欧美日韩| 欧美丝袜一区二区三区| 欧美人妖另类| 欧美日韩网站| 欧美日韩中文在线观看| 欧美视频一区二区三区在线观看| 欧美好吊妞视频| 欧美电影打屁股sp| 欧美成人综合| 欧美激情二区三区| 欧美精品一区二区三区在线播放| 免费亚洲电影| 欧美激情亚洲国产| 欧美日韩成人| 国产精品成人一区二区三区吃奶| 欧美日韩免费高清一区色橹橹| 欧美激情一区二区三区四区| 欧美福利影院| 欧美日韩精品在线视频| 欧美四级在线观看| 国产精品日韩欧美| 国内精品99| 亚洲人成在线影院| 夜夜爽夜夜爽精品视频| 亚洲综合色视频| 欧美在线视频观看免费网站| 久久精品视频va| 欧美 日韩 国产在线| 亚洲国产天堂久久综合| 一区二区三区.www| 午夜视频在线观看一区| 久久亚洲影院| 欧美丝袜第一区| 国内成人精品视频| 日韩午夜激情av| 午夜亚洲一区| 欧美大色视频| 在线亚洲精品| 久久精品免费观看| 欧美日韩精品免费观看视一区二区 | 在线亚洲欧美专区二区| 亚洲欧美日韩一区二区在线| 久久久久99精品国产片| 欧美国产一区二区三区激情无套| 亚洲精品在线观看免费| 亚洲欧美日韩一区在线| 免费日韩一区二区| 国产精品视频网址| 亚洲人成人99网站| 欧美在线观看网址综合| 亚洲电影在线| 午夜久久福利| 欧美色视频日本高清在线观看| 国内在线观看一区二区三区| 在线视频日韩精品| 欧美成人免费全部| 亚洲欧美日韩一区在线| 欧美日韩国产综合视频在线| 一区二区三区自拍| 午夜精品视频在线| 亚洲精品欧美| 免费观看久久久4p| 激情综合网址| 欧美亚洲视频| 99国产精品久久久久久久| 老司机午夜精品| 国产精品三级久久久久久电影| 亚洲电影第1页| 久久国产日韩| 亚洲在线视频| 国产精品福利在线观看| 99视频国产精品免费观看|