Re: Open some dialog boxes and the mouse cursor moves to one of the di

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



SetCursorPos is actually Boolean, not Long.

Roman

"Scott Swigart" <scott@xxxxxxxxxxxxxxxxxxxxx> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ ×
ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:836F30B0-9E4C-40E0-A24F-BC6CCD432610@xxxxxxxxxxxxxxxx
> Here you go.
> Create a form with a button on it, and then paste in the following
code:
>
> Public Declare Function SetCursorPos Lib "user32" (ByVal X As
Integer,
> ByVal Y As Integer) As Long
> Public Declare Function ClientToScreen Lib "user32" (ByVal hWnd As
> IntPtr, ByRef point As POINT) As Boolean
>
> Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> Dim p As New POINT
> p.x = Button1.Left + (Button1.Width / 2)
> p.y = Button1.Top + (Button1.Height / 2)
> ClientToScreen(Me.Handle, p)
> SetCursorPos(p.x, p.y)
> End Sub
>
> - Scott Swigart
>
> P.S. Moving the mouse for the user is generally considered a no-no.
>
> "**Developer**" wrote:
>
> > Open some dialog boxes and the mouse cursor moves to one of the
dialog
> > buttons.
> > I'd like to implement that .
> > Is that simply something I have to program, i.e. figure out where I
want the
> > cursor and move it.
> > Or does DotNet help somehow?
> >
> > Thanks
> >
> >
> >


.



Relevant Pages

  • Re: Dont save file if condition is met
    ... I tried to save the workbook and your message popped up and the workbook closed. ... Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) ...
    (microsoft.public.excel.programming)
  • Re: Creating a list of workbook users
    ... Private Sub Workbook_BeforeClose(Cancel As Boolean) ... With Worksheets("hidden sheet") ... also created a macro in my personal workbook that allows me to toggle ...
    (microsoft.public.excel.programming)
  • Re: Setting a public variable
    ... the workbook is opened and protected to the point ... Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As ...
    (microsoft.public.excel.programming)
  • Re: Ask before auto increment.
    ... With the workbook active, ... Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) ...
    (microsoft.public.excel.programming)
  • Re: Auto increment a cell
    ... With the workbook active, ... Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) ...
    (microsoft.public.excel.programming)