Re: ClipCursor trouble

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



The point is based on client coordinates of a sprite's rectangle. Joe, I
abbreviated because the related chunks are quite intricate with
calculations, and I wanted to make sure I got an answer in this group. In
short, the cursor is "demoed" from its current location to
m_ptMoveCursorToward, with the related timer killed when ptMoveCursorFrom
becomes equal to ptMoveCursorToward. The cursor is clipped at every point
along its path. The process is normally very smooth and perfectly accurate;
but when I resize the window, the cursor parallels the path at a distance.
Is it possible to advise me on the basis of this information?
------------------
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:a5nvl2l09pq5tn3cbnkk26epki51l7hgjj@xxxxxxxxxx
Not enough information here. Is CPoint in screen or client coordinates?
On Sat, 18 Nov 2006 19:54:06 -0500, "Steve Russell"
<srussell@xxxxxxxxxxxxxxxxxxxxxx>
wrote:

Thanks, Joe. Here is where I think the trouble first shows up. I have
spent all day trying to understand and solve it, including various uses of
ScreenToClient etc that I have read in various literature, particularly
after your comments.

void CTestView::SetMoveCursorToward(CPoint point)
{
m_ptMoveCursorToward.x = point.x;
m_ptMoveCursorToward.y = point.y;
****
What's wrong with writing
m_ptMoveCursorToward = point;
?
I don't see the role this plays. A spec of expected behavior would help.
How is 'point'
computed, and what relationship does it have to the current cursor
position? And since I
don't actually see a SetClipCursor call anywhere here, it is hard to guess
what is
intended.
****

::GetCursorPos(&m_ptMoveCursorFrom);
m_bCursorCouldBeMovingToward = true;
m_nMoveCursorTowardCounter = 0;
SetTimer(Timer_MoveCursorToward,0,NULL);
*****
Since the role of these variables is not defined, and the role of the
timer is not
specified, and the timer handler code is not shownt is hard to guess what
any of this code
is attempting to do.
****
}
--------
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:id3vl2pjg1eeed3o670fvk20il8ma03u05@xxxxxxxxxx
Show the code. Note that you must use screen coordinates, which means
you
must recompute
the cursor position any time the window is moved or resized.
joe
On Sat, 18 Nov 2006 17:03:47 -0500, "Steve Russell"
<srussell@xxxxxxxxxxxxxxxxxxxxxx>
wrote:

I should add that in the resized window, when I run a test with
GetCursorPos
and then create a small color filled rectangle centered on those
coordinates, the rectangle is accurate, but my cursor is in a different
position. The smaller the window, the greater the divergence.
-------------
"Steve Russell" <srussell@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23%231Ujo1CHHA.4928@xxxxxxxxxxxxxxxxxxxxxxx
I am unable to use ClipCursor accurately when I resize my window.
Maximized is the only state in which I get perfect results. Is there
something I should know about the relationship between ClipCursor and
resizing a window?


Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm


.



Relevant Pages

  • Re: convert hyperlink to email address
    ... If the Project Explorer is not showing, ... A blank window should open up to the right. ... then you can close the VBE. ... won't be any changes (except the flashing cursor moving down to the next ...
    (microsoft.public.excel.programming)
  • Re: Customising Word for Visually-Impaired
    ... the application will grab hold of the cursor and do its own thing with it. ... perhaps a black-bordered window around the insertion point to draw attention ... But I've found it impossible to get the handle of the Word window ... Control Panel> Accessibility Options> Display> Cursor Width ...
    (microsoft.public.windowsxp.accessibility)
  • RE: hide cursor for kiosk application (powerpoint)
    ... you use a WebBrowser control to display ... PowerPoint document and you'd like to hide the cursor on the WebBrowser. ... I watch the messages of the paneClassDC "Slide Show" window. ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: MFC: Drag & Drop ohne die Maus zu verwenden?
    ... >> system will direct mouse input to the specified window only if a mouse ... > Prozess bekommt IMHO keine Nachricht das der Cursor über seinem Fenster ... Ich bin da auf einen Artikel gestossen mit mouse_event, ...
    (microsoft.public.de.vc)
  • Re: Detecting button push
    ... David Olsson wrote: ... > I have a window with a number of buttons (created using CreateWindow ... mouse button while the cursor is in the client area of a window. ... Value of the high-order word of lParam. ...
    (microsoft.public.win32.programmer.ui)