Source language: Translate to:

Rectangle Name & NeoBook handle

Questions or information that don't quite fit anywhere else

Moderator: Neosoft Support

Rectangle Name & NeoBook handle

Postby David de Argentina » Fri Apr 17, 2009 1:57 pm

Hi programmer Gurus,

I'm trying to get the Rectangle handle knowing the Rectangle Name.

I use GetClassName API Function.

I discovered I get one or more Rectangle handle, all named "TNeoBookRect" with the real handle. But I can't determine what "TNeoBookRect" is each Rectangle...

Are there any way to determine this ?

Thanks in advance,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby bunker » Fri Apr 17, 2009 2:38 pm

Hi David
This is what you want?:
Code: Select all
GetObjectHandle "Rectangle1" "[rec1_handle]"


Greetings
User avatar
bunker
 
Posts: 141
Joined: Sat Sep 29, 2007 4:00 pm

Postby David de Argentina » Fri Apr 17, 2009 5:11 pm

Hi Bunker,

I need the same result using API Functions.

Thanks in advance,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby Neosoft Support » Mon Apr 20, 2009 11:43 am

I don't know if that's possible or not. Each NeoBook object is a window, so you could try examining the window text of each TNeoBookRect and see if that works. Windows objects don't usually have names, they just have handles.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby dec » Tue Apr 21, 2009 11:17 am

Hi,

I dont know if I wrong, by, is possible to use something like this to retrieve the handle of a Neobook object, based on the Neobook SDK:

Code: Select all
function GetNeobookObjectHandle(identifier: string): HWnd;
var
  s: PChar;
begin
  s := nil;
  result := 0;
  if Assigned(nbInterface) then
  begin
    try
      SetStr(s, identifier);
      nbInterface(7, s);
      result := HWND(s);
    finally
      FreeStr(s);
    end;
  end;
end;


A dont now if some like this is that you need. :wink:
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby David de Argentina » Tue Apr 21, 2009 2:05 pm

Thanks Dec,

I'll try to adapt your code to Powerbasic syntax

Greetings from Buenos Aires,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby David de Argentina » Tue Apr 21, 2009 3:41 pm

Hi Dec,

Using your function I can get some rare value....

you wrote:

result := HWND(s);

HWND() is a Delphi function ?

I don't find any info about this function...

Could you tell me where is defined ?

Thanks in advance,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby dec » Tue Apr 21, 2009 4:40 pm

Hi,

In fact is not a function, but a "type cast": just promote the PChar in order to be returned as HWND value. I dont know if in your language is possible something like this. If not... maybe you can try to convert the PChar into a LongInteger, that maybe work well in this case.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain


Return to Misc. Questions and Information

Who is online

Users browsing this forum: No registered users and 0 guests