Article View: borland.public.cppbuilder.nativeapi
Article #8103Re: Several ways to define 2 system-wide hotkeys, without to install keyboard-hook..
From: Remy Lebeau (TeamB)
Date: Mon, 22 Nov 2004 22:35
Date: Mon, 22 Nov 2004 22:35
41 lines
3000 bytes
3000 bytes
"Oren Halvani" <Spam@Me-Please.com> wrote in message
news:41a2651e@newsgroups.borland.com...
> LONG GetWindowLong(HWND hWnd, int nIndex) ==
> HWND GetDesktopWindow(VOID);
>
> give's me a: " Cannot convert long to *void " error...
Simply cast the HWND from GetDesktopWindow() to a LONG, or cast the LONG
from GetWindowLong() to an HWND.
> frmMainUnit->ListBox1->Items->Add("Handle: " + IntToStr(Wnd) + ", Text: "
+
> GetText(Wnd));
>
> this is causing: " Cannot convert void* to int " error...
Simply cast the HWND to an int.
Everything works in Delphi because handles are integers to begin with,
whereas in C++ they are pointers instead.
> so this is delphi specific, that a return is called BEFORE the FreeMem()
???
There is no return called in the Delphi code you showed. "Result" is just a
variable (albeit a special variable). The code is just assigning a variable
value like any other. That is why FreeMem() can be called after assigning
the Result, because the function has not exited yet. When the function
finally reaches the last "end" statement (or there is an explitic call to
"Exit", which is not the case in this situation), then whatever value is
currently stored in the Result variable gets returned to the caller as the
function's return value.
> i'm happy that i've NEVER learned this complicated language..
Delphi is not a complicated language.
Gambit
Technical Details
Message-ID:
<41a26953$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<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> <41a2651e@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 From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.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> <41a2651e@newsgroups.borland.com> Subject: Re: Several ways to define 2 system-wide hotkeys, without to install keyboard-hook.. Date: Mon, 22 Nov 2004 14:35:57 -0800 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <41a26953$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1101162835 68.69.17.41 (22 Nov 2004 14:33:55 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail