473,412 Members | 2,096 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

DocumentProperties API function

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.


Nov 20 '05 #1
2 6724
Hi,

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

Ken
--------------------
"Flavio Zanellato" <fz********@icomservice.it> wrote in message
news:OZ**************@TK2MSFTNGP10.phx.gbl...
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.

Nov 20 '05 #2
Hi,

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

Ken
--------------------
"Flavio Zanellato" <fz********@icomservice.it> wrote in message
news:OZ**************@TK2MSFTNGP10.phx.gbl...
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.

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
0
by: sparton | last post by:
Good day!! Is there a way to retrieve values / changes from documentproperties? documentproperties is the screen is shown when you press 'properties' on the 'Print' window. This can be derived from...
5
by: phil_gg04 | last post by:
Dear Javascript Experts, Opera seems to have different ideas about the visibility of Javascript functions than other browsers. For example, if I have this code: if (1==2) { function...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
2
by: sushil | last post by:
+1 #include<stdio.h> +2 #include <stdlib.h> +3 typedef struct +4 { +5 unsigned int PID; +6 unsigned int CID; +7 } T_ID; +8 +9 typedef unsigned int (*T_HANDLER)(void); +10
0
by: bluf2000 | last post by:
Hello csharp professionlals. I have a problem: my application has to handle with DocumentProperties API. The application is coded in C#. It works fine, the DocumentProperties appears, after that...
0
by: Benoit Courchesne | last post by:
Hi, I'm trying to build my custom Printer Dialog box. The following code is supposed to Pop up the printer properties form and edit the PrinterSettings. My problem is that I'm able to show...
0
by: sparton | last post by:
good day!! is there a way to retrieve values from documentproperties in winspool.drv?? sample values are the number of pages, and orientation.. many thanks!!!
0
by: Calum | last post by:
I have created a custom print dialog and its fully working expcept for the printer preferences. The code below displays the printer preferences dialog for the selected printer fine, the devmode...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.