Declare Function GetProfileString Lib "kernel32" _
Alias "GetProfileStringA" _
(ByVal lpAppName As String, _
ByVal lpKeyName As String, _
ByVal lpDefault As String, _
ByVal lpReturnedString As String, _
ByVal nSize As Long) As Long
Declare Function WriteProfileString Lib "kernel32" _
Alias "WriteProfileStringA" _
(ByVal lpszSection As String, _
ByVal lpszKeyName As String, _
ByVal lpszString As String) As Long
Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lparam As String) As Long
Public Const HWND_BROADCAST = &HFFFF
Public Const WM_WININICHANGE = &H1A
Public Const IDOK = &H1 ' OK button was pressed
Public Const IDCANCEL = &H2 ' Cancel button was pressed
Public Const LF_FACESIZE = 32
Type LOGFONT
lfHeight As Long
lfWidth As Long
lfEscapement As Long
lfOrientation As Long
lfWeight As Long
lfItalic As Byte
lfUnderline As Byte
lfStrikeOut As Byte
lfCharSet As Byte
lfOutPrecision As Byte
lfClipPrecision As Byte
lfQuality As Byte
lfPitchAndFamily As Byte
lfFaceName As String * LF_FACESIZE
End Type
'ShellExecute and ShellExecuteEx
Public Const SW_SHOWNORMAL = 1
Public Const SW_SHOWNOACTIVATE = 4
Public Const SW_SHOWNA = 8
Public Const SW_SHOWMINNOACTIVE = 7
Public Const SW_SHOWMINIMIZED = 2
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_SHOWDEFAULT = 10
Public Const SW_SHOW = 5
Public Const SEE_MASK_NOCLOSEPROCESS = &H40
Public Type SHELLEXECUTEINFO
cbSize As Long
fMask As Long
hwnd As Long
lpVerb As String
lpFile As String
lpParameters As String
lpDirectory As String
nShow As Long
hInstApp As Long
' Optional fields
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Declare Function ShellExecuteEx Lib "shell32.dll" Alias "ShellExecuteExA" (lpShellExecuteInfo As SHELLEXECUTEINFO) As Long
Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Public Function BorderTypes(ByVal eliBorders As eBorderType) As String
Select Case eliBorders
Case eBordersNil
BorderTypes = "Nil"
Case eBordersOff
BorderTypes = "Off"
Case eBordersOn
BorderTypes = "On"
Case eBordersSmart
BorderTypes = "Smart"
Case eBordersMax
BorderTypes = "Max"
Case Else
BorderTypes = "Unknown type " & eliBorders
End Select
End Function
Public Function LayoutTypes(ByVal eliLayout As eLayoutType) As String
Select Case eliLayout
Case eLayoutNil
LayoutTypes = "Nil"
Case eLayoutBypass
LayoutTypes = "Bypass"
Case eLayout1
LayoutTypes = "1 up"
Case eLayout2
LayoutTypes = "2 up"
Case eLayout4
LayoutTypes = "4 up"
Case eLayout8
LayoutTypes = "8 up"
Case eLayoutBooklet
LayoutTypes = "Booklet"
Case Else
LayoutTypes = "Unknown type " & eliLayout
End Select
End Function
Public Function OrderTypes(ByVal eliOrder As eOrderType) As String
Select Case eliOrder
Case eOrderAcross, 1
OrderTypes = "Across"
Case eOrderDown
OrderTypes = "Down"
Case Else
OrderTypes = "Unknown type " & eliOrder
End Select
End Function
Public Function ErrorText(ByVal FpErrorVal As FpError) As String
Select Case FpErrorVal
Case eFpeNil
ErrorText = "sentinel value"
Case eFpeOK
ErrorText = "no error"
Case eFpeNotImplemented
ErrorText = "functionality is not implemented"
Case eFpeBadParam
ErrorText = "invalid parameter"
Case eFpeNoMem
ErrorText = "out of memory"
Case eFpeBadVersion
ErrorText = " incompatible FinePrint version"
Case eFpeNotFound
ErrorText = "item was not found"
Case eFpeNoDispatcher
ErrorText = "could not locate the dispatcher"
Case eFpeDispatcherErr
ErrorText = "an error occurred in the dispatcher"
Case eFpeNoUi
ErrorText = "could not locate the UI"
Case eFpeUiErr
ErrorText = "an error occurred in the UI"
Case eFpeTimeout
ErrorText = "a timeout expired"
Case eFpePrinter
ErrorText = "error on the dest printer"
Case eFpeIo
ErrorText = "file I/O error"
Case eFpeMax
ErrorText = "sentinel value"
Case Else
ErrorText = "Unknown error " & FpErrorVal
End Select
End Function
Public Function MarginTypes(ByVal eliMargins As eMarginType) As String
Select Case eliMargins
Case eMarginNil
MarginTypes = "Nil"
Case eMarginNone
MarginTypes = "None"
Case eMarginSmall
MarginTypes = "Small"
Case eMarginMedium
MarginTypes = "Medium"
Case eMarginLarge
MarginTypes = "Large"
Case eMarginOrig
MarginTypes = "Original"
Case eMarginMax
MarginTypes = "sentinel value"
Case Else
MarginTypes = "Unknown type " & eliMargins
End Select
End Function
Public Function Unsigned2Signed(ByVal lngUnsigned As Long) As Long