User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 402,956 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,929 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 798 | Replies: 12
Join Date: Mar 2008
Location: UK
Posts: 377
Reputation: williamhemsworth is a jewel in the rough williamhemsworth is a jewel in the rough williamhemsworth is a jewel in the rough 
Rep Power: 3
Solved Threads: 37
williamhemsworth's Avatar
williamhemsworth williamhemsworth is online now Online
Posting Whiz

Re: Mouse Click

  #11  
May 10th, 2008
Not only that, most people think that it is entirely impossible to do graphics in console applications. Heres the proof againts that:

#define _WIN32_WINNT 0x0500
#include<windows.h>
#include<iostream>
using namespace std;

int main() {
	HWND console = GetConsoleWindow();
	HDC hdc = GetDC(console);
	SelectObject(hdc, CreatePen(0, 30, RGB(255,255,255)));
	POINT p;
	GetCursorPos(&p);
	ScreenToClient(console, &p);
	MoveToEx(hdc, p.x, p.y, NULL);
	for (;;) {
		GetCursorPos(&p);
		ScreenToClient(console, &p);
		LineTo(hdc, p.x, p.y);
		Sleep(1);
	}
	ReleaseDC(console, hdc);
	cin.ignore();
	return 0;
}
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 6:48 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC