🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Get global Windows messages

#13898
From: ferrizzi
Date: Mon, 15 Sep 2003 19:50
43 lines
1987 bytes
Hi, I'm working on an application where the form is ever hidden, the form
must appear only after the left mouse button is down for more than one or
two seconds with the cursor still. I this way the cursor is not on my active
form and the APIs don't work (GetMessage etc). Is there a function to that
allows  my application to listen the WM_LBUTTONDOWN message everywhere in
the system?
Code examples tested:

void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
MSG msg;
GetMessage(&msg,NULL,0,0);
if(msg.message == WM_LBUTTONDOWN)

{
// It works only on the form (if  I don't hide it)
   Form1->Show();
   something to do;
  }
....
.....
.....
}

I tryed to add GetActiveWindow() but the application became very slow;

void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
MSG msg;
HWND active_wnd = GetActiveWindow();
GetMessage(&msg,active_wnd,0,0);                                         //
This is very slow almost still
if(msg.message == WM_LBUTTONDOWN)
  {
   Form1->Show();
   something to do;
  }
....
.....
.....
}

 Many thanks in advance, Ferdinando Rizzi ferrizzi@libero.it
Technical Details
Message-ID: <3f6617e7@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,63745d05484b53f,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-09-15 12:51:36 PST
From: "ferrizzi" <ferrizzi@libero.it>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Get global Windows messages
Date: Mon, 15 Sep 2003 21:50:01 +0200
Lines: 45
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: 80.117.109.203
Message-ID: <3f6617e7@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1063655399 80.117.109.203 (15 Sep 2003 12:49:59 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail