Microsoft KB Archive/132239

{|
 * width="100%"|

Calling ExtDeviceMode/DeviceCapabilities in Win32s App

 * }

Q132239

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), used with:
 * Microsoft Windows NT Server versions 3.5, 3.51
 * Microsoft Windows NT Workstation versions 3.5, 3.51
 * Microsoft Windows 95
 * Microsoft Win32s version 1.25

-

SUMMARY
A Win32-based application running under Windows NT or Windows 95 can call DocumentProperties to change printer settings and DeviceCapabilities to query printer driver capabilities. But if the Win32-based application is running under Win32s, it has to load and call printer drivers directly by using calls such as LoadLibrary, GetProcAddress, ExtDeviceMode, and DeviceCapabilities.

Win32s handles these two printer driver functions specifically by creating a mapping thunk dynamically. The address returned to the Win32-based application by GetProcAddress is actually the address to the thunk that makes the 32-bit to 16-bit transition and calls the printer driver.

The DEVCAP sample shows:


 * How to use DeviceCapabilities to query printer driver capabilities.
 * How to use DocumentProperties under Windows NT or Windows 95 to change printing orientation.
 * How to use ExtDeviceMode under Win32s to change printing orientation.
 * How to work around two DeviceCapabilities bugs in the current version of Win32s (1.25.142) where DC_BINS and DC_PAPERS retrieve a list of DWORD items instead of a list of WORD items.

NOTE: Prior to version 1.25.142, Win32s contained a bug that did not allow ExtDeviceMode to change printing orientation.

MORE INFORMATION
The following file is available for download from the Microsoft Download Center:

"Devcap.exe" For additional information about how to download Microsoft Support files, click the article number below to view the article in the Microsoft Knowledge Base:

"Q119591 How to Obtain Microsoft Support Files from Online Services" Microsoft used the most current virus detection software available on the date of posting to scan this file for viruses. Once posted, the file is housed on secure servers that prevent any unauthorized changes to the file.

Additional query words: DEVCAP softlib kbprint kbfile

Keywords : kbfile kbprint kbOSWinNT350 kbOSWinNT351 kbSDKWin32 kbOSWin95 kbDSupport

Issue type : kbinfo

Technology : kbAudDeveloper kbWin32sSearch kbWin32API