Solved

How do i send a string to a windows dialog

Posted on 1998-03-28
11
155 Views
Last Modified: 2010-04-06
How do i send a text-string to a windows dialog (like the login dialog).
Can someone send a source?
0
Comment
Question by:tomeknik
  • 3
  • 3
  • 2
  • +2
11 Comments
 

Expert Comment

by:fant0m
ID: 1360978
You can try MessageDialog() or some API calls, I suggest looking in the help.
0
 

Expert Comment

by:fant0m
ID: 1360979
You can try MessageDialog() or some API calls, I suggest looking in the help.
0
 

Author Comment

by:tomeknik
ID: 1360980
Edited text of question
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Expert Comment

by:dr_gonzo
ID: 1360981
If it is a edit-box and you have the hwnd to it, you can use SetWindowText (covered in Win32.hlp)
0
 
LVL 2

Expert Comment

by:gysbert1
ID: 1360982
You can also send wm_char messages to the window and thus type the text character by character. This is the same as actually typing it since when typing in a window all characters are send to the underlying window as windows messages ...
0
 

Author Comment

by:tomeknik
ID: 1360983
Adjusted points to 100
0
 
LVL 1

Accepted Solution

by:
pjdb earned 100 total points
ID: 1360984
try this code

function SendKeys(Keys:string):boolean;
var
      hw:hwnd;
      i:byte;
Begin
      hw:=getfocus;
      If hw<>0 Then
      begin
            for i:=1 to length(keys) do
                  postmessage(hw, wm_char, word(keys[i]), 1);
            result:=true;
      end
      else
            result:=false;
End;      {SendKeys}

JDB
0
 
LVL 2

Expert Comment

by:gysbert1
ID: 1360985
As I said, yes ...
0
 
LVL 1

Expert Comment

by:pjdb
ID: 1360986
Sorry gysbert1, i've take your answer. In fact i've read the question and see no answer so i've made a cut and paste from a library of mine.
Sorry agian

JDB
0
 
LVL 2

Expert Comment

by:gysbert1
ID: 1360987
No apology needed ! I did not have the time to post the code. You deserve the points ...
0
 
LVL 1

Expert Comment

by:pjdb
ID: 1360988
Tomeknik, Is it working fine?

JDB
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

860 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