Hi Carlos,
We used to use Mutex, but I think we changed as it did not detect when the application was running under another user on a Terminal Server. We switched to use the WbemScripting Windows object and it is a very small amount of code. It will only work for runtime app, you can still run another copy of the app in PB on the same PC, which is handy for testing.
Try the following:
//Code to check whether Application is already running
OleObject locator, service, app
String ls_query = 'select name , description from Win32_Process where name = "APPNAME.exe" '
int num, ret
locator = CREATE OleObject
ret = locator.ConnectToNewObject("WbemScripting.SWbemLocator");
service = locator.ConnectServer();
app= service.ExecQuery(ls_query);
num = app.count()
IF num > 1 THEN
MessageBox ("Process","Application is already running on this computer!")
halt
ELSE
//Code to execute if app not already running!
END IF
//End of Code
Hope That Helps
Michael