<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Hi, <BR>
&nbsp;<BR>
Summary: SetClassLongW(hEdit, GCL_<FONT face="">WNDPROC</FONT>,(DWORD)NewEditWndProc) in Wine differs from Windows.<BR>
&nbsp;<BR>
Background:&nbsp; when a standard built-in window class (such as Edit for example) is registered initially, <BR>
the window system register the class with two Procedures (procA and ProcW) and assign a handle as <BR>
WNDPROC to the class.&nbsp; If a Edit window is created using CreateWindowExA, it will be an Ansi Window. <BR>
If a Edit window is created using CreateWindowExW, it will be an&nbsp;Unicode Window. This fine in Wine.<BR>
&nbsp;<BR>
Problem: I&nbsp;globally subclass the Edit&nbsp;class using SetClassLongW using following code<BR>
------------------------------------------------------------------------------------------------------------<BR>
&nbsp;&nbsp;HWND hEdit = CreateWindowExA(0,"Edit", "E1",WS_POPUP,0, 0, 1,1,NULL,NULL,NULL,NULL);<BR>&nbsp;&nbsp;OldEditWndProc =(WNDPROC)SetClassLongW(hEdit, GCL_<FONT face="">WNDPROC</FONT>,(DWORD)NewEditWndProc);<BR>
------------------------------------------------------------------------------------------------------------<BR>
After&nbsp;this subclass,&nbsp;Wine behaves different from Windows<BR>
&nbsp;<BR>
In Windows: a new Edit windows created by CreateWindowsExA((0,"Edit",...) is a Still an Ansi Windows<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a new Edit windows created by CreateWindowsExW((0,"Edit",...) is a&nbsp;Unicode Windows<BR>
&nbsp;<BR>
But in Wine, new Edit windows created by CreateWindowsExA or CreateWindowsExW are all Unicode Windows.<BR>
I checked wine 1.1&nbsp;source code , basically the call&nbsp;to<BR>
SetClassLongW(hEdit, GCL_<FONT face="">WNDPROC</FONT>,(DWORD)NewEditWndProc) has set the Edit class proc to Unicode Only.<BR>
So regardless how you create the Edit window, it will be Unicode window.<BR>
&nbsp;<BR>
This is understandable but it's different form windows. causing my application to mis-behave.<BR>
&nbsp;<BR>
More problem, the OldEditWndProc&nbsp;returned above is only the procW of Edit class, if we try to<BR>
undo the subclass with<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetClassLongW(hEdit, GCL_WNDPROC,(DWORD)OldEditWndProc&nbsp;);<BR>
the Edit class also lost it's procA.<BR>
&nbsp;<BR>
Discussion: How wine could do the same as windows?<BR>
&nbsp;<BR>
SetClassLongW(hEdit, GCL_<FONT face="">WNDPROC</FONT>,(DWORD)NewEditWndProc) should<BR>
&nbsp;<BR>
1. return the proc handle of the class, instead of procW.<BR>
&nbsp;<BR>
2. set both ProcA and ProcW of Edit class to NewEditWndProc.<BR>
&nbsp;&nbsp;&nbsp; so&nbsp;&nbsp;NewEditWndProc need to handle both messages from Ansi and Unicode Edit control.<BR>
&nbsp;<BR>
I don't know what is the best way to fix this. Please help.<BR>
&nbsp;<BR>
I have posted a Test application on Bugzilla #14350, please try.<BR>
&nbsp;<BR>
Regards<BR>
Hongbo<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR><br /><hr />Find out: SEEK Salary Centre <a href='http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau%2Fcareer%2Dresources%2Fsalary%2Dcentre%2F%3Ftracking%3Dsk%3Ahet%3Asc%3Anine%3A0%3Ahot%3Atext&_t=764565661&_r=OCT07_endtext_salary&_m=EXT' target='_new'>Are you paid what you're worth? </a></body>
</html>