Hi,
I just can't find a way to automatically change the page aspect from portrait to landscape. According to Microsoft you can change the following in the registry:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
PageOrientation : REG_DWORD
Specifies page orientation. Valid settings are 1=portrait, 2=landscape.
However, the registry tweak doesn't work. Am I doing something wrong?
Printing in landscape using WebGadget
-
- User
- Posts: 27
- Joined: Sat Oct 16, 2004 1:25 pm
-
- User
- Posts: 27
- Joined: Sat Oct 16, 2004 1:25 pm
Re: Printing in landscape using WebGadget
Obviously you are, if it doesn't work.johnnyutah wrote:However, the registry tweak doesn't work. Am I doing something wrong?
Hint: Maybe showing the code you are using to set the registry?

-
- User
- Posts: 27
- Joined: Sat Oct 16, 2004 1:25 pm
Code: Select all
Procedure.s ReadRegKey(OpenKey.l, SubKey.s, ValueName.s)
hKey.l = 0
KeyValue.s = Space(255)
Datasize.l = 255
If RegOpenKeyEx_(OpenKey, SubKey, 0, #KEY_READ, @hKey)
KeyValue = "Error Opening Key"
Else
If RegQueryValueEx_(hKey, ValueName, 0, 0, @KeyValue, @Datasize)
KeyValue = "Error Reading Key"
Else
KeyValue = Left(KeyValue, Datasize - 1)
EndIf
RegCloseKey_(hKey)
EndIf
ProcedureReturn KeyValue
EndProcedure
Procedure.l WriteRegKey(OpenKey.l, SubKey.s, KeySet.s, KeyValue.s)
hKey.l = 0
If RegCreateKey_(OpenKey, SubKey, @hKey) = 0
Result = 1
Datasize.l = Len(KeyValue)
If RegSetValueEx_(hKey, KeySet, 0, #REG_SZ, @KeyValue, Datasize) = 0
Result = 2
EndIf
RegCloseKey_(hKey)
EndIf
ProcedureReturn Result
EndProcedure
Code: Select all
WriteRegKey(#HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Internet Settings", "PageOrientation", 2)
On a completely separate note, if anyone knows how to use the "browseforfolder" object through the Windows API can you point me in the right direction because I can't find anything about it by searching the forums.
