Specify monitor when opening file. (.bat)

Unless the application you’re launching has a command-line switch for it, there’s no easy way to specify on which monitor to display a window. As far as I’m aware, neither start nor notepad supports such a switch. The closest solution I’ve found is to move a window after it’s already open. Edit: user32.dll SetWindowPos() invoked … Read more

Launching an Mac App with Objective-C/Cocoa

if(![[NSWorkspace sharedWorkspace] launchApplication:@”Path Finder”]) NSLog(@”Path Finder failed to launch”); With Parameters: NSWorkspace *workspace = [NSWorkspace sharedWorkspace]; NSURL *url = [NSURL fileURLWithPath:[workspace fullPathForApplication:@”Path Finder”]]; //Handle url==nil NSError *error = nil; NSArray *arguments = [NSArray arrayWithObjects:@”Argument1″, @”Argument2″, nil]; [workspace launchApplicationAtURL:url options:0 configuration:[NSDictionary dictionaryWithObject:arguments forKey:NSWorkspaceLaunchConfigurationArguments] error:&error]; //Handle error You could also use NSTask to pass arguments: NSTask *task … Read more

catch another process unhandled exception

You can try something like that to avoid the debugger question to appear, you won’t get the exception but only the exit code: class Program { static void Main(string[] args) { try { ProcessStartInfo info = new ProcessStartInfo(“ErroneusApp.exe”); info.ErrorDialog = false; info.RedirectStandardError = true; info.RedirectStandardOutput = true; info.CreateNoWindow = true; info.UseShellExecute = false; System.Diagnostics.Process p … Read more

Launch an external application from node.js

you can do this var cp = require(“child_process”); cp.exec(“document.docx”); // notice this without a callback.. process.exit(0); // exit this nodejs process it not safe thought, to ensure that the command show no errors or any undesired output you should add the callback parameter child_process.exec(cmd,function(error,stdout,stderr){}) and next you can work with events so you won’t block … Read more

How to start/ launch application at boot time Android

These lines of code may be helpful for you… Step 1: Set the permission in AndroidManifest.xml <uses-permission android:name=”android.permission.RECEIVE_BOOT_COMPLETED” /> Step 2: Add this intent filter in receiver <receiver android:name=”.BootReceiver”> <intent-filter > <action android:name=”android.intent.action.BOOT_COMPLETED”/> </intent-filter> </receiver> Step 3: Now you can start your application’s first activity from onReceive method of Receiver class public class BootReceiver extends … Read more

Detect when an iOS app is launched for the first time? [closed]

Pretty much what Marc and Chris said, though I prefer to change the value when the app quits in case there’re multiple areas of the application that need to know about it. In code: Objective-C // -applicationDidFinishLaunching: [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES],@”firstLaunch”,nil]]; // to check it: [[NSUserDefaults standardUserDefaults] boolForKey:@”firstLaunch”]; // -applicationWillTerminate: [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@”firstLaunch”]; … Read more