handle

"Call to undefined method" when trying to pass handle as a constructor argument

I have a user class that I need to use my database with. To do this, I am passing the database handle as a constructor argument like so: index.php: <?php include('classes/user.class.php'); $db = new mysqli('localhost', 'root', '', 'testdb'); if ($mysqli->connect_error) { die('Database connection failed (' . $mysqli->connect_errno...

What exactly is "handle" ?

I've often heard about "handles", what exactly are those? Edit: For instance I have heard about: windows handles event handles file handles and so on. Are those things the same? Or they are some abstract terms? ...

When is the handle with name \GLOBAL?? is created?

Hi, I have a dump of process where the handle count in the process did reached 16 million handles (which is the maximum allowed handles per process). Hence the process got hanged. From dump (This is second dump where the handle count is high but not max limit.) I get following data : 53778 Handles Type Count None ...

Global dictionary vs. GCHandle

Hey, I am required to pass some sort of identifier to unmanaged code which then processes a request and calls back into my managed code once it has done some processing. I was wondering whether it would be better to create a GCHandle and pass it to the unmanaged code to then recover the object once the unmanaged code passes the GCHandl...

jQuery UI Dragging - which handler is being used?

Hi, I got the following setup for dragdrop functionality: const listDragOptions = { handle: ".camera, .texter", // dragged by either camera or edit icon //revert: true, // so dragged elements fall back to their original position, revertDuration: 200, // the element goes back instantly, no need for effects on this one sn...

Can't get window handle of a D3D application

Hello there, I'm trying to send keys to a minimized/unfocused D3D application using C#. So I borrow FindWindowEx and PostMessage function from the Win32 API. I also used Winspector Spy to determine the class name of the D3D canvas to fill in the 3rd parameter of FindWindowEx function, and the name is "D3D Window". Here's my code: Sy...

Windows API: Hide a button which is not a child window

I have a program, where I need to disable a specific button on toolbar. "Save" on the Adobe Reader control. I know it's possible to hide a control by locating its window handle. Using Spy++, I found the required toolbar. It has buttons and text fields. Although text fields are child windows of the toolbar, buttons aren't windows at all...

How to avoid Safe handle has been closed

I have the following code in a test: private void LoadIncomeStatementViewModel() { using (var evt = new AutoResetEvent(false)) { EventHandler handler = (sender, e) => evt.Set(); _incomeStatementViewModel.Loaded -= handler; _incomeStatementViewModel.Loaded += handler; ...

get handle from process

how can access to main window handle from process ? ...

jQuery UI Slider and handle-modification

I use the standard jQueryUI slider and want to change the appearance of the handle. I changed the CSS to .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 40px; height: 10px; cursor: default; border: 0; background-color: #c6c7c8; } .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display...

Why doesn't my Perl blessed filehandle doesn't return true with `can('print')`'?

For some reason, I can't get filehandles working with Expect.pm's log_file method. I originally got help on How can I pass a filehandle to Perl Expect's log_file function?, where it was suggested that I use an IO::Handle filehandle to pass to the method. This seems to be a different issue, so I thought I'd start a new question. This i...

How can I free up a DLL that is referred to by an exe that isn't running?

I've got a windows service that relies on a DLL. Whether the service is running or not, its executable is keeping a handle to that DLL, which is preventing me from updating it automatically. Why is this, and how can I remove that handle programatically (preferably via .Net)? Update: I know that the service's executable is the one with ...

managing native handles with generics

I have a C# .NET 2.0 CF project where I'm using a number of native methods. Several of those methods revolve around HANDLE objects of some sort. I'd like to abstract out the handle management lifetime using generics like this: public abstract class IHandleTraits { public abstract IntPtr Create(); public abstract void Release(Int...

Comparing filehandle with glob returned by IO::Select::can_read()

Hello, I am trying to manage three filehandles via IO::Select in perl. I have 1 input handle, 1 input/output handle, and 1 output handle. Im having a little trouble determining which filehandle is which when processing Select's return arrays of can_read() and can_write(); Example below Any advice on how to actually compare these two f...

I want the moment when a Key is "Down" in the PreviewKeyDown Event in WPF

Hello, when I jump into the PreviewKeyDown the char righthand to the Caret in my RichTextBox is not moved YET. I would like to say to this event do your stuff move the char to the rightside and THEN let me do MY stuff. How can I do that? private void RTB_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Space) {...

Must I CloseHandle() on a thread handle ?

_beginthreadex returns a handle to a thread: m_hStreamStatsThread = (HANDLE) _beginthreadex( NULL, 0, StreamStatsThread, this, 0, NULL ); This handle may be used if you need to refer to the thread in calls like TerminateThread(..) for example. According to the MSDN page on _beginthreadex, _beginthreadex won't always return a valid ha...

Magento layout module_default

I have created a module with several different controllers and therefore different pages. I want to have a default sidebar on each of my own pages but not the rest of the site. when i use the <default></default> it obviously propogates throughout the entire site. When i try <mymodule_default></mymodule_default> nothing happens. I am ...

Get menu handle

Hello, I want to get the main menu handle for outlook using an API function, I tried to use Enumwindowchilds but it didn't get the menu handle. This is the menu i want to get the handle for: Main can anybody provide a sample code?? Thanks in advance ...

[btn1 addsubview:view1], now btn1 cant handle touches

Hi there, im trying to add a view as a button's subview like this: btn1 is a UIButton [self.btn1 addSubview:view1]; After adding it, the button wont give any touch related events, the button works fine without this subview added. Any thoughts? ...