https://bugs.winehq.org/show_bug.cgi?id=38878
Bug ID: 38878 Summary: olepropframe.c (OleCreatePropertyFrame) is missing the apply code Product: Wine Version: 1.7.46 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: oleaut32 Assignee: wine-bugs@winehq.org Reporter: jasonwinter@hotmail.com Distribution: ---
The window proc: property_sheet_proc currently only handles 2 messages, initdialog & destroy, however most DirectX property sheets require the apply logic to save changes (even though realtime changes can be seen, they are backed out when the dialog is closed if apply isn't executed).
To resolve the issue, the most basic change to the current source might look something like this:
...
static HWND hwndFrom = NULL; static HWND hwndFor = NULL;
static INT_PTR CALLBACK property_sheet_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { ...snip... case WM_NOTIFY: { switch (((NMHDR FAR *)lparam)->code) { case PSN_APPLY: if (IPropertyPage_Apply(property_page) == NOERROR) { SetWindowLong(hwnd, DWL_MSGRESULT, PSNRET_NOERROR); PropSheet_UnChanged (((NMHDR FAR *)lparam)->hwndFrom, hwnd); // Reset Apply button } else SetWindowLong(hwnd, DWL_MSGRESULT, PSNRET_INVALID);
break; case PSN_SETACTIVE: hwndFrom = ((NMHDR FAR *)lparam)->hwndFrom; hwndFor = hwnd; break; case PSN_KILLACTIVE: SetWindowLong(hwnd, DWL_MSGRESULT, FALSE); break; } return FALSE; } case WM_DESTROY: IPropertyPage_Show(property_page, SW_HIDE); IPropertyPage_Deactivate(property_page); hwndFrom = NULL; hwndFor = NULL; return FALSE; default: ...snip...
static HRESULT WINAPI PropertyPageSite_OnStatusChange( IPropertyPageSite *iface, DWORD dwFlags) { IPropertyPage *property_page;
TRACE("(%p, %x)\n", iface, dwFlags);
if ((hwndFrom) && (hwndFor)) { // Were they set?
if ((dwFlags & PROPPAGESTATUS_DIRTY) == PROPPAGESTATUS_DIRTY) PropSheet_Changed (hwndFrom, hwndFor); // Enable Apply button
if ((dwFlags & PROPPAGESTATUS_VALIDATE) == PROPPAGESTATUS_VALIDATE) { property_page = (IPropertyPage*)GetWindowLongPtrW(hwndFor, DWLP_USER); if ((property_page) && (IPropertyPage_Apply(property_page) == NOERROR)) PropSheet_UnChanged (hwndFrom, hwndFor); // Reset Apply button }
if ((dwFlags & PROPPAGESTATUS_CLEAN) == PROPPAGESTATUS_CLEAN) PropSheet_UnChanged (hwndFrom, hwndFor); // Reset Apply button } return S_OK; }
https://bugs.winehq.org/show_bug.cgi?id=38878
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
--- Comment #1 from super_man@post.com --- Could you form a patch of your chages? It's really time consuming to read source code and compare the changes.
https://bugs.winehq.org/show_bug.cgi?id=38878
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jasonwinter@hotmail.com