Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printer settings at run-time
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00189772
Message ID:
00190417
Views:
15
>Ed / Walter / George:
>
>I've been lurking on this thread trying to solve a problem that has been plaguing me for quite a while. I think i've got all of the pieces to the puzzle now I just need a hammer to make them fit!
>
>What I'm trying to do it get the output from a set device to print into landscape mode.
>
>I've been following the discussion between you 3 about:
>
>>The DEVMODE structure that Ed mentioned is stored in the registry under >HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\Print\Printers\< Printer >Name >. That last entry, of course, represents the printer name. Under that >there's an entry named DefaultDevmode. What you could do is change the value >and call SYS(3056) to force VFP to re-read the registry settings.
>
>My guess is if I could read that registry key into one of those class heaps (or a string?), and somehow change the right byte from a 1 to a 2, I could write the whole mess back to the registry and call sys(3056)?
>

There's no need for a heap allocation; RegGetValueEx() can return a binary registry variable in a string. I'm not certain if the FFC will pull back a binary registry value properly, but if not, it would only take a half-dozen or so lines of code to write the necessary API call.

>Can you tell me where you got the information the the Default Devmode for the printer context in VFP was written to the above registry key mentioned. I've never seen that before and it sounds like a good reference.
>

I didn't; someone else (Walter Meester perhaps) wrote about it. You can go back in the thread a few days and see who noted it.

>Can you give me any guidance/mentoring/help!!
>

You'll want to get your hands on the MSDN documentation, and I still find the NT Win32 API SuperBible to be an invaluable resource; at the moment, Macmillan lists it as out of stock; you may well find it on the shelf of a local CompUSA or Barnes & Noble, or Amazon might have it.

>Thanks again, and stop by - the round is on me!
>
>
>Scott Vanden Elzen
>scott@westonmedical.com
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform