?
Solved

Mouse

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

Industry Leaders: 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
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…
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

770 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