Mouse position: Difference between revisions

Content added Content deleted
(Added vala)
(New post.)
Line 272: Line 272:
return 0;
return 0;
}</syntaxhighlight>
}</syntaxhighlight>

=={{header|C++}}==
Mouse pointers are part of the window manager system, therefore they are highly platform dependent.

This example works under a Windows operating system.
<syntaxhighlight lang="c++">
#include <iostream>

#include <windows.h>

int main() {
POINT MousePoint;
if ( GetCursorPos(&MousePoint) ) {
std::cout << MousePoint.x << ", " << MousePoint.y << std::endl;
}
}
</syntaxhighlight>
{{ out }}
<pre>
726, 506
</pre>


=={{header|c_sharp|C#}}==
=={{header|c_sharp|C#}}==