Solved

Mouse

Posted on 1998-09-19
4
169 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 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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

13 Experts available now in Live!

Get 1:1 Help Now