[Bug 38878] New: olepropframe.c (OleCreatePropertyFrame) is missing the apply code
wine-bugs at winehq.org
wine-bugs at winehq.org
Tue Jul 7 02:23:45 CDT 2015
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 at winehq.org
Reporter: jasonwinter at 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;
}
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
More information about the wine-bugs
mailing list