Software Archive
Read-only legacy content
17060 Discussions

Getting name of selected device from Printer Dialog Box

jcbreeding
Beginner
188 Views
How can I access the name of the printer selected in the Printer Dialog box for use elsewhere in my program? I've tried to modify the Fortran_Winprint.f90 example and can't figure it out. I believe it has something to do with the DEVNAMEs structure but can't figure out how to access it.

Jim Breeding
0 Kudos
1 Reply
Intel_C_Intel
Employee
188 Views
The short version of what you want to do is basicly four lines. GlobalLock the hDevNames, add the wDeviceOffset to that address, read the string, and do a GlobalUnlock. But because the devil's in the details, and it was easier to write it than explain it, here is an example that should help. You can call it from inside winprint, passing in the PRINTDLG_Struct%hDevNames, an output string, and an optional status argument.

hth,
John
0 Kudos
Reply