Platforms to show: All Mac Windows Linux Cross-Platform

Back to ProcessMBS class.

ProcessMBS.Bundle as folderitem

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 4.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the bundle path.

Maybe nil if not available.
Returns on Mac OS X the path to the main bundle of the process.

ProcessMBS.BundleID as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 7.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the bundle identifier.

Maybe "" if not available.
Returns on Mac OS X the identifier to the main bundle of the process.

ProcessMBS.GetCurrentProcess

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Load the current Process' information into the class.

This should always be your Xojo application.

Some examples using this method:

ProcessMBS.GetfirstProcess

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Load the first Process into the class.
Example
dim p as ProcessMBS
p=new ProcessMBS
p.GetfirstProcess ' get first
do
msgBox p.name
loop until not p.GetNextProcess ' get next till no more

Some examples using this method:

ProcessMBS.GetFrontProcess

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Load the frontmost Process' information into the class.

Some examples using this method:

ProcessMBS.GetNextProcess as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Load the next Process into the class.
Example
dim p as ProcessMBS
p=new ProcessMBS
p.GetfirstProcess ' get first
do
msgBox p.name
loop until not p.GetNextProcess ' get next till no more

Returns true if successfull.

Some examples using this method:

ProcessMBS.GetProcess(serial as memoryblock)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Load the process information for the process with the given serial.

Some examples using this method:

ProcessMBS.KillProcess as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 2.7 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Kills a Process on Mac OS X or Windows.
Example
dim p as ProcessMBS
p=new ProcessMBS
p.getcurrentprocess
msgbox str(p.killprocess)

Returns -1 if function is not available. Else returns a Mac OS error code where 0 equals "no error".

Sets the lasterror property.

Lasterror codes on Windows:
0 - failed
1 - normal exit
2 - forced exit

If you kill the main process of a task, this can kill the sub processes, too.

See also:

Some examples using this method:

