🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #11990

Re: Paste

#11990
From: Todd Brylski
Date: Sat, 03 Jan 2004 01:22
24 lines
1530 bytes
"Jelsma" <jelsma@wapa.gov> wrote in message news:3ff5f6bc$2@newsgroups.borland.com...
>
> Using BCB5 Pro on Windows 2000, I would like to start
> notepad.exe and paste data from the clipboard into the
> edit control. I can start the application with no problems.
>
> My plan is to enumerate the top level windows and send a
> WM_PASTE message to the edit control. Will this work or am I
> missing something?


void __fastcall TMainForm::Notepad1Click(TObject *Sender)
{
    ::WinExec( "notepad.exe", SW_SHOWNORMAL);

    HWND hWnd = ::FindWindow( 0, "untitled - notepad" );

    if( hWnd )
    {
        ::PostMessage( hWnd, WM_COMMAND, WM_PASTE, 0 );
    }
}

Todd
Technical Details
Message-ID: <3ff61911$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3ff5f6bc$2@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,fdb8783d5e192556
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-01-02 17:39:26 PST
From: "Todd Brylski" <tbrylski@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ff5f6bc$2@newsgroups.borland.com>
Subject: Re: Paste
Date: Fri, 2 Jan 2004 19:22:17 -0600
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 24.166.145.151
Message-ID: <3ff61911$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1073092881 24.166.145.151 (2 Jan 2004 17:21:21 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail