|
-
December 27th, 2009, 07:10 AM
#1
GetCursorPos returns 0
Hey all,
Let me introduce myself. I'm Pepijn and I've programmed a few years in PHP. I'm trying to learn c++ now, but it's not very easy.
I wrote the following script so far, it has to display the cursors position in a dos window;
Code:
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
LPPOINT lpPoint;
int x;
int y;
if(!GetCursorPos(lpPoint))
{
cout << "An error occurred: " << endl;
cout << GetLastError();
}
else
{
x = lpPoint->x;
y = lpPoint->y;
cout << x << endl;
cout << y << endl;
}
cin.get();
return 0;
}
The problem is that GetCursorPos returns 0, but GetLastError returns 0 either.
I hope you can help.
Best regards,
Pepijn
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|