I am perl beginner and installed successfully Tk module for GUI. I wanna write a script which must click at any particular location on Desktop window (please note that i am not creating any new window ,i have some existing window on desktop (not created by Perl program) and that alwyays pop at the center of Desktop). I wanna click on a button on that desktop window after every 30 minutes.

So i am trying to write a script for :

(1) Either obtaining handle of a window which is not created by perl's code (and not at all related to perl, it is obatined by inserting dongle in USB port which contains a button that i wanna click by perl script after every 30 mins).

(2) Or to find any way to click at the desktop at any position(because my that window launches always at same position so if i click at any particular position after in 30 mins through my script then it should work).

Any help in achieving my task ?

I have found GetDesktopWindow() but the problem is what if i loose focus of the window which i have to click ? and how to recognize which window will be in focus.

Is there any way to keep that window in focus ? (I mean i have seen in taskmanager that the window to be clicked is running by the name "App.exe") . Is this information not enough to keep in focus the window obtained by "App.exe".


In reply to How to get handle of a window on desktop (this window is not created by perl code) by ppp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.