Solved

ShowMessage

Posted on 2006-07-18
7
548 Views
Last Modified: 2010-05-18
Hi.

I want to show a message when a proc starts and then terminate it when the calculation end.
(form is hidden)
How can i show a message without the ok button and then kill it ?
0
Comment
Question by:CodedK
[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
7 Comments
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 17129425
    Hi!
Why don't you create a Form displaying the message in a Label
Displaying and hiding form is easy ;)

Regards,
  Tomas Helgi
0
 
LVL 10

Expert Comment

by:atul_parmar
ID: 17129609
Another reason to go with TomasHelgi is that the ShowMessage and MessageDlg are modal, so until it is terminated, it won't execute the next line of code. So, even if you use your form to display the msg, it should be modalless.
0
 
LVL 16

Author Comment

by:CodedK
ID: 17130305
Hi, thanks for the replys.
If there is no other way to handle the message of course i'll have to use the form...
I was thinking if someone has a source or a customized message dialog that can accept commands.

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 9

Expert Comment

by:ginsonic
ID: 17131493
MessageDlg('Welcome!', mtCustom, [], 0) ;
0
 
LVL 9

Accepted Solution

by:
ginsonic earned 250 total points
ID: 17131657
Show message with:

MessageDlg('I wish to do something in this time!', mtWarning, [], 0);

when all is done then close with:
var wh:HWND;
begin
  wh:=FindWindowByTitle('Warning');
  PostMessage (Wh, WM_CLOSE, 0, 0);
end;

the function for FindWindowByTitle is:

function TForm1.FindWindowByTitle(WindowTitle: string): Hwnd;
var
  NextHandle: Hwnd;
  NextTitle: array[0..260] of char;
begin
  NextHandle := GetWindow(Application.Handle, GW_HWNDFIRST);
  while NextHandle > 0 do begin
    GetWindowText(NextHandle, NextTitle, 255);
    if pos(WindowTitle, StrPas(NextTitle)) <> 0 then
    begin
      result := NextHandle;
      exit;
    end else
      NextHandle := GetWindow(NextHandle, GW_HWNDNEXT);
  end;
  result := 0;
end;
0
 
LVL 16

Author Comment

by:CodedK
ID: 17132114
Thank you GinSonic :)
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 17138433
My pleasure!
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
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 Month3 days, 19 hours left to enroll

630 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