if (result != 0) return null; return getProgram (lpData.toString (0, lpData.strlen ()));
return program;
public static Program findProgram (String extension) {	if (extension == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);	if (extension.length () == 0) return null;	if (extension.charAt (0) != '.') extension = "." + extension; //$NON-NLS-1$	/* Use the character encoding for the default locale */	TCHAR key = new TCHAR (0, extension, true);	int [] phkResult = new int [1];	if (OS.RegOpenKeyEx (OS.HKEY_CLASSES_ROOT, key, 0, OS.KEY_READ, phkResult) != 0) {		return null;	}		int [] lpcbData = new int [] {256};	TCHAR lpData = new TCHAR (0, lpcbData [0]);	int result = OS.RegQueryValueEx (phkResult [0], null, 0, null, lpData, lpcbData);	OS.RegCloseKey (phkResult [0]);	if (result != 0) return null;	return getProgram (lpData.toString (0, lpData.strlen ()));}