PrintingDevice.GetDevMode 方法 |
注意:此 API 现在已过时。
命名空间: XSharp.VO.SDK
1oPD //假定是一个PrintingDevice对象。 2LOCAL structDevMode AS _WINDEVMODE 3LOCAL i AS DWORD 4LOCAL cDeviceName AS STRING 5LOCAL cOrientation AS STRING 6 7structDevMode := oPD:GetDevMode() 8 9FOR i := 1 TO CCHDEVICENAME 10 cDeviceName:=cDeviceName+Chr(structDevMode.dmDeviceName[i]) 11NEXT 12 13?"Device name is " 14??cDeviceName 15cOrientation := StringdmOrientation(structDevMode.dmOrientation) 16 17?"Orientation is " 18??cOrientation 19 20?"PaperLength is " 21??AllTrim(Str(structDevMode.dmPaperLength)) 22 23?"PaperWidth is " 24??AllTrim(Str(structDevMode.dmPaperWidth)) 25 26?"Number of copies is " 27??AllTrim(Str(structDevMode.dmCopies)) 28 29? "dmDefaultSource " 30?structDevMode.dmDefaultSource 31 32Wait 33 34FUNCTION StringdmOrientation(nO AS SHORTINT) AS STRING 35 IF nO = DMORIENT_LANDSCAPE 36 RETURN "Landscape" 37 38 ELSEIF nO = DMORIENT_PORTRAIT 39 40 RETURN "Portrait" 41 ELSE 42 RETURN "Unknown" 43 ENDIF