// in .h file: enum MouseCursor; // from Borland C++ Builder help notes class WaitCursor { public: WaitCursor(); ~WaitCursor(); private: MouseCursor saved_cursor; }; // in .cpp file: WaitCursor::WaitCursor() { saved_cursor = Screen->Cursor; Screen->Cursor = crHourGlass; } WaitCursor::~WaitCursor() { Screen->Cursor = saved_cursor; }
void read_database() { WaitCursor just_a_second; ... code to open database, read items, close connection }