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

S.l.e!ep.¢%

像打了激速一樣,以四倍的速度運轉,開心的工作
簡單、開放、平等的公司文化;尊重個性、自由與個人價值;
posts - 1098, comments - 335, trackbacks - 0, articles - 1
  C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

關于RegisterClass的注冊位置

Posted on 2010-05-28 14:40 S.l.e!ep.¢% 閱讀(992) 評論(0)  編輯 收藏 引用 所屬分類: VC

?昨天在smth,有人問起RegisterClass函數到底將窗口類注冊到哪里了,想了一下,應該是一個系統級的存儲空間里,但是卻沒有一個明確的說法,msdn上看了半天,基本上沒有提到具體注冊的位置。倒是返回值給了不少提示,ATOM,查ATOM終于找到如下的一段描述

?The system provides a number of atom tables. Each atom table serves a different purpose. For example, dynamic data exchange (DDE) applications use the global atom table to share item-name and topic-name strings with other applications. Rather than passing actual strings, a DDE application passes global atoms to its partner application. The partner uses the atoms to obtain the strings from the atom table.

Applications can use local atom tables to store their own item-name associations.

The system uses atom tables that are not directly accessible to applications. However, the application uses these atoms when calling a variety of functions. For example, registered clipboard formats are stored in an internal atom table used by the system. An application adds atoms to this atom table using the RegisterClipboardFormat function. Also, registered classes are stored in an internal atom table used by the system. An application adds atoms to this atom table using the RegisterClass or RegisterClassEx function.


也就是說應該在一個原子表中,于是google之,終于找到一片像樣的文章。轉貼如下:

What's the atom returned by RegisterClass useful for?

The RegisterClass and RegisterClassEx functions return an ATOM. What is that ATOM good for?

The names of all registered window classes is kept in an atom table internal to USER32. The value returned by the class registration functions is that atom. You can also retrieve the atom for a window class by asking a window of that class for its class atom via GetClassWord(hwnd, GCW_ATOM).

The atom can be converted to an integer atom via the MAKEINTATOM macro, which then can be used by functions that accept class names in the form of strings or atoms. The most common case is the lpClassName parameter to the CreateWindow macro and the CreateWindowEx function. Less commonly, you can also use it as the lpClassName parameter for the GetClassInfo and GetClassInfoEx functions. (Though why you would do this I can't figure out. In order to have the atom to pass to GetClassInfo in the first place, you must have registered the class (since that's what returns the atom), in which case why are you asking for information about a class that you registered?)

