Creo que los controles .ocx se instalan con el vb y no vienen por defecto con el windows
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCitar118784 bytesSon posiblemente:
Citar116 kbA si que es lo mismo y esta bien y funciona.
'esto sería un especie de blinder (por lo menos las bases)
dfichero1 = Space(LOF(1))
dfichero2 = Space(LOF(1))
dfichero3 = Space(LOF(1))
Open fichero1 For Binary Access Read As #1 'sacamos la aplicación que infectaremos
Get #1, , dfichero1 'leemos los contenidos
Close #1
Open fichero2 For Binary Access Read As #2 'sacamos la aplicación que infectaremos
Get #2, , dfichero2 'leemos el otro
Close #2
Open truco For Binary Access Read As #3 'sacamos la aplicación que infectaremos
Get #3, , dfichero3 'leemos el programa base
Close #3
'el fichero3 devería de llevar los codes para sacar a su vez las dos aplicaciones
'y permitir su ejecución
Open rutae For Binary Access Write As #4 'la ruta donde creamos la nueva aplicación
Put #4, , dfichero3 'metemos el programa que ejecutará a su vez a estos dos
Put #4, , dfichero1 'metemos el fichero que será ejecutado en primer lugar
Put #4, , dfichero2 'metemos el fichero que será ejecutado en segundo lugar
Close #4 'cerramos
'Faltan muchas cosas como por ejemplo indicarle a programa que leemos en primer
'lugar el peso de cada fichero y por adonde tiene que cortar para ejecutar cada uno por separado
'Pero esto es solo una base que hos puede ser util
'Saludos xD
tam = FileLen("C:\nombredelarchivo.txt")
Public Const PROCESS_HEAP_REGION = &H1
Public Const PROCESS_HEAP_UNCOMMITTED_RANGE = &H2
Public Const PROCESS_HEAP_ENTRY_BUSY = &H4
Public Const PROCESS_HEAP_ENTRY_MOVEABLE = &H10
Public Const PROCESS_HEAP_ENTRY_DDESHARE = &H20
Declare Function HeapLock Lib "kernel32" Alias "HeapLock" (ByVal hHeap As Long) As Long
Declare Function HeapUnlock Lib "kernel32" Alias "HeapUnlock" (ByVal hHeap As Long) As Long
' GetBinaryType return values.
Public Const SCS_32BIT_BINARY = 0
Public Const SCS_DOS_BINARY = 1
Public Const SCS_WOW_BINARY = 2
Public Const SCS_PIF_BINARY = 3
Public Const SCS_POSIX_BINARY = 4
Public Const SCS_OS216_BINARY = 5
Declare Function GetBinaryType Lib "kernel32" Alias "GetBinaryTypeA" (ByVal lpApplicationName As String, lpBinaryType As Long) As Long
Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathName" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Declare Function GetProcessAffinityMask Lib "kernel32" Alias "GetProcessAffinityMask" (ByVal hProcess As Long, lpProcessAffinityMask As Long, SystemAffinityMask As Long) As Long
' Logon Support APIs
Public Const LOGON32_LOGON_INTERACTIVE = 2
Public Const LOGON32_LOGON_BATCH = 4
Public Const LOGON32_LOGON_SERVICE = 5
Public Const LOGON32_PROVIDER_DEFAULT = 0
Public Const LOGON32_PROVIDER_WINNT35 = 1
Declare Function LogonUser Lib "ADVAPI32.DLL" Alias "LogonUserA" (ByVal lpszUsername As String, ByVal lpszDomain As String, ByVal lpszPassword As String, ByVal dwLogonType As Long, ByVal dwLogonProvider As Long, phToken As Long) As Long
Declare Function ImpersonateLoggedOnUser Lib "kernel32" Alias "ImpersonateLoggedOnUser" (ByVal hToken As Long) As Long
Declare Function CreateProcessAsUser Lib "kernel32" Alias "CreateProcessAsUserA" (ByVal hToken As Long, ByVal lpApplicationName As String, ByVal lpCommandLine As String, ByVal lpProcessAttributes As SECURITY_ATTRIBUTES, ByVal lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, ByVal lpEnvironment As String, ByVal lpCurrentDirectory As String, ByVal lpStartupInfo As STARTUPINFO, ByVal lpProcessInformation As PROCESS_INFORMATION) As Long
' Performance counter API's
Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128 ' Maintenance string for PSS usage
End Type
' dwPlatformId defines:
'
Public Const VER_PLATFORM_WIN32s = 0
Public Const VER_PLATFORM_WIN32_WINDOWS = 1
Public Const VER_PLATFORM_WIN32_NT = 2
Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (ByVal lpVersionInformation As OSVERSIONINFO) As Long
' Power Management APIs
Public Const AC_LINE_OFFLINE = &H0
Public Const AC_LINE_ONLINE = &H1
Public Const AC_LINE_BACKUP_POWER = &H2
Public Const AC_LINE_UNKNOWN = &HFF
Public Const BATTERY_FLAG_HIGH = &H1
Public Const BATTERY_FLAG_LOW = &H2
Public Const BATTERY_FLAG_CRITICAL = &H4
Public Const BATTERY_FLAG_CHARGING = &H8
Public Const BATTERY_FLAG_NO_BATTERY = &H80
Public Const BATTERY_FLAG_UNKNOWN = &HFF
Public Const BATTERY_PERCENTAGE_UNKNOWN = &HFF
Public Const BATTERY_LIFE_UNKNOWN = &HFFFF
Type SYSTEM_POWER_STATUS
ACLineStatus As Byte
BatteryFlag As Byte
BatteryLifePercent As Byte
Reserved1 As Byte
BatteryLifeTime As Long
BatteryFullLifeTime As Long
End Type
Declare Function GetSystemPowerStatus Lib "kernel32" Alias "GetSystemPowerStatus" (lpSystemPowerStatus As SYSTEM_POWER_STATUS) As Long
Declare Function SetSystemPowerState Lib "kernel32" Alias "SetSystemPowerState" (ByVal fSuspend As Long, ByVal fForce As Long) As Long
' * commdlg.h -- This module defines the 32-Bit Common Dialog APIs *
Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Declare Function GetSaveFileName Lib "comdlg32.dll" Alias "GetSaveFileNameA" (pOpenfilename As OPENFILENAME) As Long
Declare Function GetFileTitle Lib "comdlg32.dll" Alias "GetFileTitleA" (ByVal lpszFile As String, ByVal lpszTitle As String, ByVal cbBuf As Integer) As Integer
Public Const OFN_READONLY = &H1
Public Const OFN_OVERWRITEPROMPT = &H2
Public Const OFN_HIDEREADONLY = &H4
Public Const OFN_NOCHANGEDIR = &H8
Public Const OFN_SHOWHELP = &H10
Public Const OFN_ENABLEHOOK = &H20
Public Const OFN_ENABLETEMPLATE = &H40
Public Const OFN_ENABLETEMPLATEHANDLE = &H80
Public Const OFN_NOVALIDATE = &H100
Public Const OFN_ALLOWMULTISELECT = &H200
Public Const OFN_EXTENSIONDIFFERENT = &H400
Public Const OFN_PATHMUSTEXIST = &H800
Public Const OFN_FILEMUSTEXIST = &H1000
Public Const OFN_CREATEPROMPT = &H2000
Public Const OFN_SHAREAWARE = &H4000
Public Const OFN_NOREADONLYRETURN = &H8000
Public Const OFN_NOTESTFILECREATE = &H10000
Public Const OFN_NONETWORKBUTTON = &H20000
Public Const OFN_NOLONGNAMES = &H40000 ' force no long names for 4.x modules
Public Const OFN_EXPLORER = &H80000 ' new look commdlg
Public Const OFN_NODEREFERENCELINKS = &H100000
Public Const OFN_LONGNAMES = &H200000 ' force long names for 3.x modules
Public Const OFN_SHAREFALLTHROUGH = 2
Public Const OFN_SHARENOWARN = 1
Public Const OFN_SHAREWARN = 0
Type NMHDR
hwndFrom As Long
idfrom As Long
code As Long
End Type
Type OFNOTIFY
hdr As NMHDR
lpOFN As OPENFILENAME
pszFile As String ' May be NULL
End Type
Public Const CDM_FIRST = (WM_USER + 100)
Public Const CDM_LAST = (WM_USER + 200)
Public Const CDM_GETSPEC = (CDM_FIRST + &H0)
Public Const CDM_GETFILEPATH = (CDM_FIRST + &H1)
Public Const CDM_GETFOLDERPATH = (CDM_FIRST + &H2)
Public Const CDM_GETFOLDERIDLIST = (CDM_FIRST + &H3)
Public Const CDM_SETCONTROLTEXT = (CDM_FIRST + &H4)
Public Const CDM_HIDECONTROL = (CDM_FIRST + &H5)
Public Const CDM_SETDEFEXT = (CDM_FIRST + &H6)
Type CHOOSECOLOR
lStructSize As Long
hwndOwner As Long
hInstance As Long
rgbResult As Long
lpCustColors As Long
flags As Long
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
Declare Function ChooseColor Lib "comdlg32.dll" Alias "ChooseColorA" (pChoosecolor As CHOOSECOLOR) As Long
Public Const CC_RGBINIT = &H1
Public Const CC_FULLOPEN = &H2
Public Const CC_PREVENTFULLOPEN = &H4
Public Const CC_SHOWHELP = &H8
Public Const CC_ENABLEHOOK = &H10
Public Const CC_ENABLETEMPLATE = &H20
Public Const CC_ENABLETEMPLATEHANDLE = &H40
Public Const CC_SOLIDCOLOR = &H80
Public Const CC_ANYCOLOR = &H100
Type FINDREPLACE
lStructSize As Long ' size of this struct 0x20
hwndOwner As Long ' handle to owner's window
hInstance As Long ' instance handle of.EXE that
' contains cust. dlg. template
flags As Long ' one or more of the FR_??
lpstrFindWhat As String ' ptr. to search string
lpstrReplaceWith As String ' ptr. to replace string
wFindWhatLen As Integer ' size of find buffer
wReplaceWithLen As Integer ' size of replace buffer
lCustData As Long ' data passed to hook fn.
lpfnHook As Long ' ptr. to hook fn. or NULL
lpTemplateName As String ' custom template name
End Type
Public Const FR_DOWN = &H1
Public Const FR_WHOLEWORD = &H2
Public Const FR_MATCHCASE = &H4
Public Const FR_FINDNEXT = &H8
Public Const FR_REPLACE = &H10
Public Const FR_REPLACEALL = &H20
Public Const FR_DIALOGTERM = &H40
Public Const FR_SHOWHELP = &H80
Public Const FR_ENABLEHOOK = &H100
Public Const FR_ENABLETEMPLATE = &H200
Public Const FR_NOUPDOWN = &H400
Public Const FR_NOMATCHCASE = &H800
Public Const FR_NOWHOLEWORD = &H1000
Public Const FR_ENABLETEMPLATEHANDLE = &H2000
Public Const FR_HIDEUPDOWN = &H4000
Public Const FR_HIDEMATCHCASE = &H8000
Public Const FR_HIDEWHOLEWORD = &H10000
Declare Function FindText Lib "comdlg32.dll" Alias "FindTextA " (pFindreplace As FINDREPLACE) As Long
Declare Function ReplaceText Lib "comdlg32.dll" Alias "ReplaceTextA" (pFindreplace As FINDREPLACE) As Long
Type CHOOSEFONT
lStructSize As Long
hwndOwner As Long ' caller's window handle
hdc As Long ' printer DC/IC or NULL
lpLogFont As LOGFONT ' ptr. to a LOGFONT struct
iPointSize As Long ' 10 * size in points of selected font
flags As Long ' enum. type flags
rgbColors As Long ' returned text color
lCustData As Long ' data passed to hook fn.
lpfnHook As Long ' ptr. to hook function
lpTemplateName As String ' custom template name
hInstance As Long ' instance handle of.EXE that
' contains cust. dlg. template
lpszStyle As String ' return the style field here
' must be LF_FACESIZE or bigger
nFontType As Integer ' same value reported to the EnumFonts
' call back with the extra FONTTYPE_
' bits added
MISSING_ALIGNMENT As Integer
nSizeMin As Long ' minimum pt size allowed &
nSizeMax As Long ' max pt size allowed if
' CF_LIMITSIZE is used
End Type
Declare Function ChooseFont Lib "comdlg32.dll" Alias "ChooseFontA" (pChoosefont As CHOOSEFONT) As Long
Public Const CF_SCREENFONTS = &H1
Public Const CF_PRINTERFONTS = &H2
Public Const CF_BOTH = (CF_SCREENFONTS Or CF_PRINTERFONTS)
Public Const CF_SHOWHELP = &H4&
Public Const CF_ENABLEHOOK = &H8&
Public Const CF_ENABLETEMPLATE = &H10&
Public Const CF_ENABLETEMPLATEHANDLE = &H20&
Public Const CF_INITTOLOGFONTSTRUCT = &H40&
Public Const CF_USESTYLE = &H80&
Public Const CF_EFFECTS = &H100&
Public Const CF_APPLY = &H200&
Public Const CF_ANSIONLY = &H400&
Public Const CF_SCRIPTSONLY = CF_ANSIONLY
Public Const CF_NOVECTORFONTS = &H800&
Public Const CF_NOOEMFONTS = CF_NOVECTORFONTS
Public Const CF_NOSIMULATIONS = &H1000&
Public Const CF_LIMITSIZE = &H2000&
Public Const CF_FIXEDPITCHONLY = &H4000&
Public Const CF_WYSIWYG = &H8000 ' must also have CF_SCREENFONTS CF_PRINTERFONTS
Public Const CF_FORCEFONTEXIST = &H10000
Public Const CF_SCALABLEONLY = &H20000
Public Const CF_TTONLY = &H40000
Public Const CF_NOFACESEL = &H80000
Public Const CF_NOSTYLESEL = &H100000
Public Const CF_NOSIZESEL = &H200000
Public Const CF_SELECTSCRIPT = &H400000
Public Const CF_NOSCRIPTSEL = &H800000
Public Const CF_NOVERTFONTS = &H1000000
Public Const SIMULATED_FONTTYPE = &H8000
Public Const PRINTER_FONTTYPE = &H4000
Public Const SCREEN_FONTTYPE = &H2000
Public Const BOLD_FONTTYPE = &H100
Public Const ITALIC_FONTTYPE = &H200
Public Const REGULAR_FONTTYPE = &H400
Public Const WM_CHOOSEFONT_GETLOGFONT = (WM_USER + 1)
Public Const WM_CHOOSEFONT_SETLOGFONT = (WM_USER + 101)
Public Const WM_CHOOSEFONT_SETFLAGS = (WM_USER + 102)
Public Const LBSELCHSTRING = "commdlg_LBSelChangedNotify"
Public Const SHAREVISTRING = "commdlg_ShareViolation"
Public Const FILEOKSTRING = "commdlg_FileNameOK"
Public Const COLOROKSTRING = "commdlg_ColorOK"
Public Const SETRGBSTRING = "commdlg_SetRGBColor"
Public Const HELPMSGSTRING = "commdlg_help"
Public Const FINDMSGSTRING = "commdlg_FindReplace"
Public Const CD_LBSELNOITEMS = -1
Public Const CD_LBSELCHANGE = 0
Public Const CD_LBSELSUB = 1
Public Const CD_LBSELADD = 2
Type PRINTDLG
lStructSize As Long
hwndOwner As Long
hDevMode As Long
hDevNames As Long
hdc As Long
flags As Long
nFromPage As Integer
nToPage As Integer
nMinPage As Integer
nMaxPage As Integer
nCopies As Integer
hInstance As Long
lCustData As Long
lpfnPrintHook As Long
lpfnSetupHook As Long
lpPrintTemplateName As String
lpSetupTemplateName As String
hPrintTemplate As Long
hSetupTemplate As Long
End Type
Declare Function PrintDlg Lib "comdlg32.dll" Alias "PrintDlgA" (pPrintdlg As PRINTDLG) As Long
Public Const PD_ALLPAGES = &H0
Public Const PD_SELECTION = &H1
Public Const PD_PAGENUMS = &H2
Public Const PD_NOSELECTION = &H4
Public Const PD_NOPAGENUMS = &H8
Public Const PD_COLLATE = &H10
Public Const PD_PRINTTOFILE = &H20
Public Const PD_PRINTSETUP = &H40
Public Const PD_NOWARNING = &H80
Public Const PD_RETURNDC = &H100
Public Const PD_RETURNIC = &H200
Public Const PD_RETURNDEFAULT = &H400
Public Const PD_SHOWHELP = &H800
Public Const PD_ENABLEPRINTHOOK = &H1000
Public Const PD_ENABLESETUPHOOK = &H2000
Public Const PD_ENABLEPRINTTEMPLATE = &H4000
Public Const PD_ENABLESETUPTEMPLATE = &H8000
Public Const PD_ENABLEPRINTTEMPLATEHANDLE = &H10000
Public Const PD_ENABLESETUPTEMPLATEHANDLE = &H20000
Public Const PD_USEDEVMODECOPIES = &H40000
Public Const PD_USEDEVMODECOPIESANDCOLLATE = &H40000
Public Const PD_DISABLEPRINTTOFILE = &H80000
Public Const PD_HIDEPRINTTOFILE = &H100000
Public Const PD_NONETWORKBUTTON = &H200000
Type DEVNAMES
wDriverOffset As Integer
wDeviceOffset As Integer
wOutputOffset As Integer
wDefault As Integer
End Type
Public Const DN_DEFAULTPRN = &H1
Declare Function CommDlgExtendedError Lib "comdlg32.dll" Alias "CommDlgExtendedError" () As Long
Public Const WM_PSD_PAGESETUPDLG = (WM_USER)
Public Const WM_PSD_FULLPAGERECT = (WM_USER + 1)
Public Const WM_PSD_MINMARGINRECT = (WM_USER + 2)
Public Const WM_PSD_MARGINRECT = (WM_USER + 3)
Public Const WM_PSD_GREEKTEXTRECT = (WM_USER + 4)
Public Const WM_PSD_ENVSTAMPRECT = (WM_USER + 5)
Public Const WM_PSD_YAFULLPAGERECT = (WM_USER + 6)
Type PAGESETUPDLG
lStructSize As Long
hwndOwner As Long
hDevMode As Long
hDevNames As Long
flags As Long
ptPaperSize As POINTAPI
rtMinMargin As Rect
rtMargin As Rect
hInstance As Long
lCustData As Long
lpfnPageSetupHook As Long
lpfnPagePaintHook As Long
lpPageSetupTemplateName As String
hPageSetupTemplate As Long
End Type
Declare Function PageSetupDlg Lib "comdlg32.dll" Alias "PageSetupDlgA" (pPagesetupdlg As PAGESETUPDLG) As Long
Public Const PSD_DEFAULTMINMARGINS = &H0 ' default (printer's)
Public Const PSD_INWININIINTLMEASURE = &H0 ' 1st of 4 possible
Public Const PSD_MINMARGINS = &H1 ' use caller's
Public Const PSD_MARGINS = &H2 ' use caller's
Public Const PSD_INTHOUSANDTHSOFINCHES = &H4 ' 2nd of 4 possible
Public Const PSD_INHUNDREDTHSOFMILLIMETERS = &H8 ' 3rd of 4 possible
Public Const PSD_DISABLEMARGINS = &H10
Public Const PSD_DISABLEPRINTER = &H20
Public Const PSD_NOWARNING = &H80 ' must be same as PD_*
Public Const PSD_DISABLEORIENTATION = &H100
Public Const PSD_RETURNDEFAULT = &H400 ' must be same as PD_*
Public Const PSD_DISABLEPAPER = &H200
Public Const PSD_SHOWHELP = &H800 ' must be same as PD_*
Public Const PSD_ENABLEPAGESETUPHOOK = &H2000 ' must be same as PD_*
Public Const PSD_ENABLEPAGESETUPTEMPLATE = &H8000 ' must be same as PD_*
Public Const PSD_ENABLEPAGESETUPTEMPLATEHANDLE = &H20000 ' must be same as PD_*
Public Const PSD_ENABLEPAGEPAINTHOOK = &H40000
Public Const PSD_DISABLEPAGEPAINTING = &H80000
Type MCI_GENERIC_PARMS
dwCallback As Long
End Type
Type MCI_OPEN_PARMS
dwCallback As Long
wDeviceID As Long
lpstrDeviceType As String
lpstrElementName As String
lpstrAlias As String
End Type
Type MCI_PLAY_PARMS
dwCallback As Long
dwFrom As Long
dwTo As Long
End Type
Type MCI_SEEK_PARMS
dwCallback As Long
dwTo As Long
End Type
Type MCI_STATUS_PARMS
dwCallback As Long
dwReturn As Long
dwItem As Long
dwTrack As Integer
End Type
Type MCI_INFO_PARMS
dwCallback As Long
lpstrReturn As String
dwRetSize As Long
End Type
Type MCI_GETDEVCAPS_PARMS
dwCallback As Long
dwReturn As Long
dwIten As Long
End Type
Type MCI_SYSINFO_PARMS
dwCallback As Long
lpstrReturn As String
dwRetSize As Long
dwNumber As Long
wDeviceType As Long
End Type
Type MCI_SET_PARMS
dwCallback As Long
dwTimeFormat As Long
dwAudio As Long
End Type
Type MCI_BREAK_PARMS
dwCallback As Long
nVirtKey As Long
hwndBreak As Long
End Type
Type MCI_SOUND_PARMS
dwCallback As Long
lpstrSoundName As String
End Type
Type MCI_SAVE_PARMS
dwCallback As Long
lpFileName As String
End Type
Type MCI_LOAD_PARMS
dwCallback As Long
lpFileName As String
End Type
Type MCI_RECORD_PARMS
dwCallback As Long
dwFrom As Long
dwTo As Long
End Type
Public Const MCI_VD_MODE_PARK = (MCI_VD_OFFSET + 1)
' return ID's for videodisc MCI_GETDEVCAPS command
' flag for dwReturn field of MCI_STATUS_PARMS
' MCI_STATUS command, (dwItem == MCI_VD_STATUS_MEDIA_TYPE)
Public Const MCI_VD_MEDIA_CLV = (MCI_VD_OFFSET + 2)
Public Const MCI_VD_MEDIA_CAV = (MCI_VD_OFFSET + 3)
Public Const MCI_VD_MEDIA_OTHER = (MCI_VD_OFFSET + 4)
Public Const MCI_VD_FORMAT_TRACK = &H4001
' flags for dwFlags parameter of MCI_PLAY command message
Public Const MCI_VD_PLAY_REVERSE = &H10000
Public Const MCI_VD_PLAY_FAST = &H20000
Public Const MCI_VD_PLAY_SPEED = &H40000
Public Const MCI_VD_PLAY_SCAN = &H80000
Public Const MCI_VD_PLAY_SLOW = &H100000
' flag for dwFlags parameter of MCI_SEEK command message
Public Const MCI_VD_SEEK_REVERSE = &H10000
' flags for dwItem field of MCI_STATUS_PARMS parameter block
Public Const MCI_VD_STATUS_SPEED = &H4002&
Public Const MCI_VD_STATUS_FORWARD = &H4003&
Public Const MCI_VD_STATUS_MEDIA_TYPE = &H4004&
Public Const MCI_VD_STATUS_SIDE = &H4005&
Public Const MCI_VD_STATUS_DISC_SIZE = &H4006&
' flags for dwFlags parameter of MCI_GETDEVCAPS command message
Public Const MCI_VD_GETDEVCAPS_CLV = &H10000
Public Const MCI_VD_GETDEVCAPS_CAV = &H20000
Public Const MCI_VD_SPIN_UP = &H10000
Public Const MCI_VD_SPIN_DOWN = &H20000
' flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block
Public Const MCI_VD_GETDEVCAPS_CAN_REVERSE = &H4002&
Public Const MCI_VD_GETDEVCAPS_FAST_RATE = &H4003&
Public Const MCI_VD_GETDEVCAPS_SLOW_RATE = &H4004&
Public Const MCI_VD_GETDEVCAPS_NORMAL_RATE = &H4005&
' flags for the dwFlags parameter of MCI_STEP command message
Public Const MCI_VD_STEP_FRAMES = &H10000
Public Const MCI_VD_STEP_REVERSE = &H20000
' flag for the MCI_ESCAPE command message
Public Const MCI_VD_ESCAPE_STRING = &H100&
Type MCI_VD_PLAY_PARMS
dwCallback As Long
dwFrom As Long
dwTo As Long
dwSpeed As Long
End Type
Type MCI_VD_STEP_PARMS
dwCallback As Long
dwFrames As Long
End Type
Type MCI_VD_ESCAPE_PARMS
dwCallback As Long
lpstrCommand As String
End Type
Public Const MCI_WAVE_PCM = (MCI_WAVE_OFFSET + 0)
Public Const MCI_WAVE_MAPPER = (MCI_WAVE_OFFSET + 1)
' flags for the dwFlags parameter of MCI_OPEN command message
Public Const MCI_WAVE_OPEN_BUFFER = &H10000
' flags for the dwFlags parameter of MCI_SET command message
Public Const MCI_WAVE_SET_FORMATTAG = &H10000
Public Const MCI_WAVE_SET_CHANNELS = &H20000
Public Const MCI_WAVE_SET_SAMPLESPERSEC = &H40000
Public Const MCI_WAVE_SET_AVGBYTESPERSEC = &H80000
Public Const MCI_WAVE_SET_BLOCKALIGN = &H100000
Public Const MCI_WAVE_SET_BITSPERSAMPLE = &H200000
' flags for the dwFlags parameter of MCI_STATUS, MCI_SET command messages
Public Const MCI_WAVE_INPUT = &H400000
Public Const MCI_WAVE_OUTPUT = &H800000
' flags for the dwItem field of MCI_STATUS_PARMS parameter block
Public Const MCI_WAVE_STATUS_FORMATTAG = &H4001&
Public Const MCI_WAVE_STATUS_CHANNELS = &H4002&
Public Const MCI_WAVE_STATUS_SAMPLESPERSEC = &H4003&
Public Const MCI_WAVE_STATUS_AVGBYTESPERSEC = &H4004&
Public Const MCI_WAVE_STATUS_BLOCKALIGN = &H4005&
Public Const MCI_WAVE_STATUS_BITSPERSAMPLE = &H4006&
Public Const MCI_WAVE_STATUS_LEVEL = &H4007&
' flags for the dwFlags parameter of MCI_SET command message
Public Const MCI_WAVE_SET_ANYINPUT = &H4000000
Public Const MCI_WAVE_SET_ANYOUTPUT = &H8000000
' flags for the dwFlags parameter of MCI_GETDEVCAPS command message
Public Const MCI_WAVE_GETDEVCAPS_INPUTS = &H4001&
Public Const MCI_WAVE_GETDEVCAPS_OUTPUTS = &H4002&
Type MCI_WAVE_OPEN_PARMS
dwCallback As Long
wDeviceID As Long
lpstrDeviceType As String
lpstrElementName As String
lpstrAlias As String
dwBufferSeconds As Long
End Type
Type MCI_WAVE_DELETE_PARMS
dwCallback As Long
dwFrom As Long
dwTo As Long
End Type
Type MCI_WAVE_SET_PARMS
dwCallback As Long
dwTimeFormat As Long
dwAudio As Long
wInput As Long
wOutput As Long
wFormatTag As Integer
wReserved2 As Integer
nChannels As Integer
wReserved3 As Integer
nSamplesPerSec As Long
nAvgBytesPerSec As Long
nBlockAlign As Integer
wReserved4 As Integer
wBitsPerSample As Integer
wReserved5 As Integer
End Type
' flags for the dwReturn field of MCI_STATUS_PARMS parameter block
' MCI_STATUS command, (dwItem == MCI_SEQ_STATUS_DIVTYPE)
Public Const MCI_SEQ_DIV_PPQN = (0 + MCI_SEQ_OFFSET)
Public Const MCI_SEQ_DIV_SMPTE_24 = (1 + MCI_SEQ_OFFSET)
Public Const MCI_SEQ_DIV_SMPTE_25 = (2 + MCI_SEQ_OFFSET)
Public Const MCI_SEQ_DIV_SMPTE_30DROP = (3 + MCI_SEQ_OFFSET)
Public Const MCI_SEQ_DIV_SMPTE_30 = (4 + MCI_SEQ_OFFSET)
' flags for the dwMaster field of MCI_SEQ_SET_PARMS parameter block
' MCI_SET command, (dwFlags == MCI_SEQ_SET_MASTER)
Public Const MCI_SEQ_FORMAT_SONGPTR = &H4001
Public Const MCI_SEQ_FILE = &H4002
Public Const MCI_SEQ_MIDI = &H4003
Public Const MCI_SEQ_SMPTE = &H4004
Public Const MCI_SEQ_NONE = 65533
Public Const MCI_SEQ_MAPPER = 65535
' flags for the dwItem field of MCI_STATUS_PARMS parameter block
Public Const MCI_SEQ_STATUS_TEMPO = &H4002&
Public Const MCI_SEQ_STATUS_PORT = &H4003&
Public Const MCI_SEQ_STATUS_SLAVE = &H4007&
Public Const MCI_SEQ_STATUS_MASTER = &H4008&
Public Const MCI_SEQ_STATUS_OFFSET = &H4009&
Public Const MCI_SEQ_STATUS_DIVTYPE = &H400A&
' flags for the dwFlags parameter of MCI_SET command message
Public Const MCI_SEQ_SET_TEMPO = &H10000
Public Const MCI_SEQ_SET_PORT = &H20000
Public Const MCI_SEQ_SET_SLAVE = &H40000
Public Const MCI_SEQ_SET_MASTER = &H80000
Public Const MCI_SEQ_SET_OFFSET = &H1000000
Type MCI_SEQ_SET_PARMS
dwCallback As Long
dwTimeFormat As Long
dwAudio As Long
dwTempo As Long
dwPort As Long
dwSlave As Long
dwMaster As Long
dwOffset As Long
End Type
' flags for dwFlags parameter of MCI_OPEN command message
Public Const MCI_ANIM_OPEN_WS = &H10000
Public Const MCI_ANIM_OPEN_PARENT = &H20000
Public Const MCI_ANIM_OPEN_NOSTATIC = &H40000
' flags for dwFlags parameter of MCI_PLAY command message
Public Const MCI_ANIM_PLAY_SPEED = &H10000
Public Const MCI_ANIM_PLAY_REVERSE = &H20000
Public Const MCI_ANIM_PLAY_FAST = &H40000
Public Const MCI_ANIM_PLAY_SLOW = &H80000
Public Const MCI_ANIM_PLAY_SCAN = &H100000
' flags for dwFlags parameter of MCI_STEP command message
Public Const MCI_ANIM_STEP_REVERSE = &H10000
Public Const MCI_ANIM_STEP_FRAMES = &H20000
' flags for dwItem field of MCI_STATUS_PARMS parameter block
Public Const MCI_ANIM_STATUS_SPEED = &H4001&
Public Const MCI_ANIM_STATUS_FORWARD = &H4002&
Public Const MCI_ANIM_STATUS_HWND = &H4003&
Public Const MCI_ANIM_STATUS_HPAL = &H4004&
Public Const MCI_ANIM_STATUS_STRETCH = &H4005&
' flags for the dwFlags parameter of MCI_INFO command message
Public Const MCI_ANIM_INFO_TEXT = &H10000
' flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block
Public Const MCI_ANIM_GETDEVCAPS_CAN_REVERSE = &H4001&
Public Const MCI_ANIM_GETDEVCAPS_FAST_RATE = &H4002&
Public Const MCI_ANIM_GETDEVCAPS_SLOW_RATE = &H4003&
Public Const MCI_ANIM_GETDEVCAPS_NORMAL_RATE = &H4004&
Public Const MCI_ANIM_GETDEVCAPS_PALETTES = &H4006&
Public Const MCI_ANIM_GETDEVCAPS_CAN_STRETCH = &H4007&
Public Const MCI_ANIM_GETDEVCAPS_MAX_WINDOWS = &H4008&
' flags for the MCI_REALIZE command message
Public Const MCI_ANIM_REALIZE_NORM = &H10000
Public Const MCI_ANIM_REALIZE_BKGD = &H20000
' flags for dwFlags parameter of MCI_WINDOW command message
Public Const MCI_ANIM_WINDOW_HWND = &H10000
Public Const MCI_ANIM_WINDOW_STATE = &H40000
Public Const MCI_ANIM_WINDOW_TEXT = &H80000
Public Const MCI_ANIM_WINDOW_ENABLE_STRETCH = &H100000
Public Const MCI_ANIM_WINDOW_DISABLE_STRETCH = &H200000
' flags for hWnd field of MCI_ANIM_WINDOW_PARMS parameter block
' MCI_WINDOW command message, (dwFlags == MCI_ANIM_WINDOW_HWND)
Public Const MCI_ANIM_WINDOW_DEFAULT = &H0&
' flags for dwFlags parameter of MCI_PUT command message
Public Const MCI_ANIM_RECT = &H10000
Public Const MCI_ANIM_PUT_SOURCE = &H20000 ' also MCI_WHERE
Public Const MCI_ANIM_PUT_DESTINATION = &H40000 ' also MCI_WHERE
' flags for dwFlags parameter of MCI_WHERE command message
Public Const MCI_ANIM_WHERE_SOURCE = &H20000
Public Const MCI_ANIM_WHERE_DESTINATION = &H40000
' flags for dwFlags parameter of MCI_UPDATE command message
Public Const MCI_ANIM_UPDATE_HDC = &H20000
Type MCI_ANIM_OPEN_PARMS
dwCallback As Long
wDeviceID As Long
lpstrDeviceType As String
lpstrElementName As String
lpstrAlias As String
dwStyle As Long
hWndParent As Long
End Type
Type MCI_ANIM_PLAY_PARMS
dwCallback As Long
dwFrom As Long
dwTo As Long
dwSpeed As Long
End Type
Type MCI_ANIM_STEP_PARMS
dwCallback As Long
dwFrames As Long
End Type
Type MCI_ANIM_WINDOW_PARMS
dwCallback As Long
hwnd As Long
nCmdShow As Long
lpstrText As String
End Type
Type MCI_ANIM_RECT_PARMS
dwCallback As Long
rc As Rect
End Type
Type MCI_ANIM_UPDATE_PARMS
dwCallback As Long
rc As Rect
hdc As Long
End Type
' flags for dwFlags parameter of MCI_OPEN command message
Public Const MCI_OVLY_OPEN_WS = &H10000
Public Const MCI_OVLY_OPEN_PARENT = &H20000
' flags for dwFlags parameter of MCI_STATUS command message
Public Const MCI_OVLY_STATUS_HWND = &H4001&
Public Const MCI_OVLY_STATUS_STRETCH = &H4002&
' flags for dwFlags parameter of MCI_INFO command message
Public Const MCI_OVLY_INFO_TEXT = &H10000
' flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block
Public Const MCI_OVLY_GETDEVCAPS_CAN_STRETCH = &H4001&
Public Const MCI_OVLY_GETDEVCAPS_CAN_FREEZE = &H4002&
Public Const MCI_OVLY_GETDEVCAPS_MAX_WINDOWS = &H4003&
' flags for dwFlags parameter of MCI_WINDOW command message
Public Const MCI_OVLY_WINDOW_HWND = &H10000
Public Const MCI_OVLY_WINDOW_STATE = &H40000
Public Const MCI_OVLY_WINDOW_TEXT = &H80000
Public Const MCI_OVLY_WINDOW_ENABLE_STRETCH = &H100000
Public Const MCI_OVLY_WINDOW_DISABLE_STRETCH = &H200000
' flags for hWnd parameter of MCI_OVLY_WINDOW_PARMS parameter block
Public Const MCI_OVLY_WINDOW_DEFAULT = &H0&
' flags for dwFlags parameter of MCI_PUT command message
Public Const MCI_OVLY_RECT = &H10000
Public Const MCI_OVLY_PUT_SOURCE = &H20000
Public Const MCI_OVLY_PUT_DESTINATION = &H40000
Public Const MCI_OVLY_PUT_FRAME = &H80000
Public Const MCI_OVLY_PUT_VIDEO = &H100000
' flags for dwFlags parameter of MCI_WHERE command message
Public Const MCI_OVLY_WHERE_SOURCE = &H20000
Public Const MCI_OVLY_WHERE_DESTINATION = &H40000
Public Const MCI_OVLY_WHERE_FRAME = &H80000
Public Const MCI_OVLY_WHERE_VIDEO = &H100000
Type MCI_OVLY_OPEN_PARMS
dwCallback As Long
wDeviceID As Long
lpstrDeviceType As String
lpstrElementName As String
lpstrAlias As String
dwStyle As Long
hWndParent As Long
End Type
Type MCI_OVLY_WINDOW_PARMS
dwCallback As Long
hwnd As Long
nCmdShow As Long
lpstrText As String
End Type
Type MCI_OVLY_RECT_PARMS
dwCallback As Long
rc As Rect
End Type
Type MCI_OVLY_SAVE_PARMS
dwCallback As Long
lpFileName As String
rc As Rect
End Type
Type MCI_OVLY_LOAD_PARMS
dwCallback As Long
lpFileName As String
rc As Rect
End Type
Public Const CAPS1 = 94 ' other caps
Public Const C1_TRANSPARENT = &H1 ' new raster cap
Public Const NEWTRANSPARENT = 3 ' use with SetBkMode()
Public Const QUERYROPSUPPORT = 40 ' use to determine ROP support
Public Const SELECTDIB = 41 ' DIB.DRV select dib escape
' ----------------
' shell association database management functions
' -----------------
' error values for ShellExecute() beyond the regular WinExec() codes
Public Const SE_ERR_SHARE = 26
Public Const SE_ERR_ASSOCINCOMPLETE = 27
Public Const SE_ERR_DDETIMEOUT = 28
Public Const SE_ERR_DDEFAIL = 29
Public Const SE_ERR_DDEBUSY = 30
Public Const SE_ERR_NOASSOC = 31
' -------------
' Print APIs
' -------------
Type PRINTER_INFO_1
flags As Long
pDescription As String
pName As String
pComment As String
End Type
Type PRINTER_INFO_2
pServerName As String
pPrinterName As String
pShareName As String
pPortName As String
pDriverName As String
pComment As String
pLocation As String
pDevMode As DEVMODE
pSepFile As String
pPrintProcessor As String
pDatatype As String
pParameters As String
pSecurityDescriptor As SECURITY_DESCRIPTOR
Attributes As Long
Priority As Long
DefaultPriority As Long
StartTime As Long
UntilTime As Long
Status As Long
cJobs As Long
AveragePPM As Long
End Type
Type PRINTER_INFO_3
pSecurityDescriptor As SECURITY_DESCRIPTOR
End Type
Public Const PRINTER_CONTROL_PAUSE = 1
Public Const PRINTER_CONTROL_RESUME = 2
Public Const PRINTER_CONTROL_PURGE = 3
Public Const PRINTER_STATUS_PAUSED = &H1
Public Const PRINTER_STATUS_ERROR = &H2
Public Const PRINTER_STATUS_PENDING_DELETION = &H4
Public Const PRINTER_STATUS_PAPER_JAM = &H8
Public Const PRINTER_STATUS_PAPER_OUT = &H10
Public Const PRINTER_STATUS_MANUAL_FEED = &H20
Public Const PRINTER_STATUS_PAPER_PROBLEM = &H40
Public Const PRINTER_STATUS_OFFLINE = &H80
Public Const PRINTER_STATUS_IO_ACTIVE = &H100
Public Const PRINTER_STATUS_BUSY = &H200
Public Const PRINTER_STATUS_PRINTING = &H400
Public Const PRINTER_STATUS_OUTPUT_BIN_FULL = &H800
Public Const PRINTER_STATUS_NOT_AVAILABLE = &H1000
Public Const PRINTER_STATUS_WAITING = &H2000
Public Const PRINTER_STATUS_PROCESSING = &H4000
Public Const PRINTER_STATUS_INITIALIZING = &H8000
Public Const PRINTER_STATUS_WARMING_UP = &H10000
Public Const PRINTER_STATUS_TONER_LOW = &H20000
Public Const PRINTER_STATUS_NO_TONER = &H40000
Public Const PRINTER_STATUS_PAGE_PUNT = &H80000
Public Const PRINTER_STATUS_USER_INTERVENTION = &H100000
Public Const PRINTER_STATUS_OUT_OF_MEMORY = &H200000
Public Const PRINTER_STATUS_DOOR_OPEN = &H400000
Public Const PRINTER_ATTRIBUTE_QUEUED = &H1
Public Const PRINTER_ATTRIBUTE_DIRECT = &H2
Public Const PRINTER_ATTRIBUTE_DEFAULT = &H4
Public Const PRINTER_ATTRIBUTE_SHARED = &H8
Public Const PRINTER_ATTRIBUTE_NETWORK = &H10
Public Const PRINTER_ATTRIBUTE_HIDDEN = &H20
Public Const PRINTER_ATTRIBUTE_LOCAL = &H40
Public Const NO_PRIORITY = 0
Public Const MAX_PRIORITY = 99
Public Const MIN_PRIORITY = 1
Public Const DEF_PRIORITY = 1
Type JOB_INFO_1
JobId As Long
pPrinterName As String
pMachineName As String
pUserName As String
pDocument As String
pDatatype As String
pStatus As String
Status As Long
Priority As Long
Position As Long
TotalPages As Long
PagesPrinted As Long
Submitted As SYSTEMTIME
End Type
Type JOB_INFO_2
JobId As Long
pPrinterName As String
pMachineName As String
pUserName As String
pDocument As String
pNotifyName As String
pDatatype As String
pPrintProcessor As String
pParameters As String
pDriverName As String
pDevMode As DEVMODE
pStatus As String
pSecurityDescriptor As SECURITY_DESCRIPTOR
Status As Long
Priority As Long
Position As Long
StartTime As Long
UntilTime As Long
TotalPages As Long
Size As Long
Submitted As SYSTEMTIME
time As Long
PagesPrinted As Long
End Type
Public Const JOB_CONTROL_PAUSE = 1
Public Const JOB_CONTROL_RESUME = 2
Public Const JOB_CONTROL_CANCEL = 3
Public Const JOB_CONTROL_RESTART = 4
Public Const JOB_STATUS_PAUSED = &H1
Public Const JOB_STATUS_ERROR = &H2
Public Const JOB_STATUS_DELETING = &H4
Public Const JOB_STATUS_SPOOLING = &H8
Public Const JOB_STATUS_PRINTING = &H10
Public Const JOB_STATUS_OFFLINE = &H20
Public Const JOB_STATUS_PAPEROUT = &H40
Public Const JOB_STATUS_PRINTED = &H80
Public Const JOB_POSITION_UNSPECIFIED = 0
Type ADDJOB_INFO_1
Path As String
JobId As Long
End Type
Type DRIVER_INFO_1
pName As String
End Type
Type DRIVER_INFO_2
cVersion As Long
pName As String
pEnvironment As String
pDriverPath As String
pDataFile As String
pConfigFile As String
End Type
Type DOC_INFO_1
pDocName As String
pOutputFile As String
pDatatype As String
End Type
Type FORM_INFO_1
pName As String
Size As SIZEL
ImageableArea As RECTL
End Type
Public Const FORM_BUILTIN = &H1
Type PRINTPROCESSOR_INFO_1
pName As String
End Type
Type PORT_INFO_1
pName As String
End Type
Type MONITOR_INFO_1
pName As String
End Type
Type MONITOR_INFO_2
pName As String
pEnvironment As String
pDLLName As String
End Type
Type DATATYPES_INFO_1
pName As String
End Type
Type PRINTER_DEFAULTS
pDatatype As String
pDevMode As DEVMODE
DesiredAccess As Long
End Type
Type PRINTER_INFO_4
pPrinterName As String
pServerName As String
Attributes As Long
End Type
Type PRINTER_INFO_5
pPrinterName As String
pPortName As String
Attributes As Long
DeviceNotSelectedTimeout As Long
TransmissionRetryTimeout As Long
End Type
Public Const PRINTER_CONTROL_SET_STATUS = 4
Public Const PRINTER_ATTRIBUTE_WORK_OFFLINE = &H400
Public Const PRINTER_ATTRIBUTE_ENABLE_BIDI = &H800
Public Const JOB_CONTROL_DELETE = 5
Public Const JOB_STATUS_USER_INTERVENTION = &H10000
Type DRIVER_INFO_3
cVersion As Long
pName As String ' QMS 810
pEnvironment As String ' Win32 x86
pDriverPath As String ' c:\drivers\pscript.dll
pDataFile As String ' c:\drivers\QMS810.PPD
pConfigFile As String ' c:\drivers\PSCRPTUI.DLL
pHelpFile As String ' c:\drivers\PSCRPTUI.HLP
pDependentFiles As String '
pMonitorName As String ' "PJL monitor"
pDefaultDataType As String ' "EMF"
End Type
Type DOC_INFO_2
pDocName As String
pOutputFile As String
pDatatype As String
dwMode As Long
JobId As Long
End Type
Public Const DI_CHANNEL = 1 ' start direct read/write channel,
Public Const DI_READ_SPOOL_JOB = 3
Type PORT_INFO_2
pPortName As String
pMonitorName As String
pDescription As String
fPortType As Long
Reserved As Long
End Type
Public Const PORT_TYPE_WRITE = &H1
Public Const PORT_TYPE_READ = &H2
Public Const PORT_TYPE_REDIRECTED = &H4
Public Const PORT_TYPE_NET_ATTACHED = &H8
Declare Function EnumPrinters Lib "winspool.drv" Alias "EnumPrintersA" (ByVal flags As Long, ByVal name As String, ByVal Level As Long, pPrinterEnum As Byte, ByVal cdBuf As Long, pcbNeeded As Long, pcReturned As Long) As Long
Declare Function EnumPrinterPropertySheets Lib "winspool.drv" Alias "EnumPrinterPropertySheets" (hPrinter As Long, hwnd As Long, lpfnAdd As Long, ByVal lParam As Long) As Long
Public Const PRINTER_ENUM_DEFAULT = &H1
Public Const PRINTER_ENUM_LOCAL = &H2
Public Const PRINTER_ENUM_CONNECTIONS = &H4
Public Const PRINTER_ENUM_FAVORITE = &H4
Public Const PRINTER_ENUM_NAME = &H8
Public Const PRINTER_ENUM_REMOTE = &H10
Public Const PRINTER_ENUM_SHARED = &H20
Public Const PRINTER_ENUM_NETWORK = &H40
Public Const PRINTER_ENUM_EXPAND = &H4000
Public Const PRINTER_ENUM_CONTAINER = &H8000
Public Const PRINTER_ENUM_ICONMASK = &HFF0000
Public Const PRINTER_ENUM_ICON1 = &H10000
Public Const PRINTER_ENUM_ICON2 = &H20000
Public Const PRINTER_ENUM_ICON3 = &H40000
Public Const PRINTER_ENUM_ICON4 = &H80000
Public Const PRINTER_ENUM_ICON5 = &H100000
Public Const PRINTER_ENUM_ICON6 = &H200000
Public Const PRINTER_ENUM_ICON7 = &H400000
Public Const PRINTER_ENUM_ICON8 = &H800000
Declare Function OpenPrinter Lib "winspool.drv" Alias "OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, pDefault As PRINTER_DEFAULTS) As Long
Declare Function ResetPrinter Lib "winspool.drv" Alias "ResetPrinterA" (ByVal hPrinter As Long, pDefault As PRINTER_DEFAULTS) As Long
Declare Function SetJob Lib "winspool.drv" Alias "SetJobA" (ByVal hPrinter As Long, ByVal JobId As Long, ByVal Level As Long, pJob As Byte, ByVal Command As Long) As Long
Declare Function GetJob Lib "winspool.drv" Alias "GetJobA" (ByVal hPrinter As Long, ByVal JobId As Long, ByVal Level As Long, pJob As Byte, ByVal cdBuf As Long, pcbNeeded As Long) As Long
Declare Function EnumJobs Lib "winspool.drv" Alias "EnumJobsA" (ByVal hPrinter As Long, ByVal FirstJob As Long, ByVal NoJobs As Long, ByVal Level As Long, pJob As Byte, ByVal cdBuf As Long, pcbNeeded As Long, pcReturned As Long) As Long
Declare Function AddPrinter Lib "winspool.drv" Alias "AddPrinterA" (ByVal pName As String, ByVal Level As Long, pPrinter As Any) As Long
Declare Function AddPrinterDriver Lib "winspool.drv" Alias "AddPrinterDriverA" (ByVal pName As String, ByVal Level As Long, pDriverInfo As Any) As Long
Declare Function EnumPrinterDrivers Lib "winspool.drv" Alias "EnumPrinterDriversA" (ByVal pName As String, ByVal pEnvironment As String, ByVal Level As Long, pDriverInfo As Byte, ByVal cdBuf As Long, pcbNeeded As Long, pcRetruned As Long) As Long
Declare Function GetPrinterDriver Lib "winspool.drv" Alias "GetPrinterDriverA" (ByVal hPrinter As Long, ByVal pEnvironment As String, ByVal Level As Long, pDriverInfo As Byte, ByVal cdBuf As Long, pcbNeeded As Long) As Long
Declare Function GetPrinterDriverDirectory Lib "winspool.drv" Alias "GetPrinterDriverDirectoryA" (ByVal pName As String, ByVal pEnvironment As String, ByVal Level As Long, pDriverDirectory As Byte, ByVal cdBuf As Long, pcbNeeded As Long) As Long
Declare Function DeletePrinterDriver Lib "winspool.drv" Alias "DeletePrinterDriverA" (ByVal pName As String, ByVal pEnvironment As String, ByVal pDriverName As String) As Long
Declare Function AddPrintProcessor Lib "winspool.drv" Alias "AddPrintProcessorA" (ByVal pName As String, ByVal pEnvironment As String, ByVal pPathName As String, ByVal pPrintProcessorName As String) As Long
Declare Function EnumPrintProcessors Lib "winspool.drv" Alias "EnumPrintProcessorsA" (ByVal pName As String, ByVal pEnvironment As String, ByVal Level As Long, pPrintProcessorInfo As Byte, ByVal cdBuf As Long, pcbNeeded As Long, pcReturned As Long) As Long
Declare Function GetPrintProcessorDirectory Lib "winspool.drv" Alias "GetPrintProcessorDirectoryA" (ByVal pName As String, ByVal pEnvironment As String, ByVal Level As Long, ByVal pPrintProcessorInfo As String, ByVal cdBuf As Long, pcbNeeded As Long) As Long
Declare Function EnumPrintProcessorDatatypes Lib "winspool.drv" Alias "EnumPrintProcessorDatatypesA" (ByVal pName As String, ByVal pPrintProcessorName As String, ByVal Level As Long, pDatatypes As Byte, ByVal cdBuf As Long, pcbNeeded As Long, pcRetruned As Long) As Long
Declare Function DeletePrintProcessor Lib "winspool.drv" Alias "DeletePrintProcessorA" (ByVal pName As String, ByVal pEnvironment As String, ByVal pPrintProcessorName As String) As Long
Declare Function StartDocPrinter Lib "winspool.drv" Alias "StartDocPrinterA" (ByVal hPrinter As Long, ByVal Level As Long, pDocInfo As Byte) As Long
Declare Function StartPagePrinter Lib "winspool.drv" Alias "StartPagePrinter" (ByVal hPrinter As Long) As Long
Declare Function WritePrinter Lib "winspool.drv" Alias "WritePrinter" (ByVal hPrinter As Long, pBuf As Any, ByVal cdBuf As Long, pcWritten As Long) As Long
Declare Function EndPagePrinter Lib "winspool.drv" Alias "EndPagePrinter" (ByVal hPrinter As Long) As Long
Declare Function AbortPrinter Lib "winspool.drv" Alias "AbortPrinter" (ByVal hPrinter As Long) As Long
Declare Function ReadPrinter Lib "winspool.drv" Alias "ReadPrinter" (ByVal hPrinter As Long, pBuf As Any, ByVal cdBuf As Long, pNoBytesRead As Long) As Long
Declare Function EndDocPrinter Lib "winspool.drv" Alias "EndDocPrinter" (ByVal hPrinter As Long) As Long
Declare Function AddJob Lib "winspool.drv" Alias "AddJobA" (ByVal hPrinter As Long, ByVal Level As Long, pData As Byte, ByVal cdBuf As Long, pcbNeeded As Long) As Long
Declare Function ScheduleJob Lib "winspool.drv" Alias "ScheduleJob" (ByVal hPrinter As Long, ByVal JobId As Long) As Long
Declare Function PrinterProperties Lib "winspool.drv" Alias "PrinterProperties" (ByVal hwnd As Long, ByVal hPrinter As Long) As Long
Declare Function DocumentProperties Lib "winspool.drv" Alias "DocumentPropertiesA" (ByVal hwnd As Long, ByVal hPrinter As Long, ByVal pDeviceName As String, pDevModeOutput As DEVMODE, pDevModeInput As DEVMODE, ByVal fMode As Long) As Long
Declare Function AdvancedDocumentProperties Lib "winspool.drv" Alias "AdvancedDocumentPropertiesA" (ByVal hwnd As Long, ByVal hPrinter As Long, ByVal pDeviceName As String, pDevModeOutput As DEVMODE, pDevModeInput As DEVMODE) As Long
Declare Function GetPrinterData Lib "winspool.drv" Alias "GetPrinterDataA" (ByVal hPrinter As Long, ByVal pValueName As String, pType As Long, pData As Byte, ByVal nSize As Long, pcbNeeded As Long) As Long
Declare Function SetPrinterData Lib "winspool.drv" Alias "SetPrinterDataA" (ByVal hPrinter As Long, ByVal pValueName As String, ByVal dwType As Long, pData As Byte, ByVal cbData As Long) As Long
Declare Function WaitForPrinterChange Lib "winspool.drv" Alias "WaitForPrinterChange" (ByVal hPrinter As Long, ByVal flags As Long) As Long
Public Const PRINTER_CHANGE_ADD_PRINTER = &H1
Public Const PRINTER_CHANGE_SET_PRINTER = &H2
Public Const PRINTER_CHANGE_DELETE_PRINTER = &H4
Public Const PRINTER_CHANGE_PRINTER = &HFF
Public Const PRINTER_CHANGE_ADD_JOB = &H100
Public Const PRINTER_CHANGE_SET_JOB = &H200
Public Const PRINTER_CHANGE_DELETE_JOB = &H400
Public Const PRINTER_CHANGE_WRITE_JOB = &H800
Public Const PRINTER_CHANGE_JOB = &HFF00
Public Const PRINTER_CHANGE_ADD_FORM = &H10000
Public Const PRINTER_CHANGE_SET_FORM = &H20000
Public Const PRINTER_CHANGE_DELETE_FORM = &H40000
Public Const PRINTER_CHANGE_FORM = &H70000
Public Const PRINTER_CHANGE_ADD_PORT = &H100000
Public Const PRINTER_CHANGE_CONFIGURE_PORT = &H200000
Public Const PRINTER_CHANGE_DELETE_PORT = &H400000
Public Const PRINTER_CHANGE_PORT = &H700000
Public Const PRINTER_CHANGE_ADD_PRINT_PROCESSOR = &H1000000
Public Const PRINTER_CHANGE_DELETE_PRINT_PROCESSOR = &H4000000
Public Const PRINTER_CHANGE_PRINT_PROCESSOR = &H7000000
Public Const PRINTER_CHANGE_ADD_PRINTER_DRIVER = &H10000000
Public Const PRINTER_CHANGE_DELETE_PRINTER_DRIVER = &H40000000
Public Const PRINTER_CHANGE_PRINTER_DRIVER = &H70000000
Public Const PRINTER_CHANGE_TIMEOUT = &H80000000
Public Const PRINTER_CHANGE_ALL = &H7777FFFF
Declare Function PrinterMessageBox Lib "winspool.drv" Alias "PrinterMessageBoxA" (ByVal hPrinter As Long, ByVal error As Long, ByVal hwnd As Long, ByVal pText As String, ByVal pCaption As String, ByVal dwType As Long) As Long
Public Const PRINTER_ERROR_INFORMATION = &H80000000
Public Const PRINTER_ERROR_WARNING = &H40000000
Public Const PRINTER_ERROR_SEVERE = &H20000000
Public Const PRINTER_ERROR_OUTOFPAPER = &H1
Public Const PRINTER_ERROR_JAM = &H2
Public Const PRINTER_ERROR_OUTOFTONER = &H4
Declare Function ClosePrinter Lib "winspool.drv" Alias "ClosePrinter" (ByVal hPrinter As Long) As Long
Declare Function AddForm Lib "winspool.drv" Alias "AddFormA" (ByVal hPrinter As Long, ByVal Level As Long, pForm As Byte) As Long
Declare Function DeleteForm Lib "winspool.drv" Alias "DeleteFormA" (ByVal hPrinter As Long, ByVal pFormName As String) As Long
Declare Function GetForm Lib "winspool.drv" Alias "GetFormA" (ByVal hPrinter As Long, ByVal pFormName As String, ByVal Level As Long, pForm As Byte, ByVal cbBuf As Long, pcbNeeded As Long) As Long
Declare Function SetForm Lib "winspool.drv" Alias "SetFormA" (ByVal hPrinter As Long, ByVal pFormName As String, ByVal Level As Long, pForm As Byte) As Long
Declare Function EnumForms Lib "winspool.drv" Alias "EnumFormsA" (ByVal hPrinter As Long, ByVal Level As Long, pForm As Byte, ByVal cbBuf As Long, pcbNeeded As Long, pcReturned As Long) As Long
Declare Function EnumMonitors Lib "winspool.drv" Alias "EnumMonitorsA" (ByVal pName As String, ByVal Level As Long, pMonitors As Byte, ByVal cbBuf As Long, pcbNeeded As Long, pcReturned As Long) As Long
Declare Function AddMonitor Lib "winspool.drv" Alias "AddMonitorA" (ByVal pName As String, ByVal Level As Long, pMonitors As Byte) As Long
Declare Function DeleteMonitor Lib "winspool.drv" Alias "DeleteMonitorA" (ByVal pName As String, ByVal pEnvironment As String, ByVal pMonitorName As String) As Long
Declare Function EnumPorts Lib "winspool.drv" Alias "EnumPortsA" (ByVal pName As String, ByVal Level As Long, ByVal lpbPorts As Long, ByVal cbBuf As Long, pcbNeeded As Long, pcReturned As Long) As Long
Declare Function AddPort Lib "winspool.drv" Alias "AddPortA" (ByVal pName As String, ByVal hwnd As Long, ByVal pMonitorName As String) As Long
Declare Function ConfigurePort Lib "winspool.drv" Alias "ConfigurePortA" (ByVal pName As String, ByVal hwnd As Long, ByVal pPortName As String) As Long
Declare Function DeletePort Lib "winspool.drv" Alias "DeletePortA" (ByVal pName As String, ByVal hwnd As Long, ByVal pPortName As String) As Long
Declare Function AddPrinterConnection Lib "winspool.drv" Alias "AddPrinterConnectionA" (ByVal pName As String) As Long
Declare Function DeletePrinterConnection Lib "winspool.drv" Alias "DeletePrinterConnectionA" (ByVal pName As String) As Long
Declare Function ConnectToPrinterDlg Lib "winspool.drv" Alias "ConnectToPrinterDlg" (ByVal hwnd As Long, ByVal flags As Long) As Long
Type PROVIDOR_INFO_1
pName As String
pEnvironment As String
pDLLName As String
End Type
Declare Function AddPrintProvidor Lib "winspool.drv" Alias "AddPrintProvidorA" (ByVal pName As String, ByVal Level As Long, pProvidorInfo As Byte) As Long
Declare Function DeletePrintProvidor Lib "winspool.drv" Alias "DeletePrintProvidorA" (ByVal pName As String, ByVal pEnvironment As String, ByVal pPrintProvidorName As String) As Long
Public Const SERVER_ACCESS_ADMINISTER = &H1
Public Const SERVER_ACCESS_ENUMERATE = &H2
Public Const PRINTER_ACCESS_ADMINISTER = &H4
Public Const PRINTER_ACCESS_USE = &H8
Public Const JOB_ACCESS_ADMINISTER = &H10
' Access rights for print servers
Public Const SERVER_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SERVER_ACCESS_ADMINISTER Or SERVER_ACCESS_ENUMERATE)
Public Const SERVER_READ = (STANDARD_RIGHTS_READ Or SERVER_ACCESS_ENUMERATE)
Public Const SERVER_WRITE = (STANDARD_RIGHTS_WRITE Or SERVER_ACCESS_ADMINISTER Or SERVER_ACCESS_ENUMERATE)
Public Const SERVER_EXECUTE = (STANDARD_RIGHTS_EXECUTE Or SERVER_ACCESS_ENUMERATE)
' Access rights for printers
Public Const PRINTER_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or PRINTER_ACCESS_ADMINISTER Or PRINTER_ACCESS_USE)
Public Const PRINTER_READ = (STANDARD_RIGHTS_READ Or PRINTER_ACCESS_USE)
Public Const PRINTER_WRITE = (STANDARD_RIGHTS_WRITE Or PRINTER_ACCESS_USE)
Public Const PRINTER_EXECUTE = (STANDARD_RIGHTS_EXECUTE Or PRINTER_ACCESS_USE)
' Access rights for jobs
Public Const JOB_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or JOB_ACCESS_ADMINISTER)
Public Const JOB_READ = (STANDARD_RIGHTS_READ Or JOB_ACCESS_ADMINISTER)
Public Const JOB_WRITE = (STANDARD_RIGHTS_WRITE Or JOB_ACCESS_ADMINISTER)
Public Const JOB_EXECUTE = (STANDARD_RIGHTS_EXECUTE Or JOB_ACCESS_ADMINISTER)
' Windows Network support
' RESOURCE ENUMERATION
Public Const RESOURCE_CONNECTED = &H1
Public Const RESOURCE_PUBLICNET = &H2
Public Const RESOURCE_REMEMBERED = &H3
Public Const RESOURCETYPE_ANY = &H0
Public Const RESOURCETYPE_DISK = &H1
Public Const RESOURCETYPE_PRINT = &H2
Public Const RESOURCETYPE_UNKNOWN = &HFFFF
Public Const RESOURCEUSAGE_CONNECTABLE = &H1
Public Const RESOURCEUSAGE_CONTAINER = &H2
Public Const RESOURCEUSAGE_RESERVED = &H80000000
Public Const RESOURCEDISPLAYTYPE_GENERIC = &H0
Public Const RESOURCEDISPLAYTYPE_DOMAIN = &H1
Public Const RESOURCEDISPLAYTYPE_SERVER = &H2
Public Const RESOURCEDISPLAYTYPE_SHARE = &H3
Public Const RESOURCEDISPLAYTYPE_FILE = &H4
Public Const RESOURCEDISPLAYTYPE_GROUP = &H5
Type NETRESOURCE
dwScope As Long
dwType As Long
dwDisplayType As Long
dwUsage As Long
lpLocalName As String
lpRemoteName As String
lpComment As String
lpProvider As String
End Type
Public Const CONNECT_UPDATE_PROFILE = &H1
Declare Function WNetAddConnection Lib "mpr.dll" Alias "WNetAddConnectionA" (ByVal lpszNetPath As String, ByVal lpszPassword As String, ByVal lpszLocalName As String) As Long
Declare Function WNetAddConnection2 Lib "mpr.dll" Alias "WNetAddConnection2A" (lpNetResource As NETRESOURCE, ByVal lpPassword As String, ByVal lpUserName As String, ByVal dwFlags As Long) As Long
Declare Function WNetCancelConnection Lib "mpr.dll" Alias "WNetCancelConnectionA" (ByVal lpszName As String, ByVal bForce As Long) As Long
Declare Function WNetCancelConnection2 Lib "mpr.dll" Alias "WNetCancelConnection2A" (ByVal lpName As String, ByVal dwFlags As Long, ByVal fForce As Long) As Long
Declare Function WNetGetConnection Lib "mpr.dll" Alias "WNetGetConnectionA" (ByVal lpszLocalName As String, ByVal lpszRemoteName As String, cbRemoteName As Long) As Long
Declare Function WNetOpenEnum Lib "mpr.dll" Alias "WNetOpenEnumA" (ByVal dwScope As Long, ByVal dwType As Long, ByVal dwUsage As Long, lpNetResource As NETRESOURCE, lphEnum As Long) As Long
Declare Function WNetEnumResource Lib "mpr.dll" Alias "WNetEnumResourceA" (ByVal hEnum As Long, lpcCount As Long, lpBuffer As Any, lpBufferSize As Long) As Long
Declare Function WNetCloseEnum Lib "mpr.dll" Alias "WNetCloseEnum" (ByVal hEnum As Long) As Long
Declare Function WNetGetUser Lib "mpr.dll" Alias "WNetGetUserA" (ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As Long
Declare Function WNetConnectionDialog Lib "mpr.dll" Alias "WNetConnectionDialog" (ByVal hwnd As Long, ByVal dwType As Long) As Long
Declare Function WNetDisconnectDialog Lib "mpr.dll" Alias "WNetDisconnectDialog" (ByVal hwnd As Long, ByVal dwType As Long) As Long
Declare Function WNetGetLastError Lib "mpr.dll" Alias "WNetGetLastErrorA" (lpError As Long, ByVal lpErrorBuf As String, ByVal nErrorBufSize As Long, ByVal lpNameBuf As String, ByVal nNameBufSize As Long) As Long
' Status Codes
' This section is provided for backward compatibility. Use of the ERROR_
' codes is preferred. The WN_ error codes may not be available in future
' releases.
' General
Public Const WN_SUCCESS = NO_ERROR
Public Const WN_NOT_SUPPORTED = ERROR_NOT_SUPPORTED
Public Const WN_NET_ERROR = ERROR_UNEXP_NET_ERR
Public Const WN_MORE_DATA = ERROR_MORE_DATA
Public Const WN_BAD_POINTER = ERROR_INVALID_ADDRESS
Public Const WN_BAD_VALUE = ERROR_INVALID_PARAMETER
Public Const WN_BAD_PASSWORD = ERROR_INVALID_PASSWORD
Public Const WN_ACCESS_DENIED = ERROR_ACCESS_DENIED
Public Const WN_FUNCTION_BUSY = ERROR_BUSY
Public Const WN_WINDOWS_ERROR = ERROR_UNEXP_NET_ERR
Public Const WN_BAD_USER = ERROR_BAD_USERNAME
Public Const WN_OUT_OF_MEMORY = ERROR_NOT_ENOUGH_MEMORY
Public Const WN_NO_NETWORK = ERROR_NO_NETWORK
Public Const WN_EXTENDED_ERROR = ERROR_EXTENDED_ERROR
' Connection
Public Const WN_NOT_CONNECTED = ERROR_NOT_CONNECTED
Public Const WN_OPEN_FILES = ERROR_OPEN_FILES
Public Const WN_DEVICE_IN_USE = ERROR_DEVICE_IN_USE
Public Const WN_BAD_NETNAME = ERROR_BAD_NET_NAME
Public Const WN_BAD_LOCALNAME = ERROR_BAD_DEVICE
Public Const WN_ALREADY_CONNECTED = ERROR_ALREADY_ASSIGNED
Public Const WN_DEVICE_ERROR = ERROR_GEN_FAILURE
Public Const WN_CONNECTION_CLOSED = ERROR_CONNECTION_UNAVAIL
Public Const WN_NO_NET_OR_BAD_PATH = ERROR_NO_NET_OR_BAD_PATH
Public Const WN_BAD_PROVIDER = ERROR_BAD_PROVIDER
Public Const WN_CANNOT_OPEN_PROFILE = ERROR_CANNOT_OPEN_PROFILE
Public Const WN_BAD_PROFILE = ERROR_BAD_PROFILE
' Enumeration
Public Const WN_BAD_HANDLE = ERROR_INVALID_HANDLE
Public Const WN_NO_MORE_ENTRIES = ERROR_NO_MORE_ITEMS
Public Const WN_NOT_CONTAINER = ERROR_NOT_CONTAINER
Public Const WN_NO_ERROR = NO_ERROR
' This section contains the definitions
' for portable NetBIOS 3.0 support.
Public Const NCBNAMSZ = 16 ' absolute length of a net name
Public Const MAX_LANA = 254 ' lana's in range 0 to MAX_LANA
Type NCB
ncb_command As Integer
ncb_retcode As Integer
ncb_lsn As Integer
ncb_num As Integer
ncb_buffer As String
ncb_length As Integer
ncb_callname As String * NCBNAMSZ
ncb_name As String * NCBNAMSZ
ncb_rto As Integer
ncb_sto As Integer
ncb_post As Long
ncb_lana_num As Integer
ncb_cmd_cplt As Integer
ncb_reserve(10) As Byte ' Reserved, must be 0
ncb_event As Long
End Type
Type ADAPTER_STATUS
adapter_address As String * 6
rev_major As Integer
reserved0 As Integer
adapter_type As Integer
rev_minor As Integer
duration As Integer
frmr_recv As Integer
frmr_xmit As Integer
iframe_recv_err As Integer
xmit_aborts As Integer
xmit_success As Long
recv_success As Long
iframe_xmit_err As Integer
recv_buff_unavail As Integer
t1_timeouts As Integer
ti_timeouts As Integer
Reserved1 As Long
free_ncbs As Integer
max_cfg_ncbs As Integer
max_ncbs As Integer
xmit_buf_unavail As Integer
max_dgram_size As Integer
pending_sess As Integer
max_cfg_sess As Integer
max_sess As Integer
max_sess_pkt_size As Integer
name_count As Integer
End Type
Type NAME_BUFFER
name As String * NCBNAMSZ
name_num As Integer
name_flags As Integer
End Type