winecfg: Add dll override on return key press in combobox [resend]
Andre Wisplinghoff
andre.wisplinghoff at gmail.com
Sat Dec 27 08:27:52 CST 2008
2008/12/27 Dmitry Timoshkov <dmitry at codeweavers.com>:
> "Andre Wisplinghoff" <andre.wisplinghoff at gmail.com> wrote:
>
>> +INT_PTR CALLBACK
>> +comboedit_wndproc (HWND hEdit, UINT uMsg, WPARAM wParam, LPARAM lParam)
>
> INT_PTR is wrong return value type for a window proc.
so it should be HRESULT? INT_PTR is used for other window procs in
programs/winecfg/libraries.c, too.
>> + /* subclass dllcombo's edit to allow return keypress handling */
>> + GetComboBoxInfo(GetDlgItem(dialog, IDC_DLLCOMBO), &cbinfo);
>> + edit = cbinfo.hwndItem; /* retrieve edit box handle */
>> + oldWndProc = (LONG_PTR)SetWindowLong(edit, GWL_WNDPROC,
>> + (DWORD) comboedit_wndproc);
>> + SetWindowLong(edit, GWL_USERDATA, (DWORD)oldWndProc);
>
> The code is above is not 64-bit safe.
I'm not used to 64-bit programming but willing to learn. Is using
SetWindowLongPtr enough to make it 64-bit safe?:
oldWndProc = SetWindowLongPtr(edit, GWL_WNDPROC,
(LONG_PTR) comboedit_wndproc);
SetWindowLongPtr(edit, GWL_USERDATA, (LONG_PTR) oldWndProc);
-- Andre Wisplinghoff
More information about the wine-devel
mailing list