Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Problem mit SetSystemCursor (https://www.delphipraxis.net/146086-problem-mit-setsystemcursor.html)

cookie22 13. Jan 2010 02:35


Problem mit SetSystemCursor
 
hallo,

ich tausche mit SetSystemCursor den cursor global aus, leider bekomme ich den alten cursor nicht zurück. ich mach das so.

Delphi-Quellcode:
var
  OldCur, NewCur: HCursor;
begin
  OldCur := GetCursor;
  NewCur := LoadCursor(HInstance, MAKEINTRESOURCE(1));
  SetSystemCursor(NewCur, OCR_NORMAL);

  //...

  SetSystemCursor(OldCur, OCR_NORMAL);
end;
leider funktioniert das nicht, sieht jemand woran es liegt? für micht ist da kein fehler zu erkennen.

es scheint so als ob der neue cursor den alten überschreibt und auch dessen handle bekommt. :gruebel:

gruß,
cookie

busybyte 13. Jan 2010 03:19

Re: Problem mit SetSystemCursor
 
kurz gegoogelt, zum wiederherstellen
Delphi-Quellcode:
SystemParametersInfo(SPI_SETCURSORS, 0, nil, 0);

cookie22 13. Jan 2010 03:38

Re: Problem mit SetSystemCursor
 
Zitat:

Zitat von busybyte
kurz gegoogelt, zum wiederherstellen
Delphi-Quellcode:
SystemParametersInfo(SPI_SETCURSORS, 0, nil, 0);

Danke, das geht. :-D


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:28 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz