DocumentProperties API function

  • Thread starter Flavio Zanellato
  • Start date
F

Flavio Zanellato

Hello,

I've a problem calling the above function in VB.NET :

nSize = DocumentProperties(hWnd, hPrinter, szPrinterName, oDevMode,
pDevMode, DM_OUT_BUFFER Or DM_PROMPT)

I seems that the DM_PROMPT (value &H4) is ignored.

In my old VB6 module passing a window handle (hWnd) with the prompt flag,
opens the printer properties.

In VB.NET all is ok (return code, return DEVMODE structure) except for the
printer window properties that does not show up.

I pass the form Me.Handle to the hWnd parameter.

This is the declaration :

<DllImport("winspool.Drv", EntryPoint:="DocumentPropertiesW",
SetLastError:=True, CharSet:=CharSet.Unicode, ExactSpelling:=True,
CallingConvention:=CallingConvention.StdCall)> _

Public Function DocumentProperties(ByVal hWnd As IntPtr, ByVal hPrinter As
IntPtr, ByVal pDeviceName As String, ByVal pDevModeOutput() As Byte, ByVal
pDevModeInput As DEVMODE, ByVal fMode As Int32) As Int32

End Function

Does anyone have any ideas ?

Thanks in advance.
 
K

Ken Tucker [MVP]

Hi,

I dont have an example but the DocumentProperties as for win 95,
98,ME. Why dont you try using AdvancedDocumentProperties instead?

Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top