matthiasblaesing commented on code in PR #6585:
URL: https://github.com/apache/netbeans/pull/6585#discussion_r1365693319
##########
ide/extbrowser/src/org/netbeans/modules/extbrowser/NbDdeBrowserImpl.java:
##########
@@ -127,6 +132,169 @@ public NbDdeBrowserImpl (ExtWebBrowser extBrowserFactory)
{
*/
public static native String getDefaultOpenCommand() throws
NbBrowserException;
+ /**
+ * Get the default browser name using java
+ * part of the solution source
https://stackoverflow.com/questions/62289/read-write-to-windows-registry-using-java
+ * @return
+ */
+ private static String getDefaultWindowsBrowser()
+ {
+ try
+ {
+ Process process = Runtime.getRuntime().exec("reg query
HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\Shell\\Associations\\URLAssociations\\https\\UserChoice
/f ProgId /v");
Review Comment:
JNA stands for ["Java Native
Access"](https://github.com/java-native-access/jna). It allows a Java programm
to call functions provided by native libraries. JNA consists of two main parts:
JNA itself provides the glue layer from Java to native and JNA platform
contains bindings for several libraries.
For the registry access the library in question is `Advapi32.dll`, this
library provides `RegQueryValueEx` to access the registry values. JNA platform
adds some memory handling and error detection and exposes that as
`registryGetStringValue`.
Here is a unittest excercising the registry APIs:
https://github.com/java-native-access/jna/blob/master/contrib/platform/test/com/sun/jna/platform/win32/Advapi32UtilTest.java#L420-L427
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists