 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Fri Dec 26, 2008 5:33 pm Post subject: [SOLVED]Close WLM Ad Window |
|
|
i used FindWindow and FindWindowEx to get the handle of a Window (Advertisement) of Windows Live Messenger, the handle i retrieved was success, but closing it wasn't using PostMessange and WM_CLOSE / WM_QUIT, would appreciate advises.
I'm using Precompiled Header
ok so the formula is:
| Code: | MSBLWindowClass (W)
-> DirectUIHWND (ExW)
-> -> CtrlNotifySink (ExW)
-> -> -> MSNMSBLGeneric (ExW)
-> -> -> -> Shell Embedding (ExW)
-> -> -> -> -> Shell DocObject View (ExW)
-> -> -> -> -> -> Internet Explorer_Server (ExW) //This Window Needs To Be Closed ( AD ) |
my code to get the handle is:
| Code: | HWND Get_MSN_Ad_Handle()
{
HWND hAd;
HWND hMSN = FindWindow(TEXT("MSBLWindowClass"), NULL);
if(hMSN)
{
HWND hDirectUI = FindWindowEx(hMSN, NULL, TEXT("DirectUIHWND"), NULL);
if(hDirectUI)
{
HWND hNotifySink = FindWindowEx(hDirectUI, NULL, TEXT("CtrlNotifySink"), NULL);
if(hNotifySink)
{
HWND hMSNGeneric = FindWindowEx(hNotifySink, NULL, TEXT("MSNMSBLGeneric"), NULL);
if(hMSNGeneric)
{
HWND hShellEmbed = FindWindowEx(hMSNGeneric, NULL, TEXT("Shell Embedding"), NULL);
if(hShellEmbed)
{
HWND hShellObjectView = FindWindowEx(hShellEmbed, NULL, TEXT("Shell DocObject View"), NULL);
if(hShellObjectView)
{
hAd = FindWindowEx(hShellObjectView, NULL, TEXT("Internet Explorer_Server"), NULL);
}
}
}
}
}
}
return hAd;
} |
main code to close:
| Code: | int _tmain(int argc, _TCHAR* argv[])
{
if(Get_MSN_Ad_Handle())
{
printf("Found Window!\n");
PostMessage(Get_MSN_Ad_Handle(), WM_QUIT, 0, 0);
}
_getch();
return 0;
} |
now, when i use PostMessage on that handle, with WM_CLOSE it doesn't close it, maybe i should try a different API ?
Last edited by DeletedUser14087 on Sun Dec 28, 2008 2:06 pm; edited 2 times in total |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Dec 26, 2008 5:36 pm Post subject: |
|
|
| Try ExitProcess / TerminateProcess?
|
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Fri Dec 26, 2008 5:38 pm Post subject: |
|
|
| slovach wrote: | | Try ExitProcess / TerminateProcess? |
Don't think it has it's own process. It's just a child window apparently.
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Fri Dec 26, 2008 5:40 pm Post subject: |
|
|
| slovach wrote: | | Try ExitProcess / TerminateProcess? |
Mhm.., ExitProcess isn't for this kind of activity and... TerminateProcess (according to MSDN) needs TERMINATE_PROCESS right, and.. is a handle to a process by ID, i'm trying to close a window by handle.
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Dec 26, 2008 5:40 pm Post subject: |
|
|
| noz3001 wrote: | | slovach wrote: | | Try ExitProcess / TerminateProcess? |
Don't think it has it's own process. It's just a child window apparently. |
oh, well... shit. That's what I get for not reading it.
edit:
So nothing like CloseWindow, etc works on this renegade window? I've never used MSN, but it sounds logical enough to try, and prevent people from getting around your ads. $$$
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Fri Dec 26, 2008 6:01 pm Post subject: |
|
|
| What's wrong with CloseWindow(hwnd)/SendMessage(hwnd, WM_CLOSE, 0, 0)?
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Fri Dec 26, 2008 6:19 pm Post subject: |
|
|
| Symbol wrote: | | What's wrong with CloseWindow(hwnd)/SendMessage(hwnd, WM_CLOSE, 0, 0)? |
CloseWindow (according to MSDN) minimizes the window, i'll try DestroyWindow.
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Fri Dec 26, 2008 6:30 pm Post subject: |
|
|
| Sorry, my bad, I meant DestroyWindow and WM_DESTROY. (although WM_DESTROY message should be sent by default when WM_CLOSE message arrives, but that's just the default)
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Sat Dec 27, 2008 11:27 am Post subject: |
|
|
| Symbol wrote: | | Sorry, my bad, I meant DestroyWindow and WM_DESTROY. (although WM_DESTROY message should be sent by default when WM_CLOSE message arrives, but that's just the default) |
DestroyWindow didn't work neither, i think i'm doing something wrong, i will try removing the WS_VISIBLE style from it.
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Sat Dec 27, 2008 11:35 am Post subject: |
|
|
| Are you sure you got the right handle?
|
|
| Back to top |
|
 |
FerrisBuellerYourMyHero Master Cheater
Reputation: 0
Joined: 14 Feb 2007 Posts: 401 Location: Inside your <kernel>
|
Posted: Sat Dec 27, 2008 12:23 pm Post subject: |
|
|
Well if you simply just don't want to see the advertisement, why not just hide it instead of closing it, the window will still exist you just wont see it... Is there any reason why you need to close it instead of just hide it?
Anyway I used to play party poker a long while ago when they had very annoying flashing ads that would annoy you while playing. They eventually removed them since they were a major distraction, but the easiest way I found to temporarily get rid of the ads was by hiding the ad window.
it had a similar way to the ad window, except "Shell Embedding" was first..
If I remember correctly the deeper child windows didn't do anything when hiding them, but hiding the "Shell Embedding" window worked...
ShowWindow(windowhandle, SW_HIDE) works well
I'd revise your code like so and see if it hides the ads... (assuming your code was right)
Also it seems your using Unicode, so why not use L"unicode string" instead of TEXT?
| Code: |
HWND Get_MSN_Ad_Handle()
{
HWND hShellEmbed;
HWND hMSN = FindWindow(L"MSBLWindowClass", NULL);
if(hMSN)
{
HWND hDirectUI = FindWindowEx(hMSN, NULL, L"DirectUIHWND", NULL);
if(hDirectUI)
{
HWND hNotifySink = FindWindowEx(hDirectUI, NULL, L"CtrlNotifySink", NULL);
if(hNotifySink)
{
HWND hMSNGeneric = FindWindowEx(hNotifySink, NULL, L"MSNMSBLGeneric", NULL);
if(hMSNGeneric)
{
hShellEmbed = FindWindowEx(hMSNGeneric, NULL, L"Shell Embedding", NULL);
}
}
}
}
return hShellEmbed;
}
|
| Code: |
int _tmain(int argc, _TCHAR* argv[])
{
HWND AdWindowHandle = Get_MSN_Ad_Handle();
if(AdWindowHandle)
{
printf("Found Window!\n");
ShowWindow(AdWindowHandle, SW_HIDE)
}
_getch();
return 0;
}
|
_________________
You know, life moves pretty fast. If you don't stop and look around once in a while, You could miss it!
 |
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Sat Dec 27, 2008 4:31 pm Post subject: |
|
|
| FerrisBuellerYourMyHero wrote: | Well if you simply just don't want to see the advertisement, why not just hide it instead of closing it, the window will still exist you just wont see it... Is there any reason why you need to close it instead of just hide it?
Anyway I used to play party poker a long while ago when they had very annoying flashing ads that would annoy you while playing. They eventually removed them since they were a major distraction, but the easiest way I found to temporarily get rid of the ads was by hiding the ad window.
it had a similar way to the ad window, except "Shell Embedding" was first..
If I remember correctly the deeper child windows didn't do anything when hiding them, but hiding the "Shell Embedding" window worked...
ShowWindow(windowhandle, SW_HIDE) works well
I'd revise your code like so and see if it hides the ads... (assuming your code was right)
Also it seems your using Unicode, so why not use L"unicode string" instead of TEXT?
| Code: |
HWND Get_MSN_Ad_Handle()
{
HWND hShellEmbed;
HWND hMSN = FindWindow(L"MSBLWindowClass", NULL);
if(hMSN)
{
HWND hDirectUI = FindWindowEx(hMSN, NULL, L"DirectUIHWND", NULL);
if(hDirectUI)
{
HWND hNotifySink = FindWindowEx(hDirectUI, NULL, L"CtrlNotifySink", NULL);
if(hNotifySink)
{
HWND hMSNGeneric = FindWindowEx(hNotifySink, NULL, L"MSNMSBLGeneric", NULL);
if(hMSNGeneric)
{
hShellEmbed = FindWindowEx(hMSNGeneric, NULL, L"Shell Embedding", NULL);
}
}
}
}
return hShellEmbed;
}
|
| Code: |
int _tmain(int argc, _TCHAR* argv[])
{
HWND AdWindowHandle = Get_MSN_Ad_Handle();
if(AdWindowHandle)
{
printf("Found Window!\n");
ShowWindow(AdWindowHandle, SW_HIDE)
}
_getch();
return 0;
}
|
|
Many thanks Ferri, also the reason i want to close it and not hide is because if i will move my mouse over it (i think) it will popup in large the ad.
|
|
| Back to top |
|
 |
DoomsDay Grandmaster Cheater
Reputation: 0
Joined: 06 Jan 2007 Posts: 768 Location: %HomePath%
|
Posted: Sat Dec 27, 2008 4:49 pm Post subject: |
|
|
Rot1, add the following to the restricted sites lists (under internet settings):
rad.msn.com
|
|
| Back to top |
|
 |
Ziztey Grandmaster Cheater
Reputation: 0
Joined: 20 Dec 2007 Posts: 535 Location: 127.0.0.1
|
Posted: Sat Dec 27, 2008 4:51 pm Post subject: |
|
|
Else, get faggot plus
_________________
| kenta7795 wrote: | Lol, how do I know its fake?
The source is a .cpp, and a .h
Private server much? |
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Sat Dec 27, 2008 6:21 pm Post subject: |
|
|
| DoomsDay wrote: | Rot1, add the following to the restricted sites lists (under internet settings):
rad.msn.com |
This, right ?
| Code: | | http://rad.msn.com/ADSAdClient31.dll?GetAd=&PG=IMSHIS&AP=1007 |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|