rss
logo

I provide consulting and custom development for Natural Language Processing, Information Extraction and Search solutions.Self Picture


 learn more   get in touch 

Logo - I Build Search
Jul 31
2006

FindWindow Illustration digg

Synopsis

The following code illustrates the use of FindWindow API. This program blanks out the ad in Yahoo Messenger buddy window. It has been tested on Yahoo Messenger 7.5 and 8.0.

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// This code illustrates hiding the Ad in the Buddy window of Yahoo Messenger
//
// Copyright (c) 2006, Pravin Paratey
// pravinp[at]gmail[dot]com (http://dustyant.com)
 
#include <windows.h>
 
int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArgs, int nCmdWnd)
{
	HWND hYahooWnd = FindWindowEx(NULL, NULL, "YahooBuddyMain", NULL);
 
	if(hYahooWnd) // Yahoo Messenger is running
	{
		HWND hAtlWnd = FindWindowEx(hYahooWnd, NULL, "ATL:00821BC0", NULL);
 
		if(hAtlWnd) // Found the window
		{
			HWND hShellWnd = FindWindowEx(hAtlWnd, NULL, "Shell Embedding", NULL);
			if(hShellWnd)
			{
				HWND hDocObjWnd = FindWindowEx(hShellWnd, NULL, "Shell DocObject View", NULL);
				if(hDocObjWnd) // This is the window we must hide
				{
					ShowWindow(hDocObjWnd, SW_HIDE);
				}
			}
		}
	}
	else
	{
		MessageBox(NULL, "No instances of Yahoo Messenger found", "Error", MB_OK);
	}
	return 0;
}

Download

You can download the source code or the binary.

Usage

Pretty straight forward. When yahoo messenger is running, double click the exe. The ads window will disappear :)

3 Responses (rss) (trackback)

#1

Swapnil

August 3rd, 2006 at 1:21 am

Whats with you and yahoo messenger? Have you ever been betrayed by it or something?

#2

Swapnil

August 3rd, 2006 at 1:22 am

Your time display over here too is wrong. its 1.37 in the night and it shows 1.

#3

Pravin Paratey

August 19th, 2006 at 10:21 am

I think you need to study some more, little brother. how is Iridov coming up?

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Latest Articles

Apr
07

Palindromic sub-sequences in python

This bit of python code returns all palindromic subsequences in the input string.

[Read More]
Feb
19

Join a list of integers in Python

How do you run a string join on a list of integers in Python? After googling for about 10 mins, I gave up and did this. I am sure there is a better way of doing it!

[Read More]

Featured Projects

Document Tagger

Document Tagger

DocTagger lets you automatically classify text documents. Use this as a starting point to write apps that can sort through volumes of unorganized data.

[Read More]

Indic to English Transliterator

Indic to English Transliterator

Transliteration is the process of converting a word from one language to another while retaining its phonetic characteristics. This application lets you convert a word from any major Indian language (currently supports Hindi, Marathi, Sanskrit and Bengali) to English.

[Read More]

This page and its contents are copyright © 2010, Pravin Paratey.