?
Solved

changing mouse cursor pointer

Posted on 2000-04-27
3
Medium Priority
?
24,992 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 60 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

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

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

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
Suggested Courses

764 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