String String String String String String String String String String String String String String
String String String String String String String String String String String String String String
String String String String String String String String String String String String String String
Type aht_tagDeviceRec
drDeviceName As String
drDriverName As String
drPort As String
End Type
Type aht_tagDEVMODE
dmDeviceName(1 To 32) As Byte
dmSpecVersion As Integer
dmDriverVersion As Integer
dmSize As Integer
dmDriverExtra As Integer
dmFields As Long
dmOrientation As Integer
dmPaperSize As Integer
dmPaperLength As Integer
dmPaperWidth As Integer
dmScale As Integer
dmCopies As Integer
dmDefaultSource As Integer
dmPrintQuality As Integer
dmColor As Integer
dmDuplex As Integer
dmYResolution As Integer
dmTTOption As Integer
dmCollate As Integer
dmFormName(1 To 32) As Byte
dmLogPixels As Integer
dmBitsPerPixel As Long
dmPelsWidth As Long
dmPelsHeight As Long
dmDisplayFlags As Long
dmDisplayFrequency As Long
dmICMMethod As Long
dmICMIntent As Long
dmMediaType As Long
dmDitherType As Long
dmICCManufacturer As Long
dmICCModel As Long
dmDriverExtraBytes(1 To 1024) As Byte
End Type
Type aht_tagDEVMODEStr
DMStr As String * 1024
End Type
Type aht_tagDEVNAMES
dnDriverOffset As Integer
dnDeviceOffset As Integer
dnOutputOffset As Integer
dnDefault As Integer
End Type
Type aht_tagDEVNAMEStr
DNStr As String * 4
End Type
Type aht_tagMIP
xLeftMargin As Long
yTopMargin As Long
xRightMargin As Long
yBotMargin As Long
fDataOnly As Long
xFormSize As Long
yFormSize As Long
fDefaultSize As Long
cxColumns As Long
xFormSpacing As Long
yFormSpacing As Long
radItemOrder As Long
fFastPrinting As Long
fDataSheet As Long
End Type
Type aht_tagMIPSTR
MIPStr As String * 28
End Type
Function ahtFillPrinterList(ctl As Control, varID As Variant, varRow As
Variant, varCol As Variant, varCode As Variant)
Case acLBOpen
varRetval = Timer
Case acLBGetRowCount
varRetval = intCount
Case acLBGetColumnCount
varRetval = 1
Case acLBGetValue
varRetval = atagDevices(varRow + 1).drDeviceName & " sur " & _
atagDevices(varRow + 1).drPort
Case acLBEnd
Erase atagDevices
End Select
ahtFillPrinterList = varRetval
End Function
varPrinters = ahtGetProfileSection("DEVICES")
ahtSetDefaultPrinter = (aht_apiWriteProfileString("Windows", _
"Device", strBuffer) <> 0)
End Function
strDelimiter = Left(strDelimiter, 1)
ahtGetTokenExit:
Exit Function
ahtGetTokenErr:
MsgBox "Error in ahtGetToken: " & Error & " (" & Err & ")"
Resume ahtGetTokenExit
End Function
strBuffer = String(MAX_SIZE, 0)
intChars = aht_apiGetPrivateProfileString(strGroup, strItem, "",
strBuffer, MAX_SIZE, strFile)
ahtGetPrivateIniString = Left(strBuffer, intChars)
End Function
strBuffer = Space(MAX_SECTION)
intCount = aht_apiGetPrivateProfileSection(strGroup, strBuffer,
MAX_SECTION, strFile)
ahtGetPrivateProfileSection = Left(strBuffer, intCount)
End Function
strBuffer = Space(MAX_SECTION)
intCount = aht_apiGetProfileSection(strGroup, strBuffer, MAX_SECTION)
ahtGetProfileSection = Left(strBuffer, intCount)
End Function
Function ahtGetINIString(ByVal strGroup As String, ByVal strItem As String)
As Variant
strBuffer = String(MAX_SIZE, 0)
intChars = aht_apiGetProfileString(strGroup, strItem, "", strBuffer,
MAX_SIZE)
ahtGetINIString = Left(strBuffer, intChars)
End Function