|
!hDCprt = @prthdc% calldll #gdi32, "GetDeviceCaps", hDCprt as ulong, _HORZRES as long, width as long calldll #gdi32, "GetDeviceCaps", hDCprt as ulong, _VERTRES as long, height as long if height > width then print "Portrait" else print "Landscape" end if
|
struct pd, lStructSize as long, hwndOwner as ulong, hDevMode as ulong, hDevNames as ulong, _ hDC as ulong, Flags as long, nFromPage as short, nToPage as short, nMinPage as short, _ nMaxPage as short, nCopies as short, hInstance as ulong, lCustData as long, _ lpfnPrintHook as long, lpfnSetupHook as long, lpPrintTemplateName as ptr, _ lpSetupTemplateName as ptr, hPrintTemplate as ulong, hSetupTemplate as ulong pd.lStructSize.struct = len(pd.struct) pd.Flags.struct = _PD_RETURNDEFAULT or _PD_RETURNDC calldll #comdlg32, "PrintDlgA", pd as struct, result as long hDCprt = pd.hDC.struct calldll #gdi32, "GetDeviceCaps", hDCprt as ulong, _HORZRES as long, width as long calldll #gdi32, "GetDeviceCaps", hDCprt as ulong, _VERTRES as long, height as long if height > width then print "Portrait" else print "Landscape" end if