[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Mouse

Posted on 1998-09-19
4
Medium Priority
?
181 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
  • 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

830 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