🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms
Article #2142

Re: cursor/caret question

#2142
From: Gary Piatt
Date: Tue, 12 Dec 1989 23:00
23 lines
1272 bytes
Gary Kipnis writes:
=>I am working on a program that constantly moves caret around the screen,
=>unfortunately when I use SetCaretPos() to advance caret to a new postion
=>most of the time the caret doesn't get erased from the previous position

You have to hide it first, otherwise, Windows just moves the caret
without changing the previous display.  The easiest way to avoid
this is to create your own function, a la:

void
MySetCaretPos(x,y)
int		x,y;			/* New caret position */
{
    HideCaret(NULL);			/* Hide the caret */
    SetCaretPos(x,y);			/* Move it to new position */
    ShowCaret(NULL);			/* Display it again */
}

This should work.  You may need to replace the NULL with the
handle of the active window (or with GetActiveWindow()), in
which case you'll have to add another parameter.

				-Garison-
Technical Details
Message-ID: <33884@mirror.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!samsung!think!ames!excelan!mips!prls!pyramid!pyrnj!mirror!garison
References: <32906@ucbvax.BERKELEY.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!samsung!think!ames!excelan!mips!prls!pyramid!pyrnj!mirror!garison
From: garison@mirror.UUCP (Gary Piatt)
Newsgroups: comp.windows.ms
Subject: Re: cursor/caret question
Message-ID: <33884@mirror.UUCP>
Date: 12 Dec 89 23:00:55 GMT
References: <32906@ucbvax.BERKELEY.EDU>
Reply-To: garison@prism.TMC.COM (Gary E. Piatt)
Organization: Very little
Lines: 23