🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Several ways to define 2 system-wide hotkeys, without to install keyboard-hook..

#8102
From: Oren Halvani
Date: Mon, 22 Nov 2004 22:15
55 lines
3380 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> schrieb im
 Newsbeitrag news:41a23648$1@newsgroups.borland.com...

>     BOOL CALLBACK EnumWindowsProc(HWND Wnd, LPARAM lParam)
>     {
>         if( (IsWindowVisible(Wnd) || IsIconic(Wnd)) &&
>             ((GetWindowLong(Wnd, GWL_HWNDPARENT) == 0) ||
>             (GetWindowLong(Wnd, GWL_HWNDPARENT) == GetDesktopWindow())) &&
>             ((GetWindowLong(Wnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) == 0) )
>             Form1->ListBox1->Items->Add("Handle: " + IntToStr(Wnd) + ",Text:
> " + GetText(Wnd));
>         return TRUE;
>     }

here is a comparsion problem:

((GetWindowLong(Wnd, GWL_HWNDPARENT) == 0) ||
(GetWindowLong(Wnd, GWL_HWNDPARENT) == GetDesktopWindow()))


LONG GetWindowLong(HWND hWnd,  int nIndex) ==
HWND GetDesktopWindow(VOID);

give's me a: " Cannot convert long to *void " error...

and here is also a problem:

frmMainUnit->ListBox1->Items->Add("Handle: " + IntToStr(Wnd) + ", Text: " +
GetText(Wnd));

this is causing: " Cannot convert void* to int " error...
can i use here also a reinterpret_cast for them both or
is it dangerous..?


> You cannot call FreeMem() after a 'return' statement.  As soon as the
> 'return' statement executes, the function exists immediately and is no
> longer running.  You have to call FreeMem() before you call 'return', or
> else the memory is leaked.
>
>
> Gambit

so this is delphi specific, that a return is called BEFORE the
FreeMem() ??? wired !

    Result := Text;
    FreeMem(Text);

i'm happy that i've NEVER learned this complicated language..
C++ seems to me muuuch easier to understand as delphi :-)



Oren
Technical Details
Message-ID: <41a2651e@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <419ceea1@newsgroups.borland.com> <419cf173$1@newsgroups.borland.com> <419d2c69$1@newsgroups.borland.com> <419d3e01$1@newsgroups.borland.com> <419d8ce4@newsgroups.borland.com> <419dc340@newsgroups.borland.com> <419e5561$1@newsgroups.borland.com> <419e5ecc$1@newsgroups.borland.com> <419e6631@newsgroups.borland.com> <419e7adc$1@newsgroups.borland.com> <419e831e$1@newsgroups.borland.com> <419f0334$1@newsgroups.borland.com> <419f08b1@newsgroups.borland.com> <419fb061$1@newsgroups.borland.com> <419fc5aa@newsgroups.borland.com> <41a03fb6@newsgroups.borland.com> <41a066cc@newsgroups.borland.com> <41a23648$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,9a94ec9a8ef193c6
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Oren Halvani" <Spam@Me-Please.com>
From: "Oren Halvani" <Spam@Me-Please.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <419ceea1@newsgroups.borland.com> <419cf173$1@newsgroups.borland.com> <419d2c69$1@newsgroups.borland.com> <419d3e01$1@newsgroups.borland.com> <419d8ce4@newsgroups.borland.com> <419dc340@newsgroups.borland.com> <419e5561$1@newsgroups.borland.com> <419e5ecc$1@newsgroups.borland.com> <419e6631@newsgroups.borland.com> <419e7adc$1@newsgroups.borland.com> <419e831e$1@newsgroups.borland.com> <419f0334$1@newsgroups.borland.com> <419f08b1@newsgroups.borland.com> <419fb061$1@newsgroups.borland.com> <419fc5aa@newsgroups.borland.com> <41a03fb6@newsgroups.borland.com> <41a066cc@newsgroups.borland.com> <41a23648$1@newsgroups.borland.com>
Subject: Re: Several ways to define 2 system-wide hotkeys, without to install keyboard-hook..
Date: Mon, 22 Nov 2004 23:15:09 +0100
Lines: 57
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 217.234.110.210
Message-ID: <41a2651e@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1101161758 217.234.110.210 (22 Nov 2004 14:15:58 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail