can i check if favorites r open in the IE window and then close it using any lang
Printable View
can i check if favorites r open in the IE window and then close it using any lang
i don't think so
do you want to do it thru vb?Quote:
Originally posted by tolisss
can i check if favorites r open in the IE window and then close it using any lang
so if I went to your site and I wanted to put it in favorites, god knows why, :) you want to close it as soon as it is open.
and any language won't talk to it, javascript is the only one that I know of. and you can't close it with that, just open it.
the lang is not a problemQuote:
Originally posted by da_silvy
do you want to do it thru vb?
It is definitely not possible through JavaScript or a Java applet; an ActiveX control scripted with VBScript would probably work. It would only work in IE, but that's a nonissue considering that IE only has the Favorites pane thingy.
Which favorites window do you want to check if opeN?
i.e.
Organize Favorites
Add Favorites?
on IE in the standard toolbar there is a button called favorites i want to close the frame-window that is displayed when u click that window not the add or organize favorites window i want to close the whole Favorites window-frame
VB Code:
'This closes an open Favorites, Search or History frame (they all share the same handle) 'In a module Public Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal Msg As Long, wParam As Any, lParam As Any) As Long Public Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Public Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hwndParent As Long, ByVal hwndChildAfter As Long, ByVal lpszClass As String, ByVal lpszWindow As String) As Long Public Const WM_CLOSE = &H10 'wherever you want 'Code to close window Dim IEHandle As Long, WindowParent As Long, FavoritesWindow As Long IEHandle = FindWindow("IEFrame", vbNullString) WindowParent = FindWindowEx(IEHandle, 0, "BaseBar", vbNullString) FavoritesWindow = FindWindowEx(WindowParent, 0, "ReBarWindow32", vbNullString) result = SendMessage(FavoritesWindow, WM_CLOSE, ByVal CLng(0), ByVal CLng(0))
hope it works for you as well man