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

我住包子山

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>
            9人人澡人人爽人人精品| 国产日韩欧美不卡在线| 一区一区视频| 欧美jizz19性欧美| 久久伊人一区二区| 亚洲激情图片小说视频| 亚洲国产老妈| 欧美日韩视频在线一区二区| 一本色道婷婷久久欧美| 亚洲午夜久久久久久久久电影院| 国产精品羞羞答答| 久久久久欧美精品| 蜜臀av一级做a爰片久久| 99精品国产在热久久| 一本到高清视频免费精品| 国产精品午夜在线| 免费观看一级特黄欧美大片| 欧美成人午夜剧场免费观看| 亚洲视频精选在线| 欧美一区二区三区在线| 亚洲国产成人在线播放| 99精品欧美一区二区三区综合在线 | 亚洲视频视频在线| 午夜天堂精品久久久久| 91久久久久久国产精品| 一区二区三区成人精品| 黄网站色欧美视频| 日韩视频在线观看| 精品成人一区二区| 一区二区黄色| 亚洲高清视频在线观看| 99精品久久久| 亚洲国产毛片完整版| 一区二区三区日韩欧美精品| 亚洲电影免费观看高清完整版| 亚洲精品一级| 在线观看欧美精品| 亚洲欧美日本国产有色| 亚洲精品一级| 久久精品99国产精品日本| 一区二区久久| 欧美成人一区二免费视频软件| 久久国产欧美日韩精品| 欧美人与禽性xxxxx杂性| 久久综合狠狠综合久久综合88| 欧美日韩在线视频首页| 欧美高清在线精品一区| 国产一区二区三区四区三区四| 99pao成人国产永久免费视频| 精品999日本| 欧美一区二区在线| 午夜日韩电影| 国产精品a久久久久| 亚洲欧洲日韩综合二区| 亚洲国产女人aaa毛片在线| 欧美一区二区黄色| 欧美一区二区在线免费播放| 欧美日本视频在线| 亚洲欧洲精品天堂一级| 亚洲黄色成人| 免费成人黄色片| 欧美www在线| 亚洲承认在线| 另类激情亚洲| 亚洲电影免费观看高清| 亚洲成色最大综合在线| 久久日韩精品| 欧美大片免费久久精品三p | 美女国内精品自产拍在线播放| 午夜精品一区二区三区在线视 | 亚洲尤物精选| 欧美日韩亚洲一区在线观看| 亚洲承认在线| 91久久国产综合久久| 久久综合网络一区二区| 欧美激情亚洲另类| 亚洲人成网站999久久久综合| 麻豆91精品| 亚洲高清在线精品| 亚洲作爱视频| 国产精品久久久久久久电影| 亚洲天堂网站在线观看视频| 性久久久久久久| 亚洲破处大片| 午夜精品久久久久久久久久久久| 亚洲男女自偷自拍图片另类| 欧美中文字幕视频| 亚洲免费观看高清完整版在线观看| 免费亚洲电影| 亚洲精品国产系列| 亚洲综合国产精品| 国产综合色精品一区二区三区| 久久er99精品| 亚洲国产清纯| 亚洲欧美视频| 在线观看欧美一区| 欧美精选一区| 午夜久久美女| 亚洲电影成人| 欧美在线看片| 亚洲美女毛片| 国产日韩av在线播放| 卡一卡二国产精品| 亚洲视频一起| 欧美成人一品| 亚洲欧美日韩精品久久亚洲区| 国内精品免费在线观看| 欧美精品黄色| 久久精品30| 夜久久久久久| 欧美大片在线影院| 欧美中文日韩| 亚洲视频在线看| 狠狠88综合久久久久综合网| 欧美日韩国产综合新一区| 亚洲欧美日韩另类| 亚洲毛片在线| 欧美大片在线观看一区二区| 欧美影院成年免费版| 亚洲日本中文字幕免费在线不卡| 国产精品视频专区| 欧美日韩美女一区二区| 久久人人97超碰精品888| 亚洲女优在线| 亚洲图片在线观看| 亚洲另类在线视频| 欧美黑人国产人伦爽爽爽| 久久久久久久999| 午夜亚洲精品| 亚洲专区在线| 亚洲免费视频成人| 一本久道久久综合中文字幕| 亚洲二区免费| 欲色影视综合吧| 伊人成人开心激情综合网| 国产欧美日韩亚洲精品| 国产精品高清一区二区三区| 欧美日韩另类一区| 欧美日韩一区二区三| 欧美日韩国产精品一区| 欧美国产日产韩国视频| 欧美成人精品在线| 免费欧美日韩国产三级电影| 久久久久久尹人网香蕉| 久久激情综合网| 久久久www成人免费毛片麻豆| 欧美一二三区在线观看| 欧美一级午夜免费电影| 午夜在线视频一区二区区别| 亚洲欧美视频一区二区三区| 亚洲欧美综合精品久久成人| 亚洲一区二区不卡免费| 午夜在线一区| 久久天天躁夜夜躁狠狠躁2022| 久久久国产精品一区二区中文| 久久久欧美一区二区| 久久综合给合久久狠狠色 | 欧美亚洲一级| 久久久www免费人成黑人精品 | 亚洲大胆人体在线| 亚洲三级色网| 亚洲一区二区精品在线| 午夜精品三级视频福利| 久久久.com| 欧美激情一二三区| 亚洲精品黄网在线观看| 99精品视频网| 欧美在线观看视频在线| 久久精品国产清高在天天线| 久久久久久亚洲精品不卡4k岛国| 欧美成人国产| 国产精品久久久久999| 国产自产v一区二区三区c| 亚洲国产欧美一区二区三区同亚洲 | 国产欧美精品va在线观看| 韩国自拍一区| 99国产精品久久| 欧美在线观看视频| 欧美激情精品久久久久久大尺度| 日韩视频精品在线| 欧美在线视频一区| 欧美黄色免费| 国产视频一区二区在线观看| 亚洲经典自拍| 久久er99精品| 亚洲精品一区久久久久久| 亚洲男女自偷自拍| 欧美激情第4页| 国产一区二区三区在线观看精品 | 麻豆成人在线观看| av成人激情| 免费观看一区| 国产午夜亚洲精品羞羞网站| 亚洲靠逼com| 久久久无码精品亚洲日韩按摩| 亚洲精品影院| 美玉足脚交一区二区三区图片| 国产精品视频男人的天堂| 亚洲免费av电影| 欧美jizzhd精品欧美喷水|