VB icon

Windows 10 Taskbar Popups

Email
Submitted on: 3/16/2018 12:27:28 AM
By: A_X_O 
Level: Beginner
User Rating: Unrated
Compatibility: VbScript (browser/client side)
Views: 1845
 
     To provide an option to disable or enable the Windows 10 Taskbar Popup thumbnail.

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: Windows 10 Taskbar Popups
' Description:To provide an option to disable or enable the Windows 10 Taskbar Popup thumbnail.
' By: A_X_O
'**************************************

'
'-------------------------------------------------------------------------------'
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'
'		Disable Windows 10 Taskbar PopUp Thumbnail.			'
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'
'										'
'	Purpose		:	Optional Windows 10 Taskbar Popup		'
'	--------------------------------------------------------------		'
'	Creation Date	: 	13/03/2018 [dd/mm/yyyy]				'
'	Version		:	1.3						'
'	Designer	:	Fabian						'
'										'
'###############################################################################'
'			MODIFICATION HISTORY					'
'-------------------------------------------------------------------------------'
'	Version		:	1:0	13/03/2018	Create basic framework	'
'	Version		:	1:1	13/03/2018	Reboot facility added	'
'	Version		:	1:2	14/03/2018	Release resources	'
'	Version		:	1:3	16/03/2018	Clean-up Script		'
'										'
'-------------------------------------------------------------------------------'		
'
'
Dim WshShell															'As Object
Dim g_CurState															'As Long
'
Public Const m_RegValSet = "Do you want to enable Windows 10 TaskBar Popup's ?"							'As String
Public Const g_UIHover = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ExtendedUIHoverTime"	'As String
'
Public Const g_SetDWORD = 30000													'As Long
Public Const g_SetState = 30000													'As Long 
'
Public Const m_aQuest = "No changes have been made to your machine."								'As String
Public Const m_cQuest = "Windows 10 Popups"											'As String
'
Public Const m_uQuest = "Reboot your machine for the changes to be made."							'As String
Public Const m_bQuest = "Do you want to disable Windows 10 TaskBar Popup's ?"							'As String
Public Const m_tQuest = "Disable TaskBar PopUps"										'As String
Public Const m_rQuest = "The Windows 10 Taskbar PopUps's are disabled."								'As String
Public Const m_hQuest = "Do you want to re-enable PopUp's ?"									'As String
Public Const m_nQuest = "Re-Set"												'As String
'
Public Const m_pQuest = "Do you want to Reboot your Machine now ?"								'As String
Public Const m_vQuest = "Reboot Machine"											'As String
Public Const m_sQuest = "Changes made will take effect next time you reboot."							'As String
'
Set WshShell = Wscript.CreateObject("Wscript.Shell")										'Create the object instance
'
On Error Resume Next														'Jump over errors: no feedback
'
	g_CurState = WshShell.RegRead(g_UIHover)										'Read current reg keys
'
If g_CurState = g_SetState Then													'Registry key and data exists already
'
	Question_00 = MsgBox((m_rQuest) & vbcrlf _
			& (m_hQuest), _
			VbSystemModal + VbExclamation + VbYesNo, _
			(m_nQuest))												'Prompt user for action
'
Select Case Question_00														'Get user response
'
Case VbYes	
'
	WshShell.RegDelete g_UIHover												'User selected Yes: Delete reg keys
'
Call ForceRebootMachine														'Prompt user to Reboot
'
Case VbNo
'
	MsgBox m_aQuest, _
		VbSystemModal + VbExclamation + VbOkOnly, _
		m_cQuest													
																'User selected No: Inform user, No action taken
'
Set WshShell= Nothing														'Release the Windows Scripting Shell Object, freeup memory
'
Case Else: Wscript.Quit														'Exit
'												
End Select
'
Else
'
	Question_01 = MsgBox((m_bQuest), _
			VbSystemModal + VbExclamation + VbYesNo, _
			(m_tQuest))												'Prompt user to disable taskbar popups
'
Select Case Question_01														'Get user response
'
Case vbYes
'
	WshShell.RegWrite g_UIHover, g_SetDWORD, "REG_DWORD"									'User selected Yes: Write reg data
'
Call ForceRebootMachine														'Prompt user to Reboot
'
Case VbNo
'
	MsgBox m_aQuest, _
		VbSystemModal + VbExclamation + VbOkOnly, _
		m_cQuest													
																'User selected No: Inform user no action taken
'
Case Else: Wscript.Quit														'Exit
'
End Select
'
End If
'
Public Sub ForceRebootMachine()													'Provide complete cycle for script.
On Error Resume Next														'Jump over errors: No feedback
'
Dim OpSys		'As String
Dim OpSysSet		'As Array()												'Memory Dimentions
'
	RebootQuestion = MsgBox((m_pQuest), _
			VbSystemModal + VbExclamation + VbYesNo, _
			(m_vQuest))												'Prompt user to confirm Reboot
'
Select Case RebootQuestion
'
Case VbYes															'User option: Yes
'
Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
'
For Each OpSys in OpSysSet													'Instruct the PRIMARY OPERATING SYSTEM to Reboot
'
 	OpSys.Reboot()														'User wants to Reboot
'
Next			'OpSys
'
Set WshShell= Nothing
'
Set OpSysSet = Nothing														'Release the windows management instrumentation object and the Array(), freeup memory
'
Case VbNo															'User option: No
'
	MsgBox 	m_sQuest, _
		VbSystemModal + VbExclamation + VbOkOnly, _
		m_cQuest													
																'User does not want to Reboot
'
Set WshShell= Nothing														'Release the resources, freeup memory
'
Case Else: WScript.Quit														'Exit
'
End Select
'
End Sub																'End the script.
'
'
'


Other 7 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.