Questions tagged [handles]
175 questions
37
votes
11 answers
"Error Creating Window Handle"
We're working on a very large .NET WinForms composite application - not CAB, but a similar home grown framework. We're running in a Citrix and RDP environment running on Windows Server 2003.
We're starting to run into random and difficult to…

user8133
- 451
- 1
- 5
- 5
29
votes
3 answers
How to enumerate process' handles?
Is there any way how to enumerate process with given PID in windows, and get list of all his opened handles(locked files, etc.)?
EDIT: I dont care about language. If it is in .NET, I'd be glad, if in WinApi (C), it won't hurt. If in something else,…

nothrow
- 15,882
- 9
- 57
- 104
28
votes
3 answers
Difference between HANDLE and HWND in Windows API?
I'm trying to use function SetForegroundWindow(HWND hWnD). I have some handles but it's not working as parameter of above function. My handle is a thread and I want to run it in foreground.
What are the differences between a HWND and a HANDLE?

Thangnv
- 805
- 3
- 11
- 22
27
votes
8 answers
SWT No More Handles
Windows XP has the limit 10000 user handles for each process and total 32000 for each desktop session. However, when I run 4 or 5 SWT process, each consuming no more than 2000 user handles, the SWT No More handles exception will always be…

James
- 1,001
- 2
- 15
- 23
18
votes
1 answer
Resizable handles with jQueryUI
I need to make resizable handles like in this image.
To be more specific, I need those blue dots to be around my
to allow resizing from different sides.
Currently I'm using the following code:

user2265529
- 479
- 1
- 8
- 18
15
votes
3 answers
Get process name from pid or handle
Assuming I already have the handle to a window, I can get the PID with GetWindowThreadProcessId. Is there a way I can get the process name without having to get all the processes and try to match my PID?

user579674
- 2,159
- 6
- 30
- 40
15
votes
3 answers
Testing for an invalid windows handle: should I compare with 'NULL', '0' or even 'nullptr'?
I'm coming from a background whereby pointers should generally be compared with 'NULL' and integers with '0'.
Since I didn't perceive Windows handles to be 'pointers' in the pure sense (being 'handles'), I'd got into the habit of comparing them with…

Coder_Dan
- 1,815
- 3
- 23
- 31
11
votes
3 answers
Handles Comparison: empty classes vs. undefined classes vs. void*
Microsoft's GDI+ defines many empty classes to be treated as handles internally. For example, (source GdiPlusGpStubs.h)
//Approach 1
class GpGraphics {};
class GpBrush {};
class GpTexture : public GpBrush {};
class GpSolidFill : public GpBrush…

Nawaz
- 353,942
- 115
- 666
- 851
10
votes
1 answer
Migrating 'Handles' from VB.NET to C#
I'm migrating some code from VB.NET to C# (3.5).
I find structures like:
Public Event DataLoaded(ByVal sender As Object, ByVal e As EventArgs)
Protected Sub Mag_Button_Load_Click(ByVal sender As Object, ByVal e As EventArgs) Handles…

pistacchio
- 56,889
- 107
- 278
- 420
8
votes
8 answers
UI Thread .Invoke() causing handle leak?
In what circumstances would updating a UI control from a non-UI thread could cause the processes' handles to continually increase, when using a delegate and .InvokeRequired?
For example:
public delegate void DelegateUIUpdate();
private void…

JYelton
- 35,664
- 27
- 132
- 191
8
votes
2 answers
Handles leak (Event type) in .NET application
I have a Windows Forms application written in .NET 4.0. Recently, while execution some tests, I noticed that there is some problem with handles. Table below shows the results:
As you can see the, only handle type which is increasing is Event.
So my…

rwasik
- 296
- 4
- 17
7
votes
2 answers
Why is SafeHandle.DangerousGetHandle() "Dangerous"?
This is the first time ever that I'll be using SafeHandle.
I need to call this P/Invoke method that needs an UIntPtr.
[DllImport("advapi32.dll", CharSet = CharSet.Auto)]
public static extern int RegOpenKeyEx(
UIntPtr hKey,
…

Ian
- 5,625
- 11
- 57
- 93
7
votes
1 answer
Matplotlib doesn't show hatches in custom legend
I create a custom legend, but he does not show the hatches of the patches. Whats wrong?
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
from pylab import *
t = arange(0.0, 2.0, 0.01)
s = sin(2*pi*t)
fig1 =…

Mark Z.
- 73
- 1
- 5
6
votes
1 answer
Get name of all handles in current process
I need to list all open handles in current process.
Since i could not find any function like "EnumHandles", I was thinking of making a loop from 0 to 1000. The question is how i can retrieve the name of each handle?
I am using c++ and the OS is Win7…

WePro2
- 83
- 2
- 5
6
votes
1 answer
Matlab GUI: How to update handles structure?
I am working on GUI. I want to store data in extra fields created in handles structure. However, I don't know how to update handles structure properly when callback function ends. Please, give any advice.
My simplified program
Set number of signal…

K.Ramel
- 61
- 2