Hello,
somewhat stange; even searching for that problem and having found some solution, none did work.
Does someone has a simple example to keep the mouse cursor on a hyperlink gadget an arrow?
No matter if in event-loop or callback.
I found some examples; but maybe they are too old and don't work anymore.
Any help apreciated!
Thanks a lot!
HyperLinkGadget; Mouse Cursor;
- RSBasic
- Moderator

- Posts: 1228
- Joined: Thu Dec 31, 2009 11:05 pm
- Location: Gernsbach (Germany)
- Contact:
Re: HyperLinkGadget; Mouse Cursor;
Code: Select all
EnableExplicit
Global HyperLinkProc
Global hCurcor_Arrow = LoadCursor_(0, #IDC_ARROW)
Procedure HyperLinkProc(hWnd, uMsg, wParam, lParam)
Select uMsg
Case #WM_SETCURSOR
SetCursor_(hCurcor_Arrow)
ProcedureReturn 1
EndSelect
ProcedureReturn CallWindowProc_(HyperLinkProc, hWnd, uMsg, wParam, lParam)
EndProcedure
If OpenWindow(0, 0, 0, 500, 250, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
HyperLinkGadget(1, 10, 10, 480, 20, "http://www.purebasic.de - without hand cursor", 0)
HyperLinkGadget(2, 10, 30, 480, 20, "http://www.google.de - with hand cursor", 0)
HyperLinkProc = SetWindowLongPtr_(GadgetID(1), #GWL_WNDPROC, @HyperLinkProc())
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIfRe: HyperLinkGadget; Mouse Cursor;
One more tech.(Windows only)
Code: Select all
CrossCur = LoadCursor_(0, #IDC_CROSS)
HelpCur = LoadCursor_(0, #IDC_HELP)
OpenWindow(0, 0, 0, 500, 250, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
HyperLinkGadget(0, 10, 10, 480, 20, "http://www.purebasic.de - without hand cursor", 0)
HyperLinkGadget(1, 10, 30, 480, 20, "http://www.google.de - with hand cursor", 0)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit=1
Case #WM_MOUSEMOVE
Select ChildWindowFromPoint_(WindowID(0),WindowMouseY(0) << 32 + WindowMouseX(0))
Case GadgetID(0)
SetClassLongPtr_(GadgetID(0), #GCL_HCURSOR, 0)
SetCursor_(CrossCur)
Case GadgetID(1)
SetClassLongPtr_(GadgetID(1), #GCL_HCURSOR, 0)
SetCursor_(HelpCur)
EndSelect
EndSelect
Until Quit=1
Egypt my love
HyperLinkGadget; Mouse Cursor;
Hello RASHAD,
thanks a lot!
I forgot the loadCursor... damned... friday...
Better put some code example the next time in my code, so the error is obviously seen.
Thanks again, indeed.
Always apreciate Your help!!!
thanks a lot!
I forgot the loadCursor... damned... friday...
Better put some code example the next time in my code, so the error is obviously seen.
Thanks again, indeed.
Always apreciate Your help!!!
Re: HyperLinkGadget; Mouse Cursor;
The friday problem did let me also forget a really good help...
Here it is: http://www.rsbasic.de/winapi-library/
Thanks again,
RASHAD and RSBasic!!!
Here it is: http://www.rsbasic.de/winapi-library/
Thanks again,
RASHAD and RSBasic!!!


