Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default VBA to position my mouse cursor on my desired spot on screen

How can I tell VBA to position my mouse cursor at my desired point on screen?

Certain applications (non MS Office) in my desktop does not support
navigation using keyboard punches (eg Ctrl+Right Arrow to select its next
tab). Therefore, I need to tell "VBA to go to a certain position on the
screen". When this is achieved, I will use sendkey (SendKeys "~", True) wrap
up the task.

Pls show me some sample codes. I will adjust the X & Y value to my desired
position.

Edmund
Using Excel 2000
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA to position my mouse cursor on my desired spot on screen

the mouse position really has no effect on where SendKeys are sent. They
are sent to the activewindow. You would need to use the Windows API to
bring your window to the foreground and then do the sendkeys.

this code might give you some ideas:

http://vbnet.mvps.org/index.html?cod...estorehwnd.htm

--
Regards,
Tom Ogilvy


"Edmund" wrote in message
...
How can I tell VBA to position my mouse cursor at my desired point on
screen?

Certain applications (non MS Office) in my desktop does not support
navigation using keyboard punches (eg Ctrl+Right Arrow to select its next
tab). Therefore, I need to tell "VBA to go to a certain position on the
screen". When this is achieved, I will use sendkey (SendKeys "~", True)
wrap
up the task.

Pls show me some sample codes. I will adjust the X & Y value to my desired
position.

Edmund
Using Excel 2000



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default VBA to position my mouse cursor on my desired spot on screen

Edmund,
Depending on what these "certain applications" are, the FindWindow,
FindWindowEx and SendMessage may be a more reliable method.

NickHK

"Edmund" wrote in message
...
How can I tell VBA to position my mouse cursor at my desired point on

screen?

Certain applications (non MS Office) in my desktop does not support
navigation using keyboard punches (eg Ctrl+Right Arrow to select its next
tab). Therefore, I need to tell "VBA to go to a certain position on the
screen". When this is achieved, I will use sendkey (SendKeys "~", True)

wrap
up the task.

Pls show me some sample codes. I will adjust the X & Y value to my desired
position.

Edmund
Using Excel 2000



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you make the cursor go to a designated spot after pressing. Bustasinclair Excel Discussion (Misc queries) 3 September 21st 06 12:59 AM
Position of CellCursor on Screen (absolute position) [email protected] Excel Programming 1 November 23rd 05 02:23 AM
how can i print a screen showing mouse cursor Clive Excel Discussion (Misc queries) 1 June 13th 05 02:49 AM
Mouse Position Max Potters Excel Programming 3 September 28th 04 06:09 PM
position mouse cursor in msg box swatsp0p[_2_] Excel Programming 2 September 24th 04 07:12 AM


All times are GMT +1. The time now is 03:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"