To convert a class name to a class atom, you can create a dummy window of that class and then do the aforementioned GetClassWord(hwnd, GCW_ATOM). Or you can take advantage of the fact that the return value from the GetClassInfoEx function is the atom for the class, cast to a BOOL. This lets you do the conversion without having to create a dummy window. (Beware, however, that GetClassInfoEx's return value is not the atom on Windows 95-derived operating systems.)

But what good is the atom?

Not much, really. Sure, it saves you from having to pass a string to functions like CreateWindow, but all it did was replace a string with with an integer you now have to save in a global variable for later use. What used to be a string that you could hard-code is now an atom that you have to keep track of. Unclear that you actually won anything there.

I guess you could use it to check quickly whether a window belongs to a particular class. You get the atom for that class (via GetClassInfo, say) and then get the atom for the window and compare them. But you can't cache the class atom since the class might get unregistered and then re-registered (which will give it a new atom number). And you can't prefetch the class atom since the class may not yet be registered at the point you prefetch it. (And as noted above, you can't cache the prefetched value anyway.) So this case is pretty much a non-starter anyway; you may as well use the GetClassName function and compare the resulting class name against the class you're looking for.

In other words, window class atoms are an anachronism. Like replacement dialog box classes, it's one of those generalities of the Win32 API that never really got off the ground, but which must be carried forward for backwards compatibility.

But at least now you know what they are.

最終的結論,RegisterClass應該是將窗口類的數據放在User32.dll維護的一個原子表中了:)

?

本文來自CSDN博客,轉載請標明出處:http://blog.csdn.net/Hamxj/archive/2007/05/09/1601758.aspx

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            欧美ed2k| 欧美在线视频一区| 国产精品久久| 欧美性做爰猛烈叫床潮| 欧美日韩免费观看一区| 欧美日韩亚洲综合一区| 欧美日韩中文字幕在线视频| 欧美日韩三级在线| 国产精品视频免费在线观看| 国内伊人久久久久久网站视频 | 国产免费成人在线视频| 国产精品一区久久久久| 国产在线观看91精品一区| 樱花yy私人影院亚洲| 亚洲日本中文字幕| 亚洲欧美在线x视频| 久久亚洲春色中文字幕久久久| 狂野欧美一区| 亚洲黄一区二区三区| 亚洲肉体裸体xxxx137| 夜夜爽99久久国产综合精品女不卡| 99国产精品99久久久久久粉嫩| 亚洲一区二区精品| 久久五月天婷婷| 国产精品成人一区二区艾草| 影音先锋成人资源站| 亚洲性感美女99在线| 久久夜色精品国产欧美乱| 亚洲区一区二| 久久久久久亚洲精品杨幂换脸| 欧美日韩国产专区| 在线播放一区| 久久精品123| 亚洲精品影院| 久久久一区二区三区| 国产精品久久国产愉拍| 亚洲缚视频在线观看| 欧美一区二区三区在线看| 91久久亚洲| 老色批av在线精品| 国产一区二区三区四区hd| 亚洲天堂成人| 亚洲激情偷拍| 另类亚洲自拍| 国产一区二区三区成人欧美日韩在线观看| 99re6热在线精品视频播放速度| 久久久久久久久伊人| 一区二区三区欧美成人| 欧美国产一区二区在线观看 | 欧美专区福利在线| 国产精品萝li| 亚洲一区二区三区在线观看视频 | 亚洲高清不卡| 美女露胸一区二区三区| 西瓜成人精品人成网站| 国产精品视频1区| 午夜精品在线观看| 亚洲一级片在线看| 国产精品午夜av在线| 午夜精品视频在线观看一区二区| 亚洲剧情一区二区| 欧美精品二区| 99热这里只有成人精品国产| 亚洲国产精品成人精品| 免费永久网站黄欧美| 亚洲国产综合在线看不卡| 蘑菇福利视频一区播放| 久久一区二区三区国产精品 | 亚洲一区二区三区精品动漫| 欧美三区在线观看| 一区二区三区国产盗摄| 久久精品噜噜噜成人av农村| 亚洲一区二区三区中文字幕在线| 亚洲国产欧美日韩| 欧美国产精品| 亚洲一区二区三| 亚洲一区二区三| 国产一区二区中文字幕免费看| 欧美在线视屏| 久久爱www| 亚洲国产裸拍裸体视频在线观看乱了中文 | 亚洲少妇在线| 正在播放亚洲| 国产视频亚洲精品| 久久精品中文| 欧美www视频| 亚洲欧美国产77777| 欧美一区在线直播| 亚洲伦伦在线| 亚洲欧美一区二区精品久久久| 韩国亚洲精品| 亚洲精品资源美女情侣酒店| 国产精品一区二区欧美| 欧美ed2k| 国产精品影音先锋| 亚洲第一毛片| 国产一二三精品| 亚洲免费福利视频| 尤物99国产成人精品视频| 亚洲经典一区| 韩国免费一区| 99国产精品久久久久久久久久| 国产欧美日韩亚洲一区二区三区| 免费黄网站欧美| 国产乱人伦精品一区二区| 免费亚洲电影在线观看| 欧美视频第二页| 蜜臀av在线播放一区二区三区| 欧美精品一卡| 久久综合精品国产一区二区三区| 欧美激情中文字幕乱码免费| 久久夜色精品国产亚洲aⅴ | 欧美亚洲第一页| 免费h精品视频在线播放| 国产精品v一区二区三区| 欧美jizzhd精品欧美巨大免费| 欧美午夜无遮挡| 欧美激情视频网站| 国产一区二区三区不卡在线观看| 亚洲美女在线一区| 在线精品国精品国产尤物884a| 亚洲视频网在线直播| 99re亚洲国产精品| 蜜臀va亚洲va欧美va天堂 | 久久久久久久久岛国免费| 欧美一区二区免费观在线| 亚洲视频在线观看免费| 亚洲国产高潮在线观看| 国产一区二区三区四区hd| 99re6热在线精品视频播放速度| 黄色亚洲免费| 校园春色综合网| 午夜久久一区| 欧美三级精品| 亚洲区免费影片| 亚洲精品一区二区在线| 久久青青草综合| 久久这里只有精品视频首页| 国产日韩在线亚洲字幕中文| 一区二区三区高清在线观看| 亚洲久久一区| 欧美国产亚洲另类动漫| 欧美激情在线有限公司| 伊人精品久久久久7777| 久久九九久久九九| 免费在线观看日韩欧美| 亚洲缚视频在线观看| 久久综合中文字幕| 欧美大片免费观看| 亚洲激情一区二区三区| 暖暖成人免费视频| 亚洲国产美女| 亚洲午夜激情网站| 国产精品青草久久久久福利99| 亚洲午夜未删减在线观看| 欧美一级片一区| 国产一区二区三区久久精品| 久久成人一区二区| 欧美成年人视频网站| 亚洲伦理久久| 欧美亚洲不卡| 久久99在线观看| 亚洲成色精品| 一本久道久久综合婷婷鲸鱼| 欧美日韩国产影院| 久久精品亚洲国产奇米99| 亚洲福利精品| 欧美精品一区二区在线播放| 一区二区三区日韩在线观看| 欧美在线观看视频在线| 在线精品视频免费观看| 欧美欧美全黄| 久久久精品一品道一区| 亚洲欧洲综合另类在线| 亚洲欧美视频在线观看| 国产综合色产| 欧美日韩精品三区| 久久激情久久| 日韩亚洲视频在线| 欧美1区视频| 亚洲欧美日韩国产一区| 影音先锋久久资源网| 欧美日韩精品欧美日韩精品一| 久久成人一区| 国产精品99久久久久久久久久久久| 免费国产一区二区| 欧美一区二区三区视频免费| 亚洲欧洲日韩综合二区| 国产麻豆精品视频| 欧美精品精品一区| 久久精品女人天堂| 亚洲系列中文字幕| 亚洲精品1234| 麻豆精品视频在线观看| 亚洲欧美www| 亚洲精品一区二区在线观看| 欧美精品激情| 欧美日韩精品免费看| 欧美激情精品久久久六区热门| 影音先锋亚洲视频|