C: How to place mouse pointer?

10 views
Skip to first unread message

Andreas Schnellbacher

unread,
Jul 31, 2017, 11:35:24 AM7/31/17
to
Hi.

during NEPMD development I wanted to place the mouse pointer:

For Sh+F10 (CUA definition for open popup menu), the pointer position
decides which of the three popup menus should be opened: mark exists
and pointer is within the mark, mark exists and pointer is outside
of the mark, no mark exists.

Setting the cursor to the mouse pointer would be easy. There exist map
functions. But I can't find anything about setting the mouse pointer to
the cursor position or to any other position.

It would be nice if someone could provide a code snippet or point me to
the C function I have to use.

--
Andreas Schnellbacher

Andreas Schnellbacher

unread,
Jul 31, 2017, 1:55:07 PM7/31/17
to
On 31.07.17 17:35, Andreas Schnellbacher wrote:

> during NEPMD development I wanted to place the mouse pointer:
>
> For Sh+F10 (CUA definition for open popup menu), the pointer position
> decides which of the three popup menus should be opened:

Additional info: The EPM macro functions (E language) are related to
the last mouse click, not to the actual pointer position. So maybe I
have to set the last mouse click programatically. In other words:
Setting the last mouse click to a selectable screen or application
window position would be sufficient for me.

--
Andreas Schnellbacher

Andreas Kohl

unread,
Jul 31, 2017, 1:57:25 PM7/31/17
to
Andreas Schnellbacher schrieb:
I doubt that any C library function can be utilised. For PM programs you
could call WinQueryCursorInfo an give the x/y values from CURSORINFO
later to WinSetPointerPos.

--
Andreas

Andreas Schnellbacher

unread,
Jul 31, 2017, 2:14:57 PM7/31/17
to
On 31.07.17 19:56, Andreas Kohl wrote:

> I doubt that any C library function can be utilised. For PM programs you
> could call WinQueryCursorInfo an give the x/y values from CURSORINFO
> later to WinSetPointerPos.

Yes, see also my last posting. The following functions exist:

o WinQueryWindowPos
o WinMapWindowPoints
o WinSetPointerPos
o WinPopupMenu

If I would use WinPopupMenu in EPM (C functions can be used in the macro
language), then I wouldn't have that problem: Then I could specify the x
and y position.

But I would like to use the internal EPM function, which lacks these
parameters. It simply takes the position of the last mouse click. (The
advantage of the internal EPM function is that is has a scriptable
interface for the E macro language.)

--
Andreas Schnellbacher

Andreas Schnellbacher

unread,
Jul 31, 2017, 2:28:21 PM7/31/17
to
On 31.07.17 19:55, Andreas Schnellbacher wrote:

> Additional info: The EPM macro functions (E language) are related to
> the last mouse click, not to the actual pointer position.

A workaround could be to move the popup window to a specified position
after opening it. But maybe issuing a mouse click per code would be
better.

--
Andreas Schnellbacher
Reply all
Reply to author
Forward
0 new messages