I have a problem with a property page in the printer preferences.
I am setting a handle to my current printer in the creation of the property
page.
Page.lParam = (long)((OEMUIPSPARAM*)(pPSUIInfo->lParamInit))->hPrinter;
When I open this page I save this printer handle in
case WM_INITDIALOG:
// OpenPrinter
hPrinter = (HANDLE)((PROPSHEETPAGE *)lParam)->lParam;
VERBOSE(PRNTEXT("Printer handle [%x]\n"), hPrinter);
UserData.hPrinter = hPrinter;
PUserData1 = &UserData;
SetLastError(0);
if ((PUserData =
(CBMYUSERDATA*)SetWindowLong(hDlg,GWL_USERDATA,(DWORD)PUserData1)) == 0)
{
dwError = GetLastError();
}
Now when I get into the case case WM_NOTIFY:
it works to retrieve this printer handle and work with it, but when I press
a button on the dialog it goes into case WM_COMMAND:
and my handle is false!
What am I doing wrong here? I need the access to the printer handle to use
GetPrinterData and SetPrinterData.
Any help appreciated.
Thanks,
--
\Manfred