How to cancel the "print preview" option in the printer preferences by coding?

szmm 25 Reputation points
2024-04-10T04:00:43.3266667+00:00

I want to cancel the "print preview" option in the printer preferences by coding, maybe can use c++ windows api or C#.

Then how to do it ?

Thank you !

1712721546546

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,613 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,913 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,723 questions
{count} votes

Accepted answer
  1. KOZ6.0 6,395 Reputation points
    2024-04-10T06:24:08.8133333+00:00

    It is difficult to set items that are not present in the DEVMODE structure. https://learn.microsoft.com/en-us/windows-hardware/drivers/display/the-devmodew-structure

    Ask your printer manufacturer.

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Castorix31 85,131 Reputation points
    2024-04-10T06:37:28.8033333+00:00

    I don't have this option on my printer, but normally with DocumentProperties,

    like the test I had done in this thread : https://learn.microsoft.com/en-us/answers/questions/748446/controle-printer-setting-using-vb-net

    1 person found this answer helpful.

  2. Xiaopo Yang - MSFT 12,726 Reputation points Microsoft Vendor
    2024-04-10T06:07:20.3433333+00:00

    Hello @szmm,

    This UI is owned by System so you cannot custom it.

    Thank you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.