Information générale
Catégorie:
Fonctions Windows API
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement