LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-11-2012, 02:36 AM   #1
newbie0101
Member
 
Registered: Nov 2011
Posts: 47

Rep: Reputation: Disabled
[C++] manipulating desktop question


hello, one short dummy question.
is it possible to write in C++(no java or anything else) application that will control desktop ?
by that i mean for example let's say i have opened a web browser and want the mouse pointer to follow all OK buttons and click on them automatically.
or will move to specific label and input pre-defined number.
what library i should look for (gtk+ or QT or ...) ?
thanks
 
Old 05-11-2012, 05:38 AM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Well, yes and no.

Yes you can move the mouse pointer: http://stackoverflow.com/questions/2...-in-c-on-linux

Yes you could e.g. take a screenshot and try to find a button with OK on it, or maybe download the HTML for the web page and then parse that to try and work out which buttons have OK on them.

No, it would not be easy at all to do.


A far better way to do it would be to use something like iMacros (also available for Chrome and IE) which would allow you to automate using web forms etc.
 
Old 05-11-2012, 09:11 AM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by newbie0101 View Post
for example let's say i have opened a web browser and want the mouse pointer to follow all OK buttons and click on them automatically.
or will move to specific label and input pre-defined number.
The example you gave does not require control of the desktop. It only requires automation of the web browser. And for that, there's Selenium.

Sample code here:
http://pypi.python.org/pypi/selenium

Last edited by dugan; 05-11-2012 at 09:22 AM.
 
Old 05-11-2012, 09:14 AM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Double post. Sorry.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
manipulating text arn2025 Linux - Newbie 4 03-27-2012 10:48 AM
manipulating partitions krelp Linux - Hardware 3 12-22-2006 12:47 PM
manipulating files tableyou Linux - Newbie 8 11-08-2005 02:38 AM
Manipulating NICs ? Infernal211283 Linux - Newbie 5 04-28-2005 11:46 AM
Manipulating Files in vi Baldorg Linux - General 1 09-19-2003 07:25 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration