handle

Creating a keyboard hook for a Java program that sits in the System Tray

旧街凉风 提交于 2019-12-10 15:38:00
问题 Basically I have a java program that runs in the system tray and would like to add make it so if the user pressed say CTRL+SHIFT+1 it selects one of the right click options of the java program that sits in the tray. I guess what I'm looking for is a tutorial on doing this, or what the simplest approach would be. I have never done something like this before, so possibly some sort of noobie tutorial? Thanks 回答1: so , creating a keyboard hook isn't as easy as it looks , java doesn't provide a

lseek/write suddenly returns -1 with errno = 9 (Bad file descriptor)

那年仲夏 提交于 2019-12-10 13:54:54
问题 My application uses lseek() to seek the desired position to write data. The file is successfully opened using open() and my application was able to use lseek() and write() lots of times. At a given time, for some users and not easily reproducable, lseek() returns -1 with an errno of 9. File is not closed before this and the filehandle (int) isn't reset. After this, another file is created; open() is okay again and lseek() and write() works again. To make it even worse, this user tried the

How to make a program not show up in Alt-Tab or on the taskbar

吃可爱长大的小学妹 提交于 2019-12-10 01:47:52
问题 I have a program that needs to sit in the background and when a user connects to a RDP session it will do some environment setup then launch a program. When the program is closed it will do some housekeeping and logoff the session. The current way I am doing it is I have the terminal server launch this application. This is built as a windows forms application to keep the console window from showing up: public static void Main() { //(Snip...) Do some setup work Process proc = new Process(); //

GDI handles in a DotNET application

时光毁灭记忆、已成空白 提交于 2019-12-09 18:15:09
问题 My pure DotNET library runs as a plugin inside an unmanaged desktop application. I've been getting a steady (though low) stream of crash reports that seem to indicate a problem with GDI handles (fonts in error messages etc. revert to the system font, display of all sorts of controls break down, massive crash shortly after). My Forms have few controls, but I do a lot of GDI+ drawing in User controls. What's a good way to tell how many handles I'm using, or even leaking? Thanks, David 回答1: I've

Use the value of continuous slider in MATLAB

别来无恙 提交于 2019-12-09 12:36:41
问题 I am kinda stuck here. I have tried to read and implement some simple continuous slider scripts, (like this one), but I am not getting anywhere. What I simply want to go, is use the continuous slider value in my plot, as I slide the slider. However, I cannot figure out how to extract the value of the slider to do so. So for example, make a continuous slider, and then use it to change the amplitude of a vector lets say, as you continuously slide it. How can that be done? Thanks. 回答1: Something

How do you obtain Current Window Handle Count and Window Handle Limit in .NET?

一笑奈何 提交于 2019-12-09 09:25:44
问题 I want to obtain the current number of window handles and the system-wide window handle limit in C#. How do I go about this? 回答1: If you read Raymond Chen's post, you'll probably find it as annoying as I did. You're only "probably doing something wrong" because you're doing something Windows isn't capable of. In my application, the first time a user visits a tab page, I create and lay out all the controls on that page. This takes a noticeable amount of time - there can easily be 50 controls

Jquery UI sortable, button is not working as handle

不想你离开。 提交于 2019-12-09 07:35:23
问题 I am trying to sort tr's in a table. code $("table tbody").sortable({ handle: 'button' //handle: 'img' }).disableSelection(); live fiddle now the problem is when using img as handle its working fine but when using button as handle its not working I checked for many jquery ui sortable ques for my ans but of no help can anyone plz explain why is this happening Thanx in advance 回答1: The cancel option defaults to :input,button which conflicts with your handle setting. Just setting it to an empty

How to release a handle through C#?

我是研究僧i 提交于 2019-12-09 07:34:27
I have an application that IMPLICITLY opens a handle on a dll/file. At some point in the application, I want to release this handle. How can I do it? My application is in C#. use PInvoke if you have an handler that you want to close [System.Runtime.InteropServices.DllImport("Kernel32")] private extern static Boolean CloseHandle(IntPtr handle); What exactly you are trying to do? If you want to load an assembly to do some stuff with that, and then unload it completely, you need to rely on creating a new app domain. public static void Main(string[] args) { AppDomain appDomain = AppDomain

How to get count of opened handles that belongs to a certain process?

╄→гoц情女王★ 提交于 2019-12-08 21:08:43
问题 You can use the program Process Explorer to see how many handles running applications have. Is there a way with Delphi code to get this number? I am interested in tracking the number for the application itself; not to find the number of handles used by other applications as Process Explorer is doing. My intention is for the application to track/detect possible resource leaks. 回答1: Use the GetProcessHandleCount function. This API function is in recent versions of Delphi imported by the Winapi

What is the magic behind perl read() function and buffer which is not a ref?

£可爱£侵袭症+ 提交于 2019-12-08 19:34:26
问题 I do not get to understand how the Perl read($buf) function is able to modify the content of the $buf variable. $buf is not a reference, so the parameter is given by copy (from my c/c++ knowledge). So how come the $buf variable is modified in the caller ? Is it a tie variable or something ? The C documentation about setbuf is also quite elusive and unclear to me # Example 1 $buf=''; # It is a scalar, not a ref $bytes = $fh->read($buf); print $buf; # $buf was modified, what is the magic ? #