Udating public devmode with IPrintOemDriverUI::DrvUpdateUISetting

Udating public devmode with IPrintOemDriverUI::DrvUpdateUISetting

Post by U3RldmVuIF » Fri, 24 Jun 2005 04:07:03


Hello,

I am working on a unidrv ui plug-in and I basically need to eliminate and
replace all default UI. With some limitations we have been able to change
the visual aspect of the UI completely by hiding all unwanted controls and
adding new ones on the property initialization messages and by adding whole
now property pages. However, now that we want to be able to store the
information that the user selects, we are running in to problems.

As an example, I have the following code:
optOrientationItem = &cacheStruct.pOEMUIParam->pDrvOptItems[3];
iIndex = SendMessage(GetDlgItem( hDlg, IDC_COMBO_DPI),CB_GETCURSEL,0,0);
optOrientationItem->Sel = iIndex;
optOrientationItem->Flags |= OPTIF_CHANGEONCE;

cacheStruct._piOEMHelp->DrvUpdateUISetting(cacheStruct.pOEMUIParam->poemuiobj,
optOrientationItem,
NULL,
OEMCUIP_DOCPROP);

In this case, OPITEM 3 is the print quality option. According to the docs,
on DrvUpdateSetting, we must call this function whenever we change OPITEMS
that correspond to the public devmode structure. It doesn't say what the
call will do for me exactly, and that is where my question is.

I am confused as to how to update the public devmode structure (as that is
what I want) because that call produces different results if I am testing in
notepad or if I am testing in excell.

In excell, everyting works as one would expect. If I change the value of
optOrientationItem->Sel and then call DrvUpdateUISetting, then once the
property sheet's OK button is selected, the public devmode structure is
updated with the proper value (I verify this by setting a data breakpoint on
the appropriate memory address.... also when loading the property sheet
again, the new values are provided). If I use the de *** to skip this call
then the new value is not merged in to the devmode.

In notepad, nothing seems to work. The results are the same wether I call
DrvUpdateUISetting or if I skip it. It seems as if the call does nothing.
One thing I can do is to allow the appropriate default control to display,
change (through the GUI) it to mark it dirty and then change the value in my
control. However, this is not really helpful in a real-world scenario.

I have also tried modifying the devmode directly and this also does not seem
to work.

I am wondering why the two applications behave differently as the
implementation for the function is in the unidrv dll and the parameters to
the function look identical in each case (the values of optitem are almost
the same in both cases... in excell, optOrientationItem->Flags has 0x80000000
set, and notepad only has this flag set if I first interact with the standard
control... I can not find a defined, documented symbol for that flag in this
context.)

What is the proper way for updating the public devmode structure from within
a unidrv ui plugin? The handler is window proc associated with a custom
property page.

--
Steven Velez
Hanna Strategies
Sr. Software Engineer
 
 
 

Udating public devmode with IPrintOemDriverUI::DrvUpdateUISetting

Post by a-cazy » Fri, 24 Jun 2005 08:44:41


Have you looked at syncset sample code which you find in
..\<ddk>\src\print\oemdll?

SYNCSET: Synchronization plug-in. This sample demonstrates how to
synchronize driver settings between the OEM customization page and the
standard device settings page.

It seems you are doing the one syncset implemeted. The functions you may
look at are ChangeOpItem and OEMPrinterUICallBack.
{\rtf1\ansi\ansicpg932\deff0\deflang1033\deflangfe1041{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\lang1041\f0\fs20 Have you looked at syncset sample code which you find in ...\\<ddk>\\src\\print\\oemdll?
\par
\par SYNCSET: Synchronization plug-in. This sample demonstrates how to synchronize driver settings between the OEM customization page and the standard device settings page.
\par
\par It seems you are doing the one syncset implemeted. The functions you may look at are ChangeOpItem and OEMPrinterUICallBack.
\par
\par }

 
 
 

Udating public devmode with IPrintOemDriverUI::DrvUpdateUISetting

Post by Erik » Fri, 24 Jun 2005 23:07:47

I have been trying to hide the standard UI for some time now, without
any luck. I would be very grateful for any tips, or code even, for how
you achieved this.

Thank you. /Erik
 
 
 

1. microsoft.public.windowsxp.general, microsoft.public.windowsxp.configuration_manage, microsoft.public.windowsxp.basics,microsoft.public.windowsxp.customize, microsoft.public.windowsxp.network_web, microsoft.public.windowsxp.perform_maintain, microso

2. microsoft.public.dotnet.languages.vb,microsoft.public.fox.programmer.exchange,microsoft.public.sqlserver.dts,microsoft.public.sqlserver.programming,microsoft.public.vb.database,microsoft.public.vb.general.discussion

3. comp.security.misc,microsoft.public.security.virus,microsoft.public.windows.server.security,microsoft.public.windowsxp.security_admin

4. microsoft.public.sqlserver.misc,microsoft.public.sqlserver.datawarehouse,microsoft.public.sqlserver

5. microsoft.public.dotnet.languages.vb,microsoft.public.windowsxp.print_fax,microsoft.public.dotnet.framework.aspnet

6. microsoft.public.dotnet.general, microsoft.public.dotnet.languages.csharp,microsoft.public.developer.outlook.addins

7. microsoft.public.win2000.general; microsoft.public.win2000.group_policy; microsoft.public.scripting.wsh

8. Does Unidrv ignore the DEVMODE in IPrintOemUni::CommandCallback()?

9. info about devmode

10. Incorrect DEVMODE in DrvDocumentPropertySheets

11. microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd

12. Copying DevMode structure

13. private devmode additions

14. Default Devmode of printer drivers on Win9x

15. abt DEVMODE stucture in printers