//HandCursor.h #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #ifndef HandCursorh #define HandCursorh static const class CHandCursor { HCURSOR Cursor; bool Copied; public: CHandCursor() : Copied(false) { Cursor=::LoadCursor(0, MAKEINTRESOURCE(32649)); //Hope if we're on Windows version 5 or above. if(!Cursor) { //If not, steal the cursor from winhlp32.exe CString WinDir; UINT Length=GetWindowsDirectory(0,0); GetWindowsDirectory(WinDir.GetBuffer(Length), Length); WinDir.ReleaseBuffer(); HMODULE hModule=LoadLibrary(WinDir+"\\winhlp32.exe"); if(hModule) { HCURSOR hCur=::LoadCursor(hModule, MAKEINTRESOURCE(106)); if(hCur) { Cursor=CopyCursor(hCur); Copied=true; } } FreeLibrary(hModule); } } virtual ~CHandCursor() {try{if(Copied) DestroyCursor(Cursor);}catch(...){}} operator HCURSOR() const {return Cursor;} // So all you need is: } HandCursor; // HCURSOR MyCursor=HandCursor; #endif //ndef HandCursorh