istinnstudio commented on issue #3962:
URL: https://github.com/apache/netbeans/issues/3962#issuecomment-1720262752

   You are right, I got initially values of "0" of OpenClipboard so I thought 
something was wrong. 
   I am not familiar with those concepts, so someone more experienced can 
update it in order to get anything valuable, or maybe there is not much to dig 
here...
   
    the class is then:
   
   ```
   class ClipboardProcessJNA {
   
       public interface User32 extends com.sun.jna.win32.StdCallLibrary {
           User32 INSTANCE = Native.load("user32", User32.class);
   
           WinDef.HWND GetOpenClipboardWindow();
           int GetWindowThreadProcessId(WinDef.HWND hWnd, int[] lpdwProcessId);
       }
   
       public static int getProcessIdUsingClipboard() {
           WinDef.HWND hwnd = User32.INSTANCE.GetOpenClipboardWindow();
           int[] processId = {0};
   
           if (hwnd != null) {
               User32.INSTANCE.GetWindowThreadProcessId(hwnd, processId);
           }
           return processId[0];
       }
   }
   ```
   and the gist has ben updated.


-- 
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

Reply via email to