Unicode Controls & Classes for VB6 - Version 4

clsCommonWrapper Class

This class permits you to invoke common functions and methods, contains function used in Unicode Controls.

Enums
Name Description
eCtlButtonStyle Button styles
eCtlCursorType Cursors
eCtlDrawTextFormat Used when drawing text, check MSDN for details
eCtlLineStyle [DrawLine] flags
eCtlOLEDragMode OLE Drag modes
eCtlOLEDropMode OLE Drop modes
eCtlShellExec [UniShellExecuteW] operations
eCtlTextAlignConst Text alignment constants
eCtlWindowsType Windows versions
Events
Name Description
Properties
Name Type Description
DefaultButtonStyle (eCtlButtonStyle) Gets or sets the Default style for buttons (default=Vista Style).
Just set it one time when your program starts.
This property affects controls that have Style = -1& (Default).
Methods
Name Type Description
ActivateLibrary (Boolean) Permits you to activate the library using the given license code
ApplyFontToForm Applies a certain font to all form objects
AscW (Long) Returns an Integer value representing the character code corresponding to a character.
BlendColors (Long) Mixes two colors using a specified factor
CalculateStringDim Calculates the size of a string and return Width and Height
CalculateStringDimEx Calculates the size of a string using custom flags
CalculateTextRectSize Calculates the size of a string in a given rectangle, always uses [eCtlDrawTextFormat].CTL_DT_CALCRECT and [eCtlDrawTextFormat].CTL_DT_WORDBREAK flags
CanUseAnsiForString (Boolean) Verify if a string can be saved in a ANSI file
ChrW (String) Returns the Unicode character from a given character ordinal
ClipByte (Integer) Clips a value to a byte; if i is > 255 then i = 255 else if i is < 0 then i = 0
ColorInc (Long) Increase RGB values of a color for the given factor
ColorToComponents Return RGB components of a given color
ConvertBitmapPictureToIconPicture (StdPicture) Converts a standard picture containing a bitmap to a standard picture containing an icon
ConvertOLEColor (Long) Convert a specified color to a color value; detects if a color is a System Color constant
and returns the value
CreateColorBrush (Long) Creates a GDI brush with a certain color used to fill GDI shapes
CreateColorPen (Long) Creates a GDI pen using a specified color
CreatePictureFromBitmapHandle (StdPicture) Creates a standard picture object from the the given bitmap handle
CreatePictureFromIconHandle (StdPicture) Creates a standard picture of icon type from a icon handle
CreateThumbnail (StdPicture) Creates a thumbnail image of the desired size from the given picture; returns a StdPicture object
DeleteObject (Long) Releases the memory used by the system when creating Pens and Brushes
DrawButton Draws a button on a specified Device Context
DrawButtonWL Draws a button on a specified Device Context but fills only button parts, others remain trasparent
DrawLine Draws a line on the specified Device Context using the given color
DrawLineCoords Draws a line at specified coords
DrawPixel Draws a pixel on the specified Device Context
DrawRect Draws a rectangle by using the specified color. The width and height of the border are always one logical unit.
DrawRectCoords Draws a rectangle by using the specified color. The width and height of the border are always one logical unit.
DrawRRect Draws a round rectangle using different options
DrawRRectCoords Draws a round rectangle using different options
DrawText The DrawText function draws formatted text in the specified rectangle. It formats the text according to the specified method (expanding tabs, justifying characters, breaking lines, and so forth).
DrawTextColor Draws formatted text in the specified rectangle using a specified color
DrawTextColorCoords Draws formatted text in the specified rectangle using a specified color
DrawTextCoords The DrawText function draws formatted text in the specified rectangle. It formats the text according to the specified method (expanding tabs, justifying characters, breaking lines, and so forth).
GetBkColor (Long) Returns the background color of the given Device Context
GetBkMode (eMemDcBkMode) Returns the background mode of the given Device Context
GetBmpInfo Utility function, returns information for a certain image handle
GetColorLuminance (Integer) Returns the luminance of the given color from 0..255
GetFormCaptionW (String) Gets the Unicode caption for a standard VB6 form
GetGDIPlusSession (clsGpSession) Returns a reference to the internal GDIPlus session object that contains GdiPlus utility functions
GetIconInfo Utility function, returns information for a certain icon or cursor handle
GetPropBagPicture32 (StdPicture) Permits you to read a 32bpp alpha image from your usercontrols, returns a StdPicture
GetRealBorderColor (Long) Returns the real color of a border with a value of -1& (automatic)
GetRealButtonStyle (eCtlButtonStyle) Returns the real button style from a style = -1& (default)
GetRealGrayTextColor (Long) Returns a gray color for using when the foreground color is similar to the background color
GetTip (String) Returns the actual Tip text
GetTipTag (String) Returns the Tip tag
GetUnicodeDroppedFiles (Collection) Gets the list of the Unicode files from a DataObject object.
This function must be called in OLEDrag&Drop events.
GetWindowsVersion (eCtlWindowsType) Gets the current Windows version
GetWindowsVersionEx Returns information about the current Windows version
GrayScaleColor (Long) Returns the grayscale of the given color
HextoStr (String) Converts a string encoded in Hexadecimal to Unicode
Check [ctlUniMenu.StringMode] for details on this encoding
HiByte (Byte) Returns the higher byte part of an integer
HideTip Hides the Tip window
HiLong (Long) Returns the higher part (32 bit) of a currency value
HiWord (Integer) Returns the higher word (16 bit) of a long value
Hm2PixelsX (Long) Converts a HiMetric X Value to Pixels (Very useful for Picture size check)
Hm2PixelsY (Long) Converts a HiMetric Y Value to Pixels (Very useful for Picture size check)
InflateRect The InflateRect function increases or decreases the width and height of the specified rectangle. The InflateRect function adds dx units to the left and right ends of the rectangle and dy units to the top and bottom. The dx and dy parameters are signed values; positive values increase the width and height, and negative values decrease them.
InIDE (Boolean) Returns True if the code is being executed in the VB6 IDE
InvalidateWindow Invalidates a certain window causing the refresh (asynchronous)
IsAltDown (Boolean) Verify if the ALT key is down
IsControlDown (Boolean) Verify if the CTRL key is down
IsEscDown (Boolean) Verify if the ESC key is down
IsFontInstalled (Boolean) Checks if the specified font is installed
IsHexString (Boolean) Verify if a string is encoded in Hexadecimal format
IsKeyDown (Boolean) Returns True if the specified key is pressed
Check Virtual Key Codes on MSDN
IsShiftDown (Boolean) Verify if the SHIFT key is down
IsUnicodeString (Boolean) Verifies if a string contains unicode characters
IsUnicodeSystem (Boolean) Returns True if the System supports Unicode (Win 2000+)
IsUTF16String (Boolean) Checks if a string is Unicode
IsUTF8String (Boolean) Checks if a string is UTF8
LoadPicture (StdPicture) Loads the specified image file and returns a standard picture object.
Returns nothing if an error occurs, pass an empty string for returning a blank picture
LoByte (Byte) Returns the lower byte part of an integer
LoLong (Long) Returns the lower part (32 bit) of a currency value
LoWord (Integer) Returns the low word (16 bit) of a long value
MakeDLong (Currency) Makes a double word (64 bit) value from 2 longs
MakeDWord (Long) Makes a double word from 2 integers
MakeWord (Integer) Makes a word value from 2 bytes
OffsetRect The OffsetRect function moves the specified rectangle by the specified offsets.
OverlapImage Draws a picture on a specified Device Context; the picture can be also alpha with 32 bit
OverlapImageCoords Draws a picture on a specified Device Context; the picture can be also alpha with 32 bit
OverlapImageRect Draws a picture on a specified Device Context; the picture can be also alpha with 32 bit
RenderPicture Draws the specified picture to a Device Context; supports also 32 bit alpha images
SetBkColor Sets a specified color to the given Device Context
SetBkMode Sets the background mode for the given Device Context
SetColorLuminance (Long) Sets the luminance to the given color and returns a new color
SetFormCaptionW Sets an Unicode caption for a standard VB6 form
SetPropBagPicture32 Permits you to save a 32bpp alpha image in your usercontrols
SetRect The SetRect function sets the coordinates of the specified rectangle. This is equivalent to assigning the left, top, right, and bottom arguments to the appropriate members of the RECT structure.
SetTip Permits you to programmatically set the tip value (and display it)
SetWindowLayout Sets the Window layout to be RTL or not, in case of RTL Window, menus and icons are mirrored
https://msdn.microsoft.com/en-us/library/aa913269.aspx
ShiftState (Integer) Returns the state of CTRL, ALT and SHIFT keys
ShowErrorW Shows an error message box
ShowInfoW Shows an info message box
ShowMessageBoxW (VbMsgBoxResult) Shows a system message box (In Unicode)
ShowYesNoW (Boolean) Shows a Unicode Yes/No message box and returns True if the user chosed "Yes"
StrToHex (String) Converts an Unicode string to Hexadecimal
Check [ctlUniMenu.StringMode] for details on this encoding
StrToUTF8 (String) Converts an Unicode string to a UTF8 string
TextOut Draws a text at specified coords without a clipping rectangle
TextOutColor Draws a text at specified coords without a clipping rectangle using a specified color
TipIsVisible (Boolean) Returns True if the Tip window is visible
UniAppPath (String) Gets the application path (in Unicode)
UniShellExecuteW (Long) Performs an operation on a specified file. Check MSDN for details
UpdateTip Permits you to change Tip properties without hiding it (if it is visible)
UTF8toStr (String) Converts an UTF8 string to Unicode
Remarks