Skip to content

Class_Userform

Ryan N edited this page Jan 15, 2022 · 1 revision

Download this module here!

Dependencies

Class_WINAPI - Required to utilize this module due to the necessary API calls.

Form Registration

This class module lets you set a userform as the target for modifying via the WINAPI

Call Class_Userform.SetUserform(TargetUserform)

Properties

Once set, the target userform can be modified by setting the property flags available to you from the Class_Userform module.

Class_Userform.IconEnabled = Boolean - Read only. Returns a boolean indicating whether or not the form has an icon set

Class_Userform.hwnd = Long/LongPtr - Read only. Returns the handle of the form in the appropriate bitness of the system

Class_Userform.WindowBorder = Boolean - Toggles a thin-line border around the form

Class_Userform.WindowCaption = Boolean - Toggles the title bar of the form

Class_Userform.WindowEdge = Boolean - Toggles a sunken edge border around the form

Class_Userform.MaximizeBox = Boolean - Toggles the maximize button in the title bar

Class_Userform.MinimizeBox = Boolean - Toggles the minimize button in the title bar

Class_Userform.Resizable = Boolean - Toggles the resize feature of the form

Class_Userform.SystemMenu = Boolean - Toggles the menu options of the title bar

Class_Userform.Taskbar = Boolean - Toggles the form appearing in the taskbar

Class_Userform.TopMost = Boolean - Toggles the form being the topmost window

Class_Userform.TooltipWindow = Boolean - Toggles the title bar styling to be a tool tip window

Class_Userform.Draggable = Boolean - Toggles the ability to click and drag the form around on screen without using the title bar

The properties listed above are just commonly used aspects of the API that I feel most developers would want to have quick and easy access to for implementing in their own projects. But these are not the only things available for modification.


Methods

Below are additional methods available for use that further affects the form appearance and behavior.

Call Class_Userform.AddWindowStyle(WindowStyleFlags) - Adds a window style flag to the form

Call Class_Userform.RemoveWindowStyle(WindowStyleFlags) - Removes a window style flag from the form

Call Class_Userform.AddExtWindowStyle(ExtendedWindowStyleFlags) - Adds an extended window style flag to the form

Call Class_Userform.RemoveExtWindowStyle(ExtendedWindowStyleFlags) - Removes an extended window style flag from the form

Call Class_Userform.SetTransparency(Boolean, Color Long) - Toggles and sets a color value that will be used as a mask for transparency.

Call Class_Userform.SetTranslucency(Boolean, Alpha Byte) - Toggles and sets a translucency value for the entire form

Call Class_Userform.Show() - Brings the form to the top of the window z-order

Call Class_Userform.SetIcon(FilePath String, Optional LargeIcon Boolean) - Sets an icon for the form, filepath can be an executable, or an icon file (.ico)

Call Class_Userform.SetGifIcon(Optional FilePath String) - Sets an image (jpg, png, gif, bmp) as the icon for the form. Because this is just an image, this version of the icon will not appear as the form icon in the taskbar.

Call Class_Userform.Flash(Optional FlashWindowFlags) - Flashes the form and its taskbar tab to attract user attention

Call Class_Userform.Notify(Title String, Message String, Optional NotificationIconEnum, Optional App String, Optional Duration Integer) - Displays a notification utilizing Powershell with the given parameters. Future updates to this module will include more in-depth notification options.

Clone this wiki locally