使用Java打开文件的属性窗口

这只是关于Windows中的Java的一个问题。

我需要一个方法来调用这个窗口:

在这里输入图像说明

所以基本上这个方法应该是这样的:

public void openProperties(File file){ // or String fileName } 

所以声明: opernProperties(new File(test.txt)); 应该打开上面的窗口。

所以只是为了澄清,我不想阅读和pipe理的属性。 我只想打开属性窗口。

我能够使用以下显示文件属性窗口:

这应该显示属性窗口延迟3秒。 请注意,如果你不希望它在3秒后自动关闭,你可以通过hwnd成员谈论通过窗口

 public static void main(String[] args) throws InterruptedException { ShellAPI.SHELLEXECUTEINFO shellExecuteInfo = new ShellAPI.SHELLEXECUTEINFO(); shellExecuteInfo.lpFile = "C:\\setup.log"; shellExecuteInfo.nShow = User32.SW_SHOW; shellExecuteInfo.fMask = 0x0000000C; shellExecuteInfo.lpVerb = "properties"; if (Shell32.INSTANCE.ShellExecuteEx(shellExecuteInfo)){ Thread.sleep(3000); } }