Thread: eMonitor
View Single Post
Old 06-16-2012, 02:09 PM   #57
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,070
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by Armegalo View Post
Eek, I wouldn't know how to run it in the VM.
Nah, turning off the hardware accel didn't do much, but thanks for the suggestion.
And yep, it's a windows box (xp).
I'm brand new to python so still finding my way. One thing I thought was perhaps I could just draw a new pointer on top of the image after it's been captured.
Haven't had much luck so far - can't even get the bloody thing to tell me where the mouse actually is...

Code:
mouse=wx.MouseEvent()
mouse_pos=mouse.GetLogicalPosition(context)
print "Mouse ="+str(mouse_pos.x)+","+str(mouse_pos.y)
I get that "context" is probably the wrong thing to pass to the MouseEvent class but what should it be?
Okay, I searched codeproject.com for you. Here is the first link I found (Capturing the Desktop Screen with the Mouse Cursor Image): http://www.codeproject.com/Articles/...e-Mouse-Cursor

Although that project uses C#, you should be able to adapt it to C by using the same Win32api calls that it makes. Or find a different project.

To download source from codeproject, you may need a free login account. Code Project downloads typically use a COPL license (which is much like MIT or BSD, allowing commercial use).

EDIT: Okay, this shows a variety of ways to capture the screen in C (some with mouse pointer):
http://www.codeproject.com/Articles/...ing-the-screen
This one is LGPL, so for commercial use you would have to wrap it in a DLL.

Last edited by geekmaster; 06-16-2012 at 02:20 PM.
geekmaster is offline   Reply With Quote