Article View: borland.public.cppbuilder.nativeapi
Article #12307Re: Simulate mouse click to another window
From: Jan
Date: Tue, 16 Dec 2003 13:14
Date: Tue, 16 Dec 2003 13:14
29 lines
1445 bytes
1445 bytes
Hi Ed, I have try this code, but don't work. What is wrong with this code ? HDC hdc; RECT rc; HWND hTarget; hTarget = (HWND)lPreviewHandle; GetClientRect(hTarget, &rc); hdc = GetDC(hTarget); ClipCursor(&rc2); MoveToEx(hdc, rc2.right / 2, rc2.bottom / 2, NULL); PostMessage(hTarget, WM_LBUTTONDOWN,0,0); ::Sleep(200); PostMessage(hTarget, WM_LBUTTONUP, 0,0); ClipCursor(NULL); ReleaseDC(hTarget, hdc); Thanks, Jan Ed Mulroy [TeamB] wrote: > Given that you know the HWND of the window then you could select a > location within the window's client area, send it a WM_LBUTTONDOWN > message, delay a touch and then send a WM_LBUTTONUP message.
Technical Details
Message-ID:
<3fdf1356$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-mailReferences:
<3fddd8ec@newsgroups.borland.com> <3fddec56$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,aaf30719407ea571 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-12-16 06:39:38 PST From: "Jan" <jan@jlcsoft.com> Subject: Re: Simulate mouse click to another window Newsgroups: borland.public.cppbuilder.nativeapi References: <3fddd8ec@newsgroups.borland.com> <3fddec56$1@newsgroups.borland.com> User-Agent: XanaNews/1.15.7.2 NNTP-Posting-Host: 81.82.220.99 Message-ID: <3fdf1356$1@newsgroups.borland.com> Date: 16 Dec 2003 06:14:46 -0700 X-Trace: newsgroups.borland.com 1071584086 81.82.220.99 (16 Dec 2003 06:14:46 -0700) Lines: 30 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