On Sat, 2003-12-27 at 18:39, Peter Oberndorfer wrote: > Hello > Trying to run PEview.exe i found a problem. > > First i create a window with CreateWindowEx and pass 0 as instance. > When trying to read the instance with GetWindowLong(hWnd,GWL_HINSTANCE) > # Wine returns 0 as passed to the function. > # Win 98 returns 0x400000 which is what GetModuleHandle( NULL ) gives me. > > For the CreateWindowEx{A,W} it can easily be fixed by adding this two > lines at the beginning of the function: > > if (instance == 0) > instance = GetModuleHandleW( NULL );
Are you sure that's the right fix? Perhaps it always calls GetModuleHandle on instance, I can't think of a reason that they'd special case 0 like that. Do you always get back the exact value you put in when instance != 0? thanks -mike