handle

Check if handle belongs to the current process?

Is there any Win32 API to check if a given handle belongs to the current process? ...

Passing a reference of an handle in C++/CLI

Hello all, I want to delete a 2 level derived class with a function and putting its handle to null. A piece of code will be helpfull: ref class bob { }; ref class bill : public bob { }; ref class jack : public bill { }; void DeleteX( bob ^% x ) { if( x != nullptr ) { delete x; x = nullptr; } } [STAThreadAttribute] int...

Sever a .NET COM Interop assembly from its hosting process

When an ActiveXObject is hosted in a Windows Desktop/Sidebar Gadget, that ActiveXObject is sort of cached and the DLL file for it is locked (meaning it cannot be moved, deleted or renamed). The problem is this; when the gadget is subsequently closed, the DLL is still locked by Windows Sidebar and it cannot be removed. This causes a sig...

JQuery - handle clicking

Hello, I have such construction: <div id="slider"> <div id="nav"> <div class="sliderPart"> <a href="#computers"> <strong>1</strong> </a> </div> <div class="sliderPart"> ...

Finding the handle to a WPF window

Windows forms had a property win1.Handle which, if I recall, returns the handle of the main window handle? Is there an equivalent way to get the handle of a WPF Window? I found the following code online, IntPtr windowHandle = new WindowInteropHelper(Application.Current.MainWindow).Handle; but I don't think that will help me because ...

How to get the name of an Event from a handle

I have an array of Win32 event handles that I'm waiting on using WaitForMultipleObjects(). This returns the index in the array of events that triggered but what I need to know is the name of the event. I've been looking through MSDN and can't see anything to do this. Basically I have a class that monitors the registry through events u...

Close LogonUser Handle if Failed Logon?

The LogonUser function http://msdn.microsoft.com/en-us/library/aa378184(VS.85).aspx returns a handle that you can use to impersonate the user, when you are done using it you call CloseHandle to close it. My question is, do you need to close the handle if the logon attempt fails (ie wrong username or password)? ...

Freeing java file handles

We have a rather large and complex application written in Java which is running on top of the Gridgain package. The problem I am having is that this application will sit there processing requests for approximately a day before every request starts resulting in an exception of type java.nio.channels.ClosedByInterruptException. My suppos...

How to get window handle from a CDialog derived class ?

Hi All, Is there a way to retrieve window handle from a CDialog derived class (like CWnd::m_hWnd member) ? Thanks ...

What type of file deletes itself as soon as the handle is closed?

Let's say I have a Windows application that creates a file and writes data to it. The application has opened the file exclusively so no other processes can read the data in the file. If the process is killed, the file is deleted. If the process is suspended and the handle to the file is closed (using Process Explorer), the file is dele...

How to capture mousemove events beneath child controls.

Hi, i am trying to handle a mouseclick event on a particular form that should fire if the mouse cursor falls between a set of coordinates - lets say a square. I understand that if i had an empty form i could simply tie in to the mousemove event and off i go. But in reality there may be up to 10 different overlapping controls and in my t...

Get handle of a window that has no title.. (C#)

How can we get the handle of a window that doesn't have a title? Is there a way to enumerate all the windows on desktop and filter the window that don't have a title (in my case, there is only one) and getting the handle of it.. or by specifying other attributes like a window that has a specific button or listbox etc... ...

boost::thread causing small event handle leak?

I'm debugging this database project. It wraps access to SQLite for a higher level application. It's designed to run asynchronously, that is, it has methods like ExecuteRequestAsync() and IsRequestReady(). When ExecuteRequestAsync is called, it spawns a boost::thread to do the job and return the function immediately. When the higher level...

Track handle creation / deletion

I have a large old program which has some rather complex graphical displays (all via standard API calls). The program appears to be working fine, but I recently looked at the "handles" field of Windows Task Manager when this program was running and noticed that the number of handles was gradually and relentlessly creeping upwards. Is th...

Out of memory on _beginthreadex

I currently debug a multi threaded application, which runs without errors until some functions where called about 2000 times. After that the application stops responding, which I could track down to _beginthreadex failing with an out of memory error. When examining the Application in ProcessExplorer I can see a growing number of thre...

Force create handle for Control C#

I'm currently creating a silent print module. The current control I'm using is, it's making sure that the control handle is already created (IsHandleCreated). I did everything to cheat this with no luck at all. Do you have ideas in mind on how can I create a handle for the control without displaying any in the screen? ...

Managed C++ ^ (handle) --> What is it and how does it relate to references and pointers

What is the difference between a handle to an object in Managed C++ such as: System::String^ str = gcnew System::String(); and the ordinary C++ pointers? Also how do they relate to references we have in C#? ...

Error in creating windows handle

Hi , I have created a .net 2.0 windows application. This application creates form controls dynamically. Now when I am trying to run the application, it is throwing an exception "Error in creating windows handle". After this, application gets hang and nothing happens. At the first time, form gets displayed properly. On a particular event ...

Modules and Delphi

Hi dudes, I'm using dynamic link to load (BPL) modules into my app, the loading works fine with simple forms built into those moudles, but when adding more and more (third-) components and code to one form I get this error message "Invalid class typecast" for tha first time, 'cause for the second time the loading works ok, so I caught t...

w3wp has handle on download files

I set up iis to handle .exe with "asp.net 2.0"s isapi filter to enable dynamic url replacement. For this I setup the extension in iis and added the following line to web.config. Works fine so far. <add path="*.exe" verb="*" type="System.Web.StaticFileHandler" /> the problem is that form that point w3wp process has several handles on th...