Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Win98 and Printing Custom Paper Sizes
Message
 
À
05/12/2003 14:42:07
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00856403
Message ID:
00856989
Vues:
22
I'm not sure about your question, but if you are using the DevMode structure ...

Because in the devmode structure, you got position 49(2dig) for
paperlenght, and pos 51(2dig) for paperwidth

You must transfert those 2 digit like this...

*paper length
cbuf=substr(cdevm, 49,2)
nhei=Asc(SUBSTR(cbuf, 1,1)) + ;
Asc(SUBSTR(cbuf, 2,1)) * 256 +;
Asc(SUBSTR(cbuf, 3,1)) * 65536 +;
Asc(SUBSTR(cbuf, 4,1)) * 16777216


same thing for paper width
...


In fact in win98 the papersize# is always 256
and win2k & + the number change as the user
define a form.

(see devmode struc. below)

If this could help you....


*|typedef struct _devicemode {
*| BCHAR dmDeviceName[CCHDEVICENAME]; 0:32
*| WORD dmSpecVersion; 32:2 33
*| WORD dmDriverVersion; 34:2 35
*| WORD dmSize; 36:2 37
*| WORD dmDriverExtra; 38:2 39
*| DWORD dmFields; 40:4 41
*| union {
*| struct {
*| short dmOrientation; 44:2 45
*| short dmPaperSize; 46:2 46
*| short dmPaperLength; 48:2 49
*| short dmPaperWidth; 50:2 51
*| short dmScale; 52:2 53
*| short dmCopies; 54:2 55
*| short dmDefaultSource; 56:2 57
*| short dmPrintQuality; 58:2 59
*| };
*| POINTL dmPosition; 44:8
*| DWORD dmDisplayOrientation; 44:4
*| DWORD dmDisplayFixedOutput; 44:4
*| };
*| short dmColor; 60:2 61
*| short dmDuplex; 62:2 63
*| short dmYResolution; 64:2 65
*| short dmTTOption; 66:2 67
*| short dmCollate; 68:2 69
*| BYTE dmFormName[CCHFORMNAME]; 70:32 71
*| WORD dmLogPixels; 102:2
*| DWORD dmBitsPerPel; 104:4
*| DWORD dmPelsWidth; 108:4
*| DWORD dmPelsHeight; 112:4
*| union {
*| DWORD dmDisplayFlags; 116:4
*| DWORD dmNup; 116:4
*| }
*| DWORD dmDisplayFrequency; 120:4
*|#if(WINVER >= 0x0400)
*| DWORD dmICMMethod; 124:4
*| DWORD dmICMIntent; 128:4
*| DWORD dmMediaType; 132:4
*| DWORD dmDitherType; 136:4
*| DWORD dmReserved1; 140:4
*| DWORD dmReserved2; 144:4
*|#if (WINVER >= 0x0500) || (_WIN32_WINNT >= 0x0400)
*| DWORD dmPanningWidth; 148:4
*| DWORD dmPanningHeight; 152:4
*|#endif
*|#endif /* WINVER >= 0x0400 */
*|} DEVMODE; total bytes = 156
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform