Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Mouse cursor questions for DB gurus

Author
Message
Kelebrindae
21
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 25th Sep 2003 14:02
As far as I know, DB Classic doesn't allow modifying the mouse cursor (the REAL mouse cursor. I know it's possible to "map" a sprite to the mouse coords, but that's not what I want to do.).
But I've got two ideas about which I'd like to know your opinion:

First idea:
If we know the memory address to the bitmap DB uses as the mouse cursor, perhaps we could use a memblock to change this bitmap (to modify its colour, to load another one, etc...).
Does anyone know how to locate this address in memory, or how to create a memblock pointing to it ?

Second idea:
Using the correct MsWindows DLL, is it possible to manipulate the DB mouse cursor ?
In another words, do DB-generated EXEs use the Windows mouse cursor (just with a different bitmap), or do they have their own (internally managed) ?

Ideas: memories of things which did not occur yet...
Kelebrindae
21
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 25th Sep 2003 18:09
Hint for the 2nd idea:
-> APIs in USER32.DLL

HCURSOR GetCursor (VOID)
HCURSOR LoadCursor (HINSTANCE hinst, LPCTSTR lpszCursor)

First line puts the mouse cursor's handle in HCURSOR.
Second line loads the bitmap contained at offset "lpszCursor" of the file "hinst" ("hinst" is the win handle of the file).

In a standard icon file, "lpszCursor" has the following values:
IDC_ARROW= 32512& Arrow (duh!)
IDC_IBEAM= 32513& Text selection pointer
IDC_WAIT = 32514& Waiting
IDC_CROSS = 32515& Cross (duh again!)
IDC_UPARROW = 32516& Vertical arrow
IDC_SIZE = 32640& 4-ways arrows
IDC_ICON = 32641& Empty
IDC_SIZENWSE = 32642& 2-ways arrows NO-SE
IDC_SIZENESW = 32643& 2-ways arrows NE-SO
IDC_SIZEWE = 32644& 2-ways arrows O-E
IDC_SIZENS = 32645& 2-ways arrows N-S
IDC_SIZEALL = 32646& Same as IDC_SIZE
IDC_NO = 32648& Forbidding sign
IDC_APPSTARTING = 32650& Arrow + waiting

(Source: http://www.secretswindows.com/ )

Hope it helps!

Ideas: memories of things which did not occur yet...
Phaelax
DBPro Master
22
Years of Service
Recently Online
Joined: 16th Apr 2003
Location: Metropia
Posted: 25th Sep 2003 23:00
Use a hex editor like reshack, and open dbc and change the cursor there. For DBC, the cursor you substitute has to be exactly the same size and same number of colors.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 26th Sep 2003 06:05
@Phaelax
i have to say that that is a very neat idea...

If Quizz's Are Quizzical, Then What Are Test's?
Kelebrindae
21
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 26th Sep 2003 12:34
Yes, I've already used ResHack once to change the icon; but it means you can have only 1 mouse cursor per EXE. I'd like to change the cursor at runtime (one cursor for the menus, another for the game, another one in map mode, etc.)

(Oh so very demanding... )

Ideas: memories of things which did not occur yet...
Compton
22
Years of Service
User Offline
Joined: 4th Dec 2002
Location:
Posted: 26th Sep 2003 18:41
Phaelax: Haha I use reshack all the time, and didn't know you could change the cursor that way. I'm using this in my new game now using an Amiga Workbench 1.3 cursor. And it rules! Thanks!
KNau
22
Years of Service
User Offline
Joined: 25th Nov 2002
Location: Canada
Posted: 27th Sep 2003 00:10
It sounds like an awful lot of work to avoid 2 lines of code for a sprite.

Is there something special you hope to achieve that can't be done with a sprite our mouse object?

http://www.canceriannewmedia.com
Compton
22
Years of Service
User Offline
Joined: 4th Dec 2002
Location:
Posted: 27th Sep 2003 16:41
With reshack? No thats not hard, its like replacing a picture in flash or something. You just get the image, and replace it with your own, then save.

Reshack has a graphical interface and everything, its really not hard.

You can even save the original to alter it, then load it back in your exe. Easy as pie.
Kelebrindae
21
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 30th Sep 2003 11:17
No, no; Nothing peculiar to achieve... It was more curiosity.
But thanks a lot all the people who took time to answer.

Ideas: memories of things which did not occur yet...

Login to post a reply

Server time is: 2025-05-20 17:53:42
Your offset time is: 2025-05-20 17:53:42