?
Solved

How to avoid modal popup message(s)?

Posted on 2004-11-08
2
Medium Priority
?
189 Views
Last Modified: 2010-04-04
In a program I frequently read from the clipboard, but some times a modal popup message occurs: "Cannot open clipboard". How can I avoid this? It is not crucial for my program; I can go on without having accessed the clipboard, but it is indeed crucial for the program NOT to stop and require a click on the "OK" button. Is there a way to avoid any of these messages? (And what do I do wrong when attempting to access the clipboard?)
0
Comment
Question by:haab
2 Comments
 
LVL 13

Assisted Solution

by:BlackTigerX
BlackTigerX earned 75 total points
ID: 12524426
just put the code inside a try..except end

try
//code to access the clipboard here
except
//do nothing, you don't care about errors
//you may return false or do something else here
end
0
 
LVL 12

Accepted Solution

by:
Ivanov_G earned 75 total points
ID: 12524534
uses Clipbrd;

procedure TForm1.Button1Click(Sender: TObject);
begin
  try
    if not (Trim(Clipboard.AsText) = '') then
      begin
        // your clipboard is not empty

      end;
  except
  end;
end;
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Loops Section Overview
Suggested Courses

839 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