Board index » delphi » Changing system-cursors or hide all cursors in InternetExplorer

Changing system-cursors or hide all cursors in InternetExplorer

I'm using the InternetExplorer on a system with a touch-screen. Now i
want to hide the cursor. The showcursor-function works good within my
own application, but not with the IE. My idea was, to change all system
cursors to an empty cursor handle. This works, but not for the
handpoint-cursor. In windows.pas IDC_HAND and OCR_HAND are defined, but
with LoadCursor(0,IDC_HAND) i get a 0. Maybe this is working with
Windows2000 and not with NT or W95. Now i want to know, how can i hide
the cursor on IE or change it.

I'm using Delphi 5 Pro on WinNT 4 SP 5.

Thanks
Alex

-----SOME SOURCECODE---
procedure LoadCursors;
var
    myCursor : HCURSOR;

begin
    myCursor:=LoadCursor(HInstance, 'CUREMPTY');
    gEmptyCursor:=CopyCursor(myCursor);
    myCursor:=LoadCursor(0,IDC_ARROW);
    gIDC_ARROWCursor:=CopyCursor(myCursor);
    myCursor:=LoadCursor(0,IDC_APPSTARTING);
    gIDC_APPSTARTINGCursor:=CopyCursor(myCursor);
    myCursor:=LoadCursor(0,IDC_HAND); //retrieves 0 so it doesn't work
    gIDC_HANDCursor:=CopyCursor(myCursor);
end;

procedure HideCursors;
begin
    SetSystemCursor(CopyCursor(gEmptyCursor), OCR_NORMAL);
    SetSystemCursor(CopyCursor(gEmptyCursor), OCR_APPSTARTING);
    SetSystemCursor(CopyCursor(gEmptyCursor), OCR_HAND); //not working
end;

procedure ShowCursors;
begin
    SetSystemCursor(CopyCursor(gIDC_ARROWCursor), OCR_NORMAL);
    SetSystemCursor(CopyCursor(gIDC_APPSTARTINGCursor),
OCR_APPSTARTING);
    SetSystemCursor(CopyCursor(gIDC_HANDCursor), OCR_HAND); //not
working
end;
-----

 

Re:Changing system-cursors or hide all cursors in InternetExplorer


Try:
...
SetSystemCursor(LoadCursorFromFile('Empty.cur'),OCR_HAND);
...

or:

var Reg:TRegistry;
begin
   Reg:=TRegistry.Create;
   try
     Reg.RootKey := HKEY_CURRENT_USER;
     if Reg.OpenKey('Control Panel\Cursors\',True)
       then Reg.WriteString('Hand','D:\Empty.cur');
   finally
     Reg.CloseKey;
     Reg.Free;
   end;
end;

Work on Win98 with IE 4.0

Regards

JR

Quote
Alexander Heim wrote in message <38E0FB19.11790...@gkl.de>...
>I'm using the InternetExplorer on a system with a touch-screen. Now i
>want to hide the cursor. The showcursor-function works good within my
>own application, but not with the IE. My idea was, to change all system
>cursors to an empty cursor handle. This works, but not for the
>handpoint-cursor. In windows.pas IDC_HAND and OCR_HAND are defined, but
>with LoadCursor(0,IDC_HAND) i get a 0. Maybe this is working with
>Windows2000 and not with NT or W95. Now i want to know, how can i hide
>the cursor on IE or change it.

>I'm using Delphi 5 Pro on WinNT 4 SP 5.

>Thanks
>Alex

>-----SOME SOURCECODE---
>procedure LoadCursors;
>var
>    myCursor : HCURSOR;

>begin
>    myCursor:=LoadCursor(HInstance, 'CUREMPTY');
>    gEmptyCursor:=CopyCursor(myCursor);
>    myCursor:=LoadCursor(0,IDC_ARROW);
>    gIDC_ARROWCursor:=CopyCursor(myCursor);
>    myCursor:=LoadCursor(0,IDC_APPSTARTING);
>    gIDC_APPSTARTINGCursor:=CopyCursor(myCursor);
>    myCursor:=LoadCursor(0,IDC_HAND); //retrieves 0 so it doesn't work
>    gIDC_HANDCursor:=CopyCursor(myCursor);
>end;

>procedure HideCursors;
>begin
>    SetSystemCursor(CopyCursor(gEmptyCursor), OCR_NORMAL);
>    SetSystemCursor(CopyCursor(gEmptyCursor), OCR_APPSTARTING);
>    SetSystemCursor(CopyCursor(gEmptyCursor), OCR_HAND); //not working
>end;

>procedure ShowCursors;
>begin
>    SetSystemCursor(CopyCursor(gIDC_ARROWCursor), OCR_NORMAL);
>    SetSystemCursor(CopyCursor(gIDC_APPSTARTINGCursor),
>OCR_APPSTARTING);
>    SetSystemCursor(CopyCursor(gIDC_HANDCursor), OCR_HAND); //not
>working
>end;
>-----

Re:Changing system-cursors or hide all cursors in InternetExplorer


Thanks. I tried that, but no solution.
Alex

Quote
JR wrote:
> Try:
> ...
> SetSystemCursor(LoadCursorFromFile('Empty.cur'),OCR_HAND);
> ...

> or:

...
Quote
>      if Reg.OpenKey('Control Panel\Cursors\',True)
>        then Reg.WriteString('Hand','D:\Empty.cur');
> Work on Win98 with IE 4.0

Other Threads