Solved

changing mouse cursor pointer

Posted on 2000-04-27
3
24,952 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
Comment Utility
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
Comment Utility
hard to follow for a beginner
0
 
LVL 1

Expert Comment

by:cjones1612
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now