Solved

Mouse

Posted on 1998-09-19
4
170 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ddeman not working in activex 3 93
Path  to current project in Delphi. 2 72
Unique identifier on a terminal server (rdp) 4 46
Delphi and Access based Enumeration 9 47
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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

896 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

17 Experts available now in Live!

Get 1:1 Help Now