Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Send keys to modal Dialog after Print command

edited November 2005 in General
I sending a print job to a LAN-Fax on the network and a modal window opens
to ask for the fax number.
Does anyone know of a way to send keys to a modal window within the
application, so I can complete the fax transmission without user input ?

I tried SendKeys (sndkey32.pas on the Delphi install CD) but it does not
work on a modal dialog box within the app that issues the SendKeys command.
It does work from out side the application.

I tried sending the keys on a timer triggered after the print command and
also in the AfterPrint events for Report Builder, with no success.


ENHANCED BUSINESS SYSTEMS INC
Ron Simonsmeier
ron.s@enhanced-business.com

Comments

  • edited November 2005
    Ron Simonsmeier wrote:


    What kind of fax app is this? Some apps are able to get the faxno and
    process silently.. just interested.




    did you find and set the focus to the fax window?

    quick sample:

    const
    faxno: string = '1234567890';
    var
    wh: HWND;
    i: Integer;
    begin
    wh := FindWindow(nil, 'MyFaxProg...');
    Windows.SetFocus(wh);
    if wh <> 0 then
    begin
    for i := 1 to length(faxno) do
    begin
    SendMessage(wh, WM_CHAR, Word(faxno[i]), 0);
    end;
    end
    else
    ShowMessage('Fax Window not found...');
    end;

    HIH
    ralf
This discussion has been closed.