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 );
But For CreateWindowEx16 i'm not sure how to check. But i had a look at some code in class.c, where similar checks are performed and constructed following:
if (!HINSTANCE_32(instance)) instance = HINSTANCE_32(GetModuleHandle16(NULL));
So does the code for CreateWindowEx16 look right?
Greetings Peter
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
"Peter Oberndorfer" kumbayo84@arcor.de wrote:
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 );
You need to add a small test case for that in dlls/user/tests/win.c and make sure that it passes at least on one flavor of Win9x and NT.
Then submit a fix and a new test case.
if (!HINSTANCE_32(instance)) instance = HINSTANCE_32(GetModuleHandle16(NULL));
So does the code for CreateWindowEx16 look right?
For me it looks OK.