Refresh/Close Windows Control panel

  • Thread starter Thread starter John Seelig
  • Start date Start date
J

John Seelig

I have a vb.net program that calls an msi to uninstall a control panel
(*.cpi, *.cpl and *.exe). However, after uninstall the icon persists in the
control panel window until a refresh (F5) is initiated. Is there a way to
refresh, or at lease close, the window from my vb.net code?

Thanks in advance!
(e-mail address removed)
 
John Seelig said:
I have a vb.net program that calls an msi to uninstall a control panel
(*.cpi, *.cpl and *.exe). However, after uninstall the icon persists in the
control panel window until a refresh (F5) is initiated. Is there a way to
refresh, or at lease close, the window from my vb.net code?

Have a look at the 'SendKeys.Send' method.
 
Thanks Herfried,

Your reply directed me to what I needed...

Sub RefreshControlPanelIcons()

Try
AppActivate("Control Panel")
SendKeys.Send("{F5}")
Catch ex As Exception
Exit Try
End Try

End Sub
 
Back
Top