Solved

changing mouse cursor pointer

Posted on 2000-04-27
3
24,966 Views
Last Modified: 2013-12-26
how do you change the mouse cursor pointerat the start of the program and when the the mouse over a button.
0
Comment
Question by:spiritalker
3 Comments
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 20 total points
ID: 2765998
For set cursor in begin of apps:
void TJobsWin::SetupWindow()
{
  TWindow::SetupWindow();
  ....
  SetClassLong(GCL_HCURSOR,             /* changes cursor  */
    (LONG) ::LoadCursor(NULL,IDC_ARROW)); /* new */
  ....
}
For change cursor by mouse moving:

In begin of apps you prepare cursor:
  hHand = ::LoadCursor(hInst, MAKEINTRESOURCE(IDC_HAND));
  Where hHand -> property of you clsss
  HCURSOR hHand
  IDC_HAND reference you line in you REC file
  For example:
#define IDC_HAND 1000

IDC_HAND CURSOR "mycursor.cur"


 In destructor you must
 ::DestroyCursor(hHand);

 In you DEFINE_RESPONSE_TABLE add line:
DEFINE_RESPONSE_TABLE1(TJobsWin, TWindow)
.....
   EV_WM_MOUSEMOVE,
.....
END_RESPONSE_TABLE;

You EvMouseMove may be as:
void TJobsWin::EvMouseMove(UINT /*modKeys*/, TPoint& point)
{
  static bool bHand = FALSE;
  static HCURSOR oldCursor;
  bool bIn = InsideMyObject(point);
  if (bIn)         //inside
    {
      ::SetCursor(hHand);
      bHand = true;
    }
  else if (bHand && !bIn)      //Out
    {                         //restore
      ::SetCursor(oldCursor);  //or
      ::SetCursor(otherCursor);  //or

      bHand = false;
    }
}
I hope, it helps. Alex

BTW : 20 PTS???
0
 

Author Comment

by:spiritalker
ID: 2807122
hard to follow for a beginner
0
 
LVL 1

Expert Comment

by:cjones1612
ID: 12917079
using vb.net
me.cursor.current=system.windows.forms.cursors.(select the cursor you would like to use)
for example:
me.cursor.current=system.windows.forms.cursors.waitcursor

Hope this helps.
Charles
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

823 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question