Article View: borland.public.cppbuilder.nativeapi
Article #9915Fill notepad's keyboard buffer with some stuff
From: Gintaras Kekys
Date: Mon, 07 Jun 2004 05:33
Date: Mon, 07 Jun 2004 05:33
29 lines
1537 bytes
1537 bytes
Hi.
I have enummed windowses with EnumWindows, got notepad.exe window handle and
tried to fill it's keyboard buffer with some stuff:
static bool __stdcall EnumWindowCallBack(HWND hwnd, LPARAM lParam)
{
bool bRet;
char caption[32];
char SomeStuff[32];
bRet=true;
StrCopy(SomeStuff,"Filled notepad with some stuff");
SendMessage( hwnd, WM_GETTEXT, 32, (LPARAM)caption);
if (StrLIComp(caption, "untitled - notepad", 18) == 0 ) {
for(int i=0;i<strlen(SomeStuff);i++)
SendMessage(hwnd,WM_CHAR,SomeStuff[i],0);
bRet=false;
}
return bRet;
}
Well, that didn't work. What have I missed?
Best wishes,
Gintaras
Technical Details
Message-ID:
<40c3fde9@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,925db27f4edb396d,start X-Google-Attributes: gid10cc67,public Reply-To: "Gintaras Kekys" <gintaras-erasethis@sb.lt> From: "Gintaras Kekys" <gintaras-erasethis@sb.lt> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Fill notepad's keyboard buffer with some stuff Date: Mon, 7 Jun 2004 08:33:22 +0300 Lines: 31 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2739.300 NNTP-Posting-Host: 213.190.40.141 Message-ID: <40c3fde9@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1086586345 213.190.40.141 (6 Jun 2004 22:32:25 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail