Mouse position: Difference between revisions

New post.
(Added vala)
(New post.)
Line 272:
return 0;
}</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#}}==
871

edits