[futurebasic] Re: [FB] AppearEyes Plug-In now handles Edit Fields

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2003 : Group Archive : Group : All Groups

From: Robert Purves <robert.purves@...>
Date: Thu, 4 Sep 2003 00:13:25 +1200
>> My app first tries to get the current process name, which should be 
>> "FutureBASIC" but with a Carbon compile, it can't find it. There's an 
>> example on the CD, 'GETPROCESSINFO' which lists all currently running 
>> processes. Compiling and running this in Carbon also doesn't show 
>> FutureBASIC, or any other currently running Classic apps.
>
> The FB GetProcessInfo statement does not work properly in OS X when 
> the Classic environment is running:  GetProcessInfo stops scanning 
> before the full list of processes has been obtained.


It turns out that the GetProcessInfo statement is not at fault.  What 
doesn't work properly is is the example program GETPROCESSINFO, which 
can be found in
:Examples:--Ref Manual Examples--:G:GETPROCESSINFO

To make the GETPROCESSINFO example perform better in  OS X, I rewrote 
as follows:


'~'A
'                       Runtime : RNTM Lite.INCL
'~'B
dim as long                 indx
dim as Str255               processName
dim as ProcessSerialNumber  psn

GetProcessInfo -1, processName
print "My name is: """ processName """
print
indx = 1
do
psn.highLongOfPSN = 0
psn.lowLongOfPSN  = 0
GetProcessInfo indx, processName, psn
long if ( psn.highLongOfPSN or psn.lowLongOfPSN )
print indx, "0x";¬
       hex$( psn.highLongOfPSN );¬
       hex$( psn.lowLongOfPSN ),¬
       processName
end If
indx++
until ( psn.highLongOfPSN == 0 ) and ( psn.lowLongOfPSN == 0 )



Now when I compile as Carbon and run it in OS X 10.2.6, one of the 
processes shows up in the list with no name.  The lack of name 
(strictly, a name of zero length) is what causes the original 
GETPROCESSINFO example to stop prematurely.

A small challenge is to discover the name of this mystery process 
(which does indeed have a name, if you ask for it in the right way).

Robert P.