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

S.l.e!ep.¢%

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

關(guān)于RegisterClass的注冊(cè)位置

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

?昨天在smth,有人問(wèn)起RegisterClass函數(shù)到底將窗口類注冊(cè)到哪里了,想了一下,應(yīng)該是一個(gè)系統(tǒng)級(jí)的存儲(chǔ)空間里,但是卻沒(méi)有一個(gè)明確的說(shuō)法,msdn上看了半天,基本上沒(méi)有提到具體注冊(cè)的位置。倒是返回值給了不少提示,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.


也就是說(shuō)應(yīng)該在一個(gè)原子表中,于是google之,終于找到一片像樣的文章。轉(zhuǎn)貼如下:

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.

最終的結(jié)論,RegisterClass應(yīng)該是將窗口類的數(shù)據(jù)放在User32.dll維護(hù)的一個(gè)原子表中了:)

?

本文來(lái)自CSDN博客,轉(zhuǎn)載請(qǐng)標(biāo)明出處: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>
            久久视频在线免费观看| 蜜桃久久av| 欧美v国产在线一区二区三区| 国产精品视频自拍| 亚洲欧美中文日韩在线| 久久影院亚洲| 久久久久久九九九九| 在线观看国产一区二区| 欧美成人网在线| 欧美激情在线播放| 亚洲欧美一区二区视频| 久久久精品视频成人| 亚洲一区在线免费观看| 久久精品欧美| 欧美一级日韩一级| 欧美.com| 久久免费视频这里只有精品| 欧美日韩午夜精品| 欧美成人精品在线播放| 国产情侣一区| 日韩午夜免费视频| 亚洲国产另类久久精品| 午夜在线成人av| 国产亚洲毛片| 午夜精品久久一牛影视| 欧美 日韩 国产在线| 欧美在线视频一区二区| 欧美精品一卡| 亚洲电影毛片| 国产字幕视频一区二区| 激情综合自拍| 久久国产乱子精品免费女| 欧美激情按摩| 欧美在线黄色| 欧美69wwwcom| 亚洲在线不卡| 韩国福利一区| 欧美国产另类| 久久激情婷婷| 一区二区电影免费观看| 亚洲尤物在线| 亚洲综合视频一区| 欧美激情片在线观看| 国产精品人成在线观看免费 | 欧美jjzz| 好吊色欧美一区二区三区四区| 一区二区三区视频观看| 99re热这里只有精品免费视频| 久久免费国产精品| 老牛国产精品一区的观看方式| 国产色婷婷国产综合在线理论片a| 中文高清一区| 亚洲欧美色一区| 亚洲欧美精品suv| 欧美亚洲一级| 国产精品一区二区三区四区| 亚洲在线视频免费观看| 欧美亚洲网站| 欧美日本不卡视频| 亚洲精品欧美日韩专区| 一二三区精品福利视频| 亚洲人成人一区二区在线观看| 激情综合色综合久久| 久久精品国产一区二区电影 | 久热re这里精品视频在线6| 久久婷婷久久一区二区三区| 国产真实乱子伦精品视频| 欧美一区二区成人| 久久视频一区| 亚洲国产精品一区二区第一页 | 亚洲视频欧美在线| 欧美日韩一区国产| 亚洲一级黄色片| 欧美在线观看视频一区二区| 国产一区二区三区在线观看网站| 欧美中文在线视频| 男同欧美伦乱| 国产精品免费网站在线观看| 亚洲欧美国产毛片在线| 久久久久久有精品国产| 雨宫琴音一区二区在线| 欧美福利影院| 亚洲视频在线一区| 亚洲精选国产| 99在线视频精品| 亚洲一区二区三区高清不卡| 午夜精品久久久久久久99热浪潮 | 老司机精品视频一区二区三区| 小辣椒精品导航| 欧美激情黄色片| 欧美日韩一区二区三区在线看 | 国产精品久久久久久久7电影| 亚洲天堂网在线观看| 久久久在线视频| 亚洲精品一区二区在线观看| 欧美午夜电影完整版| 欧美一区深夜视频| 欧美一级网站| 亚洲电影中文字幕| 欧美日韩一区二区免费视频| 香蕉久久夜色精品| 91久久精品国产| 性欧美大战久久久久久久久| 影视先锋久久| 国产精品日韩一区二区三区| 久久综合一区二区三区| 一区二区三区国产| 欧美a级片一区| 性伦欧美刺激片在线观看| 亚洲黑丝在线| 国产午夜精品一区理论片飘花| 欧美.www| 久久精品三级| 亚洲一区二区不卡免费| 欧美激情第8页| 久久国产日韩欧美| 国产精品99久久久久久宅男| 一区二区亚洲精品| 国产精品综合av一区二区国产馆| 麻豆精品精华液| 欧美一区二区三区婷婷月色| 一本色道久久综合精品竹菊 | 国产精品视频观看| 欧美激情一区在线| 久久三级视频| 欧美一区二区三区免费看| 9人人澡人人爽人人精品| 欧美成人午夜免费视在线看片| 午夜在线一区| 亚洲免费小视频| 中文av字幕一区| 日韩一级黄色大片| 亚洲国产精品女人久久久| 国产综合精品一区| 国产美女高潮久久白浆| 欧美午夜片在线观看| 欧美日韩第一区| 欧美久久婷婷综合色| 欧美福利电影网| 欧美成人精品三级在线观看| 久久手机免费观看| 久久青草久久| 久久久人成影片一区二区三区 | 亚洲欧美清纯在线制服| 国产精品99久久久久久宅男| 一区二区三区蜜桃网| 亚洲国产一二三| 国产精品亚洲成人| 亚洲激情专区| 国产深夜精品福利| 亚洲精品女人| 在线播放亚洲一区| 亚洲综合精品自拍| 在线亚洲欧美| 久久aⅴ乱码一区二区三区| av不卡在线观看| 国产精品超碰97尤物18| 欧美日韩一区二区三区免费看| 欧美成ee人免费视频| 欧美肥婆在线| 欧美日韩不卡| 国产精品亚洲综合| 国产视频精品免费播放| 国产亚洲日本欧美韩国| 激情久久影院| 亚洲国产日韩在线| 亚洲私人影院| 欧美在线在线| 美脚丝袜一区二区三区在线观看| 亚洲毛片av| 亚洲自拍偷拍网址| 久久久国际精品| 欧美国产精品| 99视频在线观看一区三区| 亚洲视频在线看| 久久久精品一区| 欧美国产精品人人做人人爱| 国产精品对白刺激久久久| 国产一区二区三区在线观看视频 | 亚洲在线中文字幕| 久久aⅴ国产紧身牛仔裤| 美女脱光内衣内裤视频久久影院| 亚洲国产一区二区三区青草影视| 99精品99| 久久精品视频导航| 欧美日本一区二区三区| 国产偷国产偷亚洲高清97cao | 久久久久一本一区二区青青蜜月| 免费久久99精品国产自在现线| 亚洲福利国产| 亚洲一区国产| 老司机久久99久久精品播放免费| 欧美日韩一区二区免费在线观看| 国产日本欧美一区二区三区| 亚洲人成在线观看| 久久激情一区| 一本大道久久精品懂色aⅴ| 久久综合电影| 国产亚洲激情| 亚洲——在线|