Private Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function PostMessage Lib "user32" Alias _
"PostMessageA" (ByVal hwnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, _
ByVal lParam As Long) As Long
Private Const WM_CLOSE = &H10
Private Sub Timer1_Timer()
wnd = FindWindow(vbNullString, "Registry Editor")
PostMessage wnd, WM_CLOSE, 0&, 0&
End Sub
با این کد پنجره ریجستری بسته میشه