At 08:43 PM 2/16/00 +0000, you wrote:
>On Tue, Feb 15, 2000 at 02:41:01AM -0700, gerard patel wrote:

>> I think that GlobalFindAtomA does not succeed if called with
>> a *handle* in className,although CreateWindowsEx should
>> if the className parameter is a handle
>
>No! It is quite legal to call FindAtom function with atom handle!

*handle* ?

ATOM at, at2;
char buf[10];
strcpy(buf, "4000");
at = GlobalAddAtom(buf);
if ((at2 = GlobalFindAtom(buf)))
        ShowMessage("Success1"); -> success (of course)

wsprintf(buf, "#%d", at);
if ((at2 = GlobalFindAtom(buf)))
        ShowMessage("Success2, 2");
else
        ShowMessage("Fails2"); -> fails

if ((at2 = GlobalFindAtom((BYTE *)(at))))
        ShowMessage("Success3");
else
        ShowMessage("Fails3"); -> fails

if ((at2 = GlobalFindAtom((BYTE *)4000)))
        ShowMessage("Success4"); -> success (ugh.:-))
else
        ShowMessage("Fails4"); 

Unless I have badly misunderstood the Ms doc, GlobalFindAtom
does not work with a handle, even if it works with the integer
value of an integer atom.
(well, GlobalFindAtom is supposed to return a handle, that is,
a value in the range C000-FFFF, so it does not make sense to call
it with this same value, IMHO :-))

I get similar results with a normal string (like "GASP"), even
if in this case there is no 'value' to use (so my fourth 
test case don't apply).
BTW, this test programs works the same way under Wine and
in Windows.

But (see my trace) the word viewer calls CreateWindow with an
atom handle (over 0xC000). So I think that the Wine code for 
CreateWindow is wrong to use this value with GlobalFindAtom

>So, the code in CreateWindow needs to be fixed.

Sergei, I don't get it, that's what I was saying...

Gerard

Reply via email to