[comp.windows.ms.programmer] How does one change the arrow cursor permanently?

magid@sandstorm.Berkeley.EDU (Paul Magid) (04/17/91)

	I have been able to change the cursor for a split second but
then it changes back to normal.  How does one make the change permanent I am 
sick of the arrow cursor?

Here is my rather primitive code in tpwin:


program cursor;


uses

	Winprocs,Wintype;

var

	hCursor:Thandle;


begin


	hCursor := SetCursor (Loadcursor(0,idc_UpArrow));
	showcursor(TRUE);

end.


Thank you in advance for any suggestions.

bonneau@hyper.hyper.com (Paul Bonneau) (04/18/91)

In article <1991Apr17.160822.8084@agate.berkeley.edu> magid@sandstorm.Berkeley.EDU (Paul Magid) writes:
>
>	I have been able to change the cursor for a split second but
>then it changes back to normal.  How does one make the change permanent I am 
>sick of the arrow cursor?
>
The problem is that you need to change the cursor EVERY time
you get a WM_SETCURSOR message!

Or, alternativley, if you capture the mouse, just change the
cursor once until you release it (SetCapture() and
ReleaseCapture()).

cheers - Paul Bonneau.

epperson@adobe.COM (Mark Epperson) (04/18/91)

In article <1991Apr17.160822.8084@agate.berkeley.edu> magid@sandstorm.Berkeley.EDU (Paul Magid) writes:
>
>	I have been able to change the cursor for a split second but
>then it changes back to normal.  How does one make the change permanent I am 
>sick of the arrow cursor?
>

This is the correct way to do it:

	if (hWnd)
		SetClassWord(hWnd, GCW_HCURSOR, hCursor);
	SetCursor(hCursor);

jseidman@jarthur.Claremont.EDU (Jim Seidman) (04/18/91)

magid@sandstorm.Berkeley.EDU (Paul Magid) writes:
>
>	I have been able to change the cursor for a split second but
>then it changes back to normal.  How does one make the change permanent I am 
>sick of the arrow cursor?
>
>Here is my rather primitive code in tpwin:
[code deleted]

The cursor will get reset as soon as you move it, so your program won't
work.  If all you want is to change the cursor, might I suggest my shareware
program, "Change Cursor."  It'll change ("permanently") the arrow, hourglass,
and I-beam cursors.  It's available on cica.cica.indiana.edu, and is only
$15.

-- 
Jim Seidman, Headland Technology, 46221 Landing Parkway, Fremont CA 94538
"It doesn't need to work.  They'll be paralyzed laughing at me."
							- The Doctor, "Shada"

gt3070b@prism.gatech.EDU (Jeff Watkins) (04/19/91)

You could just specify that the window cursor is something else, and every
time you enter your window, voila you have the cursor...

ciao
jeff

-- 
Jeff Watkins                       jwatkins@cadsun6.gatech.edu
Lotus Development WP Devision      (404) 315-0105 voice  (404) 315-0231 data
		"It isn't whether the child lives or dies,
			It is who makes the decision."

davel@booboo.SanDiego.NCR.COM (David Lord) (04/19/91)

 (Mark Epperson) writes:
> (Paul Magid) writes:
>>
>>	I have been able to change the cursor for a split second but
>>then it changes back to normal.  How does one make the change permanent I am 
>>sick of the arrow cursor?
>>
>
>This is the correct way to do it:
>
>	if (hWnd)
>		SetClassWord(hWnd, GCW_HCURSOR, hCursor);
>	SetCursor(hCursor);

Ah, just what I wanted to ask about. I thought it would be cute to have
a custom cursor show up in my About Box (a modeless dialog box) so I
used SetClassWord to do it. Worked great until I noticed that I had
changed the cursor for EVERY dialog box in the system. Notice that even
though you are calling it with a window handle of a specific window you
are actually changing the CLASS (in this case all dialog boxes).

So how do I do it without affecting everyone else?

Dave.Lord@SanDiego.NCR.COM