Solved

changing mouse cursor pointer

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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
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…
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)

705 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