GetWindowRect(hnd, r);
Instead of being declared as a pointer the second parameter is
implicitly passed by reference by marking it 'var'. This makes you have
to wory less about pointers and makes the code more readable.
Unfortunately this is not done constently (because in some cases you
have to be able to pass nil) so you will have to check it for evey
parameter of every API function you call.
Vlastik
"jef" <jf.j...@opales.fr> píse v diskusním príspevku
news:411DDF79...@opales.fr...
This means that you have redeclared the TRect type somewhere. It is already
declared for you in the Windows unit, if you have an alternate declaration
somewhere else (even if it is totally identically to the one in Windows.pas)
you have two different type that cannot be interchanged in situations
requiring type identity (like passing to a Var parameter that expects to get
a Windows.TRect).
To find the offending declaration, hover the mouse over the "TRect" in your
variable declaration. The IDE should show a hint with the location of the
declaration. To resolve the conflict (if you cannot remove the duplicate
type) you can declare your parameter as
r: Windows.TRect;
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
I just want to know if an other application is runing and if so where is it on
the desk.
Is there other way to do that?
By the way, in windows.pas source file, just after HiByte function, there are
many blank lines in Type declaration; I reload my source cd distribution, but it
is the same (delphi 7 pro); perhaps some declaration are missing ?
In any case Thanks for your help
You are calling the function the wrong way. Try
GetWindowRect( hnd, Rect );
When it doubt check the translation of the API function in the Windows unit. In
may cases Borland decided to convert pointer-to-things parameters to Delphi Var
parameters, which allow you to skip all the pointer stuff. More natural to a
Pascal programmer but a potential trap if you work with the API help and ignore
the code completion parameter hints <g>.