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
Solved

changing mouse cursor pointer

Posted on 2000-04-27
3
24,973 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

839 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