Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default mouse pointer . . . again!

is there a way to have the mouse pointer move from the form command button
you just clicked to some location on the screen (some X,Y coordinate) . just
so it is away from the form area itself is what is needed . . . any help
appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default mouse pointer . . . again!

A little search of google came up with a couple of API's that worked ok for me:

In a general module:

Option Explicit
Public Type POINTAPI
x As Long
y As Long
End Type

Declare Function SetCursorPos Lib "User32" _
(ByVal x As Long, ByVal y As Long) As Long
Declare Function GetCursorPos Lib "User32" _
(lpPoint As POINTAPI) As Long


Behind the form:

Option Explicit
Private Sub CommandButton1_Click()
Dim myPointAPI As POINTAPI
GetCursorPos myPointAPI
Call SetCursorPos(myPointAPI.x - 300, myPointAPI.y)
End Sub

(I used 300 with my button, but you could experiment and use whatever you
needed.)

lightbulb_bill wrote:

is there a way to have the mouse pointer move from the form command button
you just clicked to some location on the screen (some X,Y coordinate) . just
so it is away from the form area itself is what is needed . . . any help
appreciated.


--

Dave Peterson
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
mouse pointer Atishoo Excel Discussion (Misc queries) 2 June 16th 08 04:25 PM
mouse pointer robnsd Excel Discussion (Misc queries) 2 April 20th 07 10:17 PM
moving mouse pointer nath Excel Programming 1 August 16th 04 08:36 PM
Mouse pointer Simon Lloyd[_473_] Excel Programming 5 June 8th 04 07:08 PM
mouse pointer jim c. Excel Programming 0 September 6th 03 11:25 PM


All times are GMT +1. The time now is 03:56 PM.

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

About Us

"It's about Microsoft Excel"