shell32

Docking a java application jna on windows

 ̄綄美尐妖づ 提交于 2020-01-23 12:06:50
问题 I'm trying to build a Windows dockable application that reserves a section of the screen to prevent other applications from show in that space. I have try using JNI and JNA. The code above shows how far I have got. package jnadock; import com.sun.jna.Library; import com.sun.jna.Native; import com.sun.jna.Pointer; import com.sun.jna.platform.win32.ShellAPI; import com.sun.jna.platform.win32.ShellAPI.APPBARDATA; import com.sun.jna.platform.win32.WinDef.DWORD; import com.sun.jna.platform.win32

Loading icons from Shell32.dll: Win32 handle is not valid or is the wrong type

巧了我就是萌 提交于 2020-01-05 08:32:56
问题 I am getting some Icons from the Shell32.dll. Althought some of the icons don't appear to be available, and I can't understand why. I am getting the icon by loading the library by calling: [DllImport("kernel32.dll")] static extern IntPtr LoadLibrary(string Library); and then getting the icon by calling: [DllImport("User32.dll")] public static extern IntPtr LoadImage(IntPtr ptr, int intId, uint intType, int iconWidth, int iconHeight, int loadIcon); I send in the icon index of the icon that I

How to check when Shell32.Folder.CopyHere() is finished

僤鯓⒐⒋嵵緔 提交于 2019-12-30 04:47:31
问题 I need to unzip en zip some files in my application using Shell32. Right now, I use srcFolder.CopyHere(destFolder.Items()) to achieve this. However, my next line of code requires the newly made ZIP-file. But since the CopyHere method is Async, how can I check when it in finished? Right now I use a Thread.Sleep for around 500 ms which is enough for my computer to finish creating the ZIP file, but it's not good code imo. Any ideas? More info/code can be provided if necessary. 回答1: Here is

'Safe' DLL Injection

别等时光非礼了梦想. 提交于 2019-12-21 05:48:33
问题 Not a terribly good question, sorry. I have a program that needs to be alerted when a file is opened from explorer (i.e. ShellExecute(A/W) is called). Unfortunately, Microsoft removed the COM interface (IShellExecuteHook) that allows you to hook these events in Vista and up, supposedly because older code could cause a crash due to changes. There was a work-around to re-enable this feature, but it no longer works. I've done some research and it looks like the only way to catch calls to

Calling SHGetFileInfo in thread to avoid UI freeze

岁酱吖の 提交于 2019-12-19 06:45:15
问题 In a .NET 4.0 application (WPF) we're using SHGetFileInfo to obtain shell icons for a directory tree. Since this takes quite some time in some cases (i.e. for a network drive that is unreachable or for a floppy drive), we wanted to do this in a thread and then update the icon when it has been read in. The call is basically the same, it is now just executed within a thread. Because someone said that the thread must be STA for this to work, we used Thread rather than ThreadPool for testing,

Calling Shell32.dll from .NET Windows Service

≯℡__Kan透↙ 提交于 2019-12-19 05:35:12
问题 I have a .NET 4.0 library that uses Shell32 and Folder.GetDetailsOf() to get metadata from WTV files. I have used it successfully with Console and Windows Forms apps without issue. But for some reason, when calling the component from a .NET 4.0 Windows Service, the call to initiate the Shell class causes a COM error. The code that fails inside the library: Shell32.Shell shell = new Shell(); The error: Unable to cast COM object of type 'System.__ComObject' to interface type 'Shell32.Shell'.

Calling Shell32.dll from .NET Windows Service

☆樱花仙子☆ 提交于 2019-12-19 05:35:07
问题 I have a .NET 4.0 library that uses Shell32 and Folder.GetDetailsOf() to get metadata from WTV files. I have used it successfully with Console and Windows Forms apps without issue. But for some reason, when calling the component from a .NET 4.0 Windows Service, the call to initiate the Shell class causes a COM error. The code that fails inside the library: Shell32.Shell shell = new Shell(); The error: Unable to cast COM object of type 'System.__ComObject' to interface type 'Shell32.Shell'.

Why do i get E_ACCESSDENIED when reading public shortcuts through Shell32?

我与影子孤独终老i 提交于 2019-12-18 08:47:13
问题 I'm trying to read the targets of all desktop shortcuts in a C# 4 application. The shortcuts on a windows desktop can come from more that one location, depending on whether the shortcut is created for all users or just the current user. In this specific case I'm trying to read a shortcut from the public desktop, e.g. from C:\Users\Public\Desktop\shortcut.lnk. The code is like this (path is a string contaning the path to the lnk file): var shell = new Shell32.ShellClass(); var folder = shell

LNK 2019 ShellExecuteEx unresolved external symbol Qt Creator

心不动则不痛 提交于 2019-12-13 03:17:00
问题 I work on Windows7 x64 in c++ language. I created a project that open firefox browser when I show a marker to my web cam, using ShellExecuteEx function. My project works well with visual studio 2010. But, when I try to run my project with Qt Creator, I get this error: main_cam.obj:-1: error: LNK2019: riferimento al simbolo esterno __imp__ShellExecuteExW@4 non risolto nella funzione _main debug\cam.exe:-1: error: LNK1120: 1 esterni non risolti The code is: #include <iostream> #include <stdio.h

Error com4j.ComException: 80004005 .\invoke.cpp:51 while getting open windows and selected items

亡梦爱人 提交于 2019-12-13 02:37:40
问题 I need to get all selected files and folders in Windows Explorer. I'm using com4j to access win Shell32 API (thanks to Tom91136, refer this if you need to learn how can you install and initialize com4j) . This code class gets the selected files or folders in Windows Explorer and prints. import java.io.File; import com4j.*; import test.wsh.*; import java.util.*; import java.util.Timer; import javax.swing.*; public class DetectSelection { public static void main(String[] argv) { list(); //there