by Jan Nawara (3 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating:
(2 Votes)
This function allows the application to enter and exit exclusive mode. In this mode any message boxes or prompts from Windows and other applications will not show up infront of the program. This is useful when you don't want anything to come up infront of your application window.
Inputs
Reguires a True to turn exclusive mode on and False to turn it off.
Assumes
Essentially this code makes Windows think that your application is a screen saver. The only type of application that Windows will not interupt with message boxes, etc.
Side Effects
This code may cause some problems with screen savers that do not use the normal Windows interface such as After Dark. Users should be made aware of this.
API DeclarationsDeclare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
Public Sub Exclusive_Mode(Use As Boolean)
'If True was passed makes app exclusive
'Else makes app not exclusive
Dim Scrap
Scrap = SystemParametersInfo(97, Use, "", 0)
End Sub