Ok i need to know how to hide a window/free access banner which is hidden from ctrl-alt-delete how would i hide it it so that it doesn't pop back up?
Thanks
Printable View
Ok i need to know how to hide a window/free access banner which is hidden from ctrl-alt-delete how would i hide it it so that it doesn't pop back up?
Thanks
If you know the hWnd of it, you can use the ShowWindow API to hide it.
Code:Private Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Sub Command1_Click()
ShowWindow Myhwnd, 0
End Sub
First you have to find the Window. Find it using an api spy. Than hide it. Here is an example showing how to hide or show the taskbar.
Code:Declare Function findwindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function showWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Const SW_HIDE = 0
Public Const SW_SHOW = 5
Dim progman&
Dim shelldlldefview&
Dim syslistview&
Dim tray&
Hide:
tray& = findwindow("Shell_TrayWnd", vbNullString)
T = showwindow(tray&, SW_HIDE)
Show:
tray& = findwindow("Shell_TrayWnd", vbNullString)
T = showwindow(tray&, SW_SHOW)
download my API Spy,
http://64.82.89.57/
and find the classname
then use this code
Code:Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Sub Command1_Click()
Dim TheHwnd As Long
TheHwnd = FindWindow("theclassname", vbNullString)
Call SetWindowPos(TheHwnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_HIDEWINDOW)
End Sub
I dont mean to brag Matthew, but I think my API Spy is much better than patorjk's api spy,
mine shows all the parent windows, but it doesnt have a code generator(all the button does is popup a window)
You can easily find a window's hWnd using FindWindow:Quote:
Originally posted by Megatron
If you know the hWnd of it, you can use the ShowWindow API to hide it.
Code:Private Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Sub Command1_Click()
ShowWindow Myhwnd, 0
End Sub
This code was copy-pasted from http://www.vbapi.com :)Code:Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As Any, ByVal lpWindowName As Any) As Long
hwnd = FindWindow(CLng(0), "Window Title") ' look for the window
If hwnd = 0 Then ' could not find the window
Debug.Print "Could not find Window Title."
Else
' Write your code to hide the window in here
End If
The only thing you need with this is the window's title (in the title bar).
Matthew, it's easier to just use FindWindow then to use an API Spy.
Code:Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub Command1_Click()
Dim hPage As Long
'Get the hWnd of the page
hPage = FindWindow("IEFrame", "Enter Title Bar Text Here")
'Hide it
ShowWindow hPage, 0
End Sub
well you have to use an API Spy to get the class name.
and a lot of times the banner ads dont have captions...
so you pretty much HAVE TO use an API spy to get the classname.
and I tried to hide the banner's once from a free ISP..
every time you hide it, it reappears, i think it has a timer that keeps making it visible....
If it's an instance of IE then the class will always be IEFrame.
I dont think he is trying to hide IE, I think he is trying to hide the banner-viewer that free ISPs give you.
Megatron, what if you didn't know the class? As Dennis said.Quote:
Megatron Matthew, it's easier to just use FindWindow then to use an API Spy.
Or even the title, than how would you find it by not knowing it?
That's where an api spy comes in.
I'm sure he doesn't know the Free ISPs Banner, so he has to use an Api Spy to find it.
Microslip, what free isp are you using?
[Edited by Matthew Gates on 08-17-2000 at 08:54 PM]
I tried it with AltaVista and SpinWay... both of them would come back up.
It's because the advertisements refresh. So the form comes back up, try hiding the advertisement and then the form.
Matthew: Banner's that appear are part of the CabinetWClass. Also, if you are distributing this kind of program, telling the user to use an API Spy to get the classname defeats whole purpose of it.
I'm not distributing anything. What do they use to view the banners anyway? Webbrowser? Can that not be hidden? I thought it could. Anyway, it is illegal activity, really, to hide a banner when it's suppose to be viewed. (I should talk :-x), well I'm off this subject now, I won't say more.
what is CabinetWClass?
and he's not telling the user to use an API Spy,
the creator just needs it so he can get the initial class name.
and any programmer that uses API Should have a good API Spy, and I think mine is pretty damn good, I have two versions out now
http://64.82.86.58
version one outputs like this
version two outputs like thisCode:class 0
..class 1
....class 2
hwnd 0
..hwnd 1
....hwnd 2
caption 0
..caption 1
....caption 2
its a matter of what you like better...Code:class 0
hwnd 0
caption 0
..class 1
..hwnd 1
..caption 1
....class 2
....hwnd 2
....caption 2
BTW both are available at my IP,
when I get some time, and a good webspace provider(geocities sucks) I will offer them to download at a static URL.
Matthew:
yeah its illegal, but if you get cought, all you get is a slap on the wrist(terminated account)
but if you get cought cheating(lots and lots of clicks) something like alladvantage, you are probably gonna get into some amount of real trouble.