Not having any luck. Thanks anyhow, Shark.
If I change the SetCursor to SetSystemCursor, it works fine but that's for a system-wide cursor change and I don't need that.
Announcement
Collapse
No announcement yet.
Use custom cursor pointer for app only
Collapse
X
-
Use the MemoryEx load library feature:
Code:User32 = Library.Load("user32.dll");
Also in the SETCURSOR message I can't remember if you have to reset the cursor before returning true or not as it's been a while.
Search the forum for MemoryEx examples for dealing with strings, I haven't got that on this PC either to help.
Leave a comment:
-
Code:sCursorFile = "AutoPlay\\Docs\\Normal Select.cur"; nCursorID = 32512; local hCursor = DLL.CallFunction(_SystemFolder.."\\user32.dll", "LoadCursorFromFileA", "\""..sCursorFile.."\"", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); DLL.CallFunction(_SystemFolder.."\\User32.dll", "SetCursor", hCursor..","..nCursorID, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
I've added your code after my code as well and it's not stopping the application from crashing.
Leave a comment:
-
I can't right now as the PC to hand has no AMS on it but there are lots of examples here showing MemoryEx subclassing the main window so just copy that then deal with the message, ie (air code):
Code:Imbusy = true; -- set once you've set the cursor local s = Subclass.Create(MYMainWindowHandle,function(hWnd,uMsg,wParam,lParam) if uMsh == WM_SETCURSOR then if Imbusy then return true end end return Subclass.OldWinProc(hWnd, uMsg, wParam, lParam) end)
Leave a comment:
-
Originally posted by Shrek View PostCursors are windows specific so if you set a cursor on a window then move out of that window the default cursor for the new window will be used and the window you just left when you enter it again will show its default cursor, this is how Microsoft designed windows so if your looking to say have a busy cursor shown on all windows off your application all the time (till you turn it off) then you handle the WM_SETCURSOR message and return true if you are in a busy state and wish your busy cursor to remain or false to do the default cursor.
None of the tutorials or posts on this forum do work for persistent cursors but it can be done easily with MemoryEx.
Leave a comment:
-
Cursors are windows specific so if you set a cursor on a window then move out of that window the default cursor for the new window will be used and the window you just left when you enter it again will show its default cursor, this is how Microsoft designed windows so if your looking to say have a busy cursor shown on all windows off your application all the time (till you turn it off) then you handle the WM_SETCURSOR message and return true if you are in a busy state and wish your busy cursor to remain or false to do the default cursor.
None of the tutorials or posts on this forum do work for persistent cursors but it can be done easily with MemoryEx.
Leave a comment:
-
Originally posted by kingzooly View PostIf you look around you will find examples that do work in the app only, I have not used them for years as there only toys but it is possible.
Leave a comment:
-
Originally posted by Ronin View PostHi,
I've checked the forums and found some threads related to this but none of the solutions worked.
Basically I want to use a custom cursor pointer inside the application's window only. If the cursor moves outside, it should return to the default cursor pointer.
Thanks.
Leave a comment:
-
Use custom cursor pointer for app only
Hi,
I've checked the forums and found some threads related to this but none of the solutions worked.
Basically I want to use a custom cursor pointer inside the application's window only. If the cursor moves outside, it should return to the default cursor pointer.
Thanks.Tags: None
Leave a comment: