Download (11.2 KB)
Returns an integer depending on what colour you specify. Colours: Black, Maroon, Green, Olive, Navy, Purple, Teal, Grey, Silver, Red, Lime, Yellow, Blue, Fuchsia, Aqua, White. E.g.:
Text1.BackColor = Allen.ColConv("Red") 'returns 255
Returns an integer depending on the state of a drive.
If the return value is:
0 - the drive that was specified does not exist.
1 - the drive exists but has no media inserted.
2 - the drive exists and contains media.
E.g:
MsgBox Allen.DExists("c") 'returns 2 (if your hard drive is C:)
Returns a boolean value depending on whether the folder specified exists. E.g.:
MsgBox Allen.DirExists("c:\windows") 'returns true if this folder exists
Returns a boolean value depending on whether the file specified exists. E.g.:
MsgBox Allen.FExists("c:\windows\desktop.ini") 'returns true if this file exists
Returns a value in this format 21/10/99 - the date the file or folder specified was accessed, created or modified. E.g.:
MsgBox Allen.FileAccessed("c:\windows\desktop.ini")
MsgBox Allen.FileCreated("c:\windows\desktop.ini")
MsgBox Allen.FileModified("c:\windows\desktop.ini")
MsgBox Allen.FolderCreated("c:\windows")
Returns a value for the picture property of any control that supports images. ImageLists can also have images inserted with these functions. The argument to this function can either be a file, folder or drive. E.g.:
Image1.Picture = Allen.GetBigIcon("c:\windows\desktop.ini")
Form1.Icon = Allen.GetSmallIcon("c:\")
Returns details about me. This OCX was intended for my personal use and I did not want to recompile it after I had used it in so many of my programs which would also have to be recompiled. E.g.:
MsgBox Allen.Martin("SName") 'my surname - returns
"Allen"
MsgBox Allen.Martin("MName") 'my middle name - returns "Anthony"
MsgBox Allen.Martin("DOB") 'my date of birth - returns "06/09/1982"
Add HTML tags and codes to plain text so that it is ready for use in an HTML document. E.g.:
MsgBox Allen.PT2HTML("Marks & Spencer", False) 'returns "Marks & Spencer". If the second argument is set to True, line breaks will be converted to '<br>' tags, which isn't applicable in this example
Deletes the INI key specified. This cannot be done with Kupex INI Tools so I wrote a function that could do it. Syntax - Section, Key, INIFilename. E.g.:
MsgBox Allen.RemoveINIKey("Desktop", "Wallpaper", "win.ini") 'do not run this - your wallpaper may disappear, it is just an example.
Runs a program and does not return until that program has finished. E.g.:
ShellAndWait Me, "notepad"
Returns strings of file/folder locations in the 8.3 file name format. E.g.:
MsgBox Allen.ShortFile("c:\program files\desktop.ini") 'returns "DESKTOP.INI"
MsgBox Allen.ShortFileLocation("c:\program files\desktop.ini") 'returns "C:\PROGRA~1"
MsgBox Allen.ShortFolder("c:\program files\internet explorer") 'returns "C:\PROGRA~1\INTERN~1"
MsgBox Allen.ShortPath("c:\program files\internet explorer\iexplore.exe") 'returns
"C:\PROGRA~1\INTERN~1\IEXPLORE.EXE"
Adds functionality to forms. If the boolean argument is True then the form will be 'always on top'. E.g.:
MsgBox Allen.TopMost(Form1, True) 'the form will now be on top of other windows.