[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Mouse

Posted on 1998-09-19
4
Medium Priority
?
180 Views
Last Modified: 2010-04-06
1. How to make mouse's OnClick event de-active
   and than change that cursor into different shape ?

   I will describe the process like this :

   {Mouse active}
   while Process do
   begin
     {Mouse de-active, change the cursor of mouse}
     .
     .
     .
   end;
   {Mouse active, change the cursor to default}

2. Any site that contains cursor's shapes ?
   How to use it in Delphi application ?
0
Comment
Question by:joely
[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
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
erajoj earned 200 total points
ID: 1340312
Hi,
Deactivating the mouse is rather complicated and risky but flushing the messagequeue of mousemessages is simple and safe, therefore...
 ...do you mean something like this?:

const
  crMyCursor = 1;
  ...
  Screen.Cursors[ crMyCursor ] := LoadCursor( hInstance, 'MYCURSOR' );

procedure TForm1.MyEvent(Sender: TObject);
var
  lpMsg: TMsg;
begin
  Screen.Cursor := crMyCursor;
  try
    Long_Process;

    // flush all mouse messages owned by this thread...
    while GetQueueStatus( QS_MOUSE ) <> 0 do GetMessage(lpMsg, 0, WM_MOUSEFIRST, WM_MOUSELAST);
  finally
    Screen.Cursor := crDefault;
  end;
end;

/// John
0
 

Author Comment

by:joely
ID: 1340313
Is possible to make it as a procedure ?
Because I have many process (while...do) that need process deactivating the mouse.
0
 
LVL 4

Expert Comment

by:erajoj
ID: 1340314
Sure, why not.

procedure FlushMouseMessages;
begin
  while GetQueueStatus( QS_MOUSE ) <> 0 do GetMessage(lpMsg, 0, WM_MOUSEFIRST, WM_MOUSELAST);
end;

/// John
0
 

Author Comment

by:joely
ID: 1340315
I'm sorry, I still confuse.
Where process to make mouse's OnClick event active and de-active.
I think (may be) any two procedure, procedure active and procedure de-active.

Joely
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

656 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