Sythe.Org Forums     Register     FAQ     Members List     Calendar     Mark Forums Read    
 
Sythe.Org Forums  
   Runescape Gold

Sythe.org — A Virtual Goods Trading Hub

Make real cash! buying and selling in-game items.

We have a no-scam policy.

You can make thousands playing your favourite games here at Sythe.org.

Just sign up an account and follow the rules!


Take me to

Runescape Markets

Other Game Markets

Support Center

Register an Account

Close
Find Runescape Window
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 11-06-2010, 10:45 PM
Govind's Avatar
Hero
Highly Respected Highly Trusted Sythe Verified User
 
Join Date: Apr 2005
Posts: 7,068
Default Find Runescape Window

Declare the following global variables:
int count = 0, count2 = 0; HWND frame;

The first two functions are to count the number of windows present and compare it to the count variable for the actual finding of Runescape and decide when to finish.

hFinished is a static (label) control that displays the result to the user.

These functions are intended to be used as such:

1. First, call EnumWindows in main with CountAllWindows as the callback function
2. Then, call EnumWindows in main with TopLevelSearch as the callback function

Manually write your own code for checking dimensions and stuff. You can change the hFinished stuff to your own notification that RS isn't running, of course.
Code:
bool GetSecondDepth(HWND parent)
{
        frame = FindWindowEx(parent,NULL,"SunAwtCanvas",NULL);
        if(frame) return true;
        return false;
}
BOOL CALLBACK EnumChildCount(HWND hWnd, LPARAM lParam)
{
	count++;
	return TRUE;
}

BOOL CALLBACK CountAllWindows(HWND hWnd, LPARAM lParam)
{
	count++;
	EnumChildWindows(hWnd, EnumChildCount, 0);
	return TRUE;
}

BOOL CALLBACK FindRSApplet(HWND hWnd, LPARAM lParam)
{
	count2++;
	TCHAR *RScmp = (TCHAR*)malloc(1000);
	GetClassName(hWnd,RScmp,1000);
	//wchar_t hBuf[100];
	if(wcscmp(RScmp,TEXT("SunAwtCanvas"))==0)
	{
		if(GetSecondDepth(hWnd))
		{
			return FALSE;
		}
		return TRUE;
	}
	
	if(count2==count)
	{
		//MessageBox(0,TEXT("You either have no browser open, or RS is not open in your browser."),TEXT("Problem!"),MB_OK|MB_ICONINFORMATION);
		SetWindowText(hFinished,TEXT("RS Not Found.  Make sure RS is set to Min Quality and Fixed size."));
		return FALSE;
	}
	return TRUE;
}

BOOL CALLBACK TopLevelSearch(HWND hWnd, LPARAM lParam)
{
	count2++;
	if(count2==count)
	{
		//MessageBox(0,TEXT("You either have no browser open, or RS is not open in your browser."),TEXT("Problem!"),MB_OK|MB_ICONINFORMATION);
		SetWindowText(hFinished,TEXT("RS Not Found.  Make sure RS is set to Min Quality and Fixed size."));
		return FALSE;
	}
	EnumChildWindows(hWnd,FindRSApplet,0);
	
	return TRUE;
}

Last edited by SMR : 11-15-2010 at 01:54 AM.
Reply With Quote
Reply



Cheap RS Gold Store  Runescape Gold

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

All times are GMT +1. The time now is 01:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.1