Article View: borland.public.cppbuilder.nativeapi
Article #10452Re: How to catch mouseclicks from another application?
From: Henk
Date: Thu, 08 Apr 2004 19:15
Date: Thu, 08 Apr 2004 19:15
39 lines
2114 bytes
2114 bytes
===========================================================
> You need to cast thefunction pointer:
>
> HHOOK MyHook = SetWindowsHookEx(WH_MOUSE, (HOOKPROC)MouseProc, MyInstance,
> MyThreadId);
>
>
> Gambit
Well, thanks, I tried every possible casting, this one must have slipped
under the carpet.
============================================================
I still have some questions to go, if you would be so kind.
Why doesn't the function 'BringWindowToFront(HWND)' (and others from same
group) don't do anything when called inside a dll-function but DO work when
called in an application?
//My DLL
static HWND GhWnd;
//called first
void __export MySetHandle(HWND hWnd)
{
GhWnd=hWnd;
}
//on mouse button down
LRESULT CALLBACK __export GetMsgProc(int code,WPARAM,wParam,LPARAM lParam)
{
if(wParam==WM_LBUTTONDOWN)
{
Beep(); //it really beeps
BringWindowToTop(GhWnd); //does not do anything
}
}
greetings,
Henk
Technical Details
Message-ID:
<4075a4df$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<407421ef@newsgroups.borland.com> <40743aad$1@newsgroups.borland.com> <40754399$1@newsgroups.borland.com> <40758801$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,e0858ea1c0821ca X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-04-08 12:40:25 PST From: "Henk" <h.van.winkoop@wxs.nl> Newsgroups: borland.public.cppbuilder.nativeapi References: <407421ef@newsgroups.borland.com> <40743aad$1@newsgroups.borland.com> <40754399$1@newsgroups.borland.com> <40758801$1@newsgroups.borland.com> Subject: Re: How to catch mouseclicks from another application? Date: Thu, 8 Apr 2004 21:15:42 +0200 Lines: 42 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2720.3000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2727.1300 NNTP-Posting-Host: 62.131.145.60 Message-ID: <4075a4df$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1081451743 62.131.145.60 (8 Apr 2004 12:15:43 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail