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
For Tyro
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 12-25-2010, 09:17 PM
Govind's Avatar
Hero
Highly Respected Highly Trusted Sythe Verified User
 
Join Date: Apr 2005
Posts: 7,068
Default For Tyro

Code:
#define IDT_TIMER1 1001
#include <Windows.h>
LRESULT CALLBACK WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK FontProc(HWND hWnd, LPARAM lParam);
VOID CALLBACK TimerProc(HWND hWnd, UINT Msg, UINT_PTR idEvent, DWORD dwTime);
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
	WNDCLASSEX wc;
	MSG msg;
	HWND hwnd, hCursor;
	wc.cbClsExtra = 0;
	wc.cbSize = sizeof(WNDCLASSEX);
	wc.cbWndExtra = 0;
	wc.hbrBackground = (HBRUSH) COLOR_WINDOW;
	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
	wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
	wc.hInstance = hInstance;
	wc.lpfnWndProc = WndProc;
	wc.lpszClassName = TEXT("CurPosWnd");
	wc.lpszMenuName = NULL;
	wc.style = 0;

	RegisterClassEx(&wc);

	hwnd = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, TEXT("CurPosWnd"), TEXT("Cursor"), WS_VISIBLE | WS_SYSMENU, 10, 10, 100, 100, NULL, NULL, hInstance, NULL);
	hCursor = CreateWindowEx(0, TEXT("STATIC"), TEXT("0, 0"), WS_VISIBLE | WS_CHILD, 10, 25, 70, 20, hwnd, NULL, hInstance, NULL);

	ShowWindow(hwnd, SW_SHOW);
	EnumChildWindows(hwnd, FontProc, 0);
	SetTimer(hwnd, IDT_TIMER1, 50, TimerProc);
	UpdateWindow(hwnd);
	//PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
	while(GetMessage(&msg, NULL, 0, 0) > 0)
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}

	return msg.wParam;

}

VOID CALLBACK TimerProc(HWND hWnd, UINT Msg, UINT_PTR idEvent, DWORD dwTime)
{
	HWND hCursor = FindWindowEx(hWnd, 0, TEXT("STATIC"), NULL);
	TCHAR cursorBuf[20];
	POINT p;
	GetCursorPos(&p);
	wsprintf(cursorBuf, TEXT("(%d, %d)"), p.x, p.y);
	SetWindowText(hCursor, cursorBuf);	
}

BOOL CALLBACK FontProc(HWND hWnd, LPARAM lParam)
{
	HFONT hfDefault = (HFONT) GetStockObject(DEFAULT_GUI_FONT);
	SendMessage(hWnd, WM_SETFONT, (WPARAM) hfDefault, MAKELPARAM(FALSE, 0));
	return TRUE;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
	switch(Msg)
	{
	case WM_CLOSE:
		DestroyWindow(hWnd);
		break;
	case WM_DESTROY:
		KillTimer(hWnd, IDT_TIMER1);
		PostQuitMessage(0);
		break;
	default:
		return DefWindowProc(hWnd, Msg, wParam, lParam);
	}
	return 0;
}
Coordinate-finder source.
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 03:44 AM.


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