ProcessMBS.KillProcess(timeoutms as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 4.2 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
Kills a Process on Mac OS X or Windows.
Example
dim p as ProcessMBS
p=new ProcessMBS
p.getcurrentprocess
msgbox str(p.killprocess)

Returns -1 if function is not available. Else returns a Mac OS error code where 0 equals "no error".

Sets the lasterror property.

Lasterror codes on Windows:
0 - failed
1 - normal exit
2 - forced exit

The timeout is in milliseconds. If you don't specify a timeout, 1000 ms are used.
If you kill the main process of a task, this can kill the sub processes, too.

See also:

ProcessMBS.MacProcessSerial as memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 2.7 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the serial number for this process as a memoryblock with binary content.

On Mac OS every process as its own unique ID. (If you launch one application two times, they may have everything equal except the process serial.)

The serial itself is a 8byte long memoryblock (two integer).

Returns nil on any error.

Some examples using this method:

ProcessMBS.Priority as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Process MBS Util Plugin 10.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The priority of the process.
Example
dim p as new ProcessMBS

p.GetCurrentProcess

MsgBox str(p.priority) // shows 0

p.priority = 5

MsgBox str(p.priority) // shows 5

20 (least) to -20 (max). Setting the value may be limited due to permissions.
(Read and Write computed property)

See also:

ProcessMBS.ProcessInformationCFDictionary as object

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 3.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns a CFDictionaryMBS object with the properties of the process.
Example
dim p as ProcessMBS
dim d as CFDictionaryMBS

p=new ProcessMBS

p.GetCurrentProcess

d=CFDictionaryMBS(p.ProcessInformationCFDictionary)

if d=nil then
MsgBox "This example works only on Mac OS X 10.2!"
else
// use information in dictionary
end if

Only available on Mac OS X 10.2 or newer.
(And in Mac OS X 10.2 is a bug which may lead into a crash by using this function. Fixed in Mac OS X 10.3)
The function returns a CFDictionaryMBS, but to avoid plugin dependencies, the function is declared as Object, so RB 4.5 don't crash when an application uses the process plugin and dosn't use the CF Plugin.

Result:
An immutable CFDictionary containing these keys and their values. Keys marked with an '*' are optional. Over time more keys may be added.

Key NameType
"PSN"CFNumber, kCFNumberLongLongType
"Flavor"CFNumber, kCFNumberSInt32
"Attributes"CFNumber, kCFNumberSInt32
"ParentPSN"CFNumber, kCFNumberLongLong
"FileType"CFString, file type
"FileCreator"CFString, file creator
"pid"CFNumber, kCFNumberLongType
"LSBackgroundOnly"CFBoolean
"LSUIElement"CFBoolean
"IsHiddenAttr"CFBoolean
"IsCheckedInAttr"CFBoolean
"RequiresClassic"CFBoolean
"RequiresCarbon"CFBoolean
"LSUserQuitOnly"CFBoolean
"LSUIPresentationMode"CFNumber, kCFNumberShortType
"BundlePath"CFString
kIOBundleExecutableKeyCFString
kIOBundleNameKeyCFString
kIOBundleIdentifierKeyCFString

Some examples using this method:

ProcessMBS.QuitProcess as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 3.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Quits a Process on Mac OS.
Example
dim p as ProcessMBS
p=new ProcessMBS
p.getcurrentprocess
msgbox str(p.QuitProcess)

Returns -1 if function is not available. Else returns a Mac OS error code where 0 equals "no error".
Sets the lasterror property.

Some examples using this method:

ProcessMBS.SameAs(other as ProcessMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns true if two ProcessMBS objects have the same Process.

ProcessMBS.SetFrontProcessWithOptions(options as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 4.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Moves the current process to the front.
Example
dim p as ProcessMBS

// move my front window to the front
p=new ProcessMBS
p.GetCurrentProcess
p.SetFrontProcessWithOptions 1

If you pass 0 in the options parameter, the process is activated and all process windows are brought forward.

If you pass kSetFrontProcessFrontWindowOnly (value 1), the process is activated and the frontmost non-floating window is brought forward. (Mac OS X only)

ProcessMBS.SetServiceMode(ismode as boolean) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 2.7 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
If an application is a service, it is not listed inside the Windows force quit window.

Works only on Windows 95, 98 and ME.

Some examples using this method:

ProcessMBS.TransformProcessType(mode as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 15.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Changes the 'type' of the process specified in the psn parameter.

Given a psn for an application, this call transforms that application into the given type. Foreground applications have a menu bar and appear in the Dock. Background applications do not appear in the Dock, do not have a menu bar (and should not have windows or other user interface). UIElement applications do not have a menu bar, do not appear in the dock, but may in limited circumstances present windows and user interface. If a foreground application is frontmost when transformed into a background application, it is first hidden and another application is made frontmost. A UIElement or background-only application which is transformed into a foreground application is not brought to the front (use SetFrontProcess() after the transform if this is required) nor will it be shown if it is hidden (even if hidden automatically by being transformed into a background-only application), so the caller should use ShowHideProcess() to show the application after it is transformed into a foreground application. Applications can only transform themselves; this call cannot change the type of another application.

Returns error code (0 for success).

ProcessMBS.TransformToForegroundApplication as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Transforms a background application to a foreground application.

Returns a Mac OS error code. Returns -1 if the function is not available. You need to select a process first with Get*Process functions.
Requires Mac OS X 10.3.

You can use this call to transform a background-only application into a foreground application. A foreground application appears in the Dock (and in the Force Quit dialog) and contains a menu bar. This function does not cause the application to be brought to the front; you must set FrontProcess=true to do so.

While available starting in 10.3 "Panther," calling TransformProcessType on a UIElement application in 10.3 or 10.4 will return paramErr (-50), rendering it only usable on a full BackgroundOnly? application. Leopard supports foregrounding both UIElement and BackgroundOnly? applications.

Some examples using this method:

ProcessMBS.Update

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Updates the classes information.

Use it if you want the current CPUTime value after some time.

ProcessMBS.WinFullProcessImagePath as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 9.6 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Retrieves the full name of the executable image for the specified process.

Returns empty string on any error like missing permissions.
The path is in the device style "Device\Harddisk0\Partition1\WINNT\System32\test.exe".

Requires Windows Vista or Windows Server 2008 or newer.

Some examples using this method:

ProcessMBS.WinModulePath as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 9.6 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Returns the path the first code file in this process.

Returns empty string on any error like missing permissions.
The path is in the typical style "C:\path\name.exe".

Some examples using this method:

ProcessMBS.WinProcessImagePath as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Process MBS Util Plugin 9.6 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Retrieves the name of the executable file for the specified process.

Returns empty string on any error like missing permissions.
The path is in the device style "Device\Harddisk0\Partition1\WINNT\System32\test.exe".

Requires Windows XP or Windows Server 2003 or newer.

Some examples using this method:

The items on this page are in the following plugins: MBS Util Plugin.


The biggest plugin in space...