PDA

View Full Version : Bitmap Cursor in Win98



EricLang
01-10-2006, 02:05 PM
For creating a custom cursor in normal windowed mode I use the code down here. In Win2000 or XP it works OK. I see my cursor but in Win98 the cursor stays just as always.
Why doesn't this work in Win98?
How to get it working in Win98?

var
BmpColor, BmpMask: TBitmap;
Info: TIconInfo;
Cur : HCURSOR;

BmpColor := TBitmap.Create;
BmpMask := TBitmap.Create;
BmpColor.LoadFromSomething(...)
BmpMask.LoadFromSomething(...)

with Info do
begin
fIcon := False;
xHotspot := 7
yHotspot := 7
hbmMask := BmpMask.Handle;
hbmColor := BmpColor.Handle;
end;

Cur := CreateIconIndirect(LemCursorIconInfo);
Screen.Cursors[1] := Cur;

BmpColor.Free;
BmpMask.Free;

JernejL
01-10-2006, 07:03 PM
I'm not exactly sure what you are on about, but you should read this article:

http://www.efg2.com/Lab/Graphics/CursorOverlay.htm


Purpose
The purpose of this project is to show how to convert a cursor to a bitmap and overlay its bitmap on another bitmap.

The article and program were originally made to work on win98. i hope it helps ;)

edit: also see the program notes:


Hardware Requirements
True color (24 or 32-bit) display. Fails on many high color (16 bit) displays.

so check out if you are running in 16 bit color depth!