handle

How to add one line before the last line in C

Hi I am working in C on Unix platform. Please tell me how to append one line before the last line in C. I have used fopen in appending mode but I cant add one line before the last line. I just want to write to the second last line in the file. ...

pointer vs handles in C (are the terms used to convey separate things?)

Recently, I read a white paper by an individual who refers to a pointer to a struct as a handle. The author was clearly someone who had written C code on the windows platform previously. Googling indicates that windows programmers interact with system components via handles. I am wondering if it is common practice for windows programm...

TOPMOST window in full-screen

Hi, I'm playing with a JFrame in Java. I want it to be the topmost window i.e. always on top. The setAlwaysOnTop() works fine, but as soon as I start a movie or a game-window in a full-screen mode then it fails to stay on top. I played around with JNI and handles. My C code for JNI is using SetWindowPos() and this seems to be working ...

Handle a JNI crash

I have a dll that contains legacy C code, I call this dll via JNI, but sometimes the C code crashes and causes the JVM to terminate. Is it there a way to avoid JVM crash? Can I handle the JNI fault and let the JVM survive? :) ...

Checking if a matlab handle is a valid one

I manipulate data on a plot using its handle x = 1:10; y = sin(x); h1 = line(x,y); However, if the figure gets closed before the script actually terminates, doing something like this returns an error. >>set(h1,'Color','green') % line is green ??? Error using ==> set Invalid handle object. Is there a way to check if h1 is a valid h...

How to use SafeWaitHandle.DangerousGetHandle?

I have an unmanaged code that calls an asynchronous managed method that returns a handle, and then the unmanaged code use that handle to wait, reading a little documentation I found out that SafeWaitHandle provide 2 other methods (DangerousAddRef and DangerousRelease ). Should I use these methods in order to prevent the Handle from not b...

C# HEX Value to IntPtr

Hi all. I have a hex value to a window i found using Spy++. the value is: 00010010 Thanks to an answer to a question i asked earlier, i have this code: IntPtr hwndf = this.Handle; IntPtr hwndParent = FindWindow("WINDOW HERE", null); ; SetParent(hwndf, hwndParent); this.TopMost = false; Now, as far as i understand it, IntPtr hwndPa...

Firefox: BitmapData Handle?

Hello all, I have heard that it is possible to get a bitmap/image handle of the webpage being viewed on a firefox browser. I have been researching for a bit and couldn't not find anything. So I am hoping if anyone knows how to do this, preferable via the command line (bash, any other shell on Linux). To be honest, any browser that I c...

C# Set Window Behind Desktop Icons

Hi all. Assume i have an empty form 100px by 100px at 0,0 coordinates on the screen. It has no border style. Is there any way to have this positioned BEHIND the desktop icons? I would assume this would involve the process Progman because thats what contains the desktop icons. But no matter what i try... getting window handles and changi...

change cell appearance when drag handle is pressed

I'd like to change the appearance of a cell when the user tap the drag handle. I searched in the documentation, the forums and google, but I can't find a method or an event that say when the drag icon is pressed. Any help will be appreciated! Thanks ...

What does it mean: "A child-process can inherit the handle"?

There are some Win32 objects which according to the SDK can be "inherited" to the child-processes created by the given process. (Events, mutexes, pipes, ...) What does that actually mean? Let's say I have a named event object, created with CreateEvent, one time with bInheritHandle == true, and another time == false. Now I start a chil...

Windows.Forms.NativeWindow is null

In our SDK (DotNET SDK for an unmanaged C++ application) we offer a way for plug-in developers to get the main window of our application. public static System.Windows.Forms.NativeWindow MainWindow() { System.Diagnostics.Process process = System.Diagnostics.Process.GetCurrentProcess(); if( null==process ) return null; IntPtr ha...

handle website sessions in .net

I have one VB.net ClassLibray application. I have a line of code: System.Diagnostics.Process.Start("http://stackoverflow.com/") This will take me to stackoverflow website. the question is when i close the stackoverflow website how to get a response back to my application ? ie, How to handle the sessions of external web pages in .n...

Bring Outlookelements to front

Hi, I'm opening Outlookelements with the shown Code (scroll down; C# Code). Sometimes the elements don't come to front so you first have to select them. Any idea how to do this? I thought about the handle and doing this by hand. Other idea's? Thanks Thomas MAPIFolder objFolder = new ApplicationClass().GetNamespace("MAPI").GetDefaultF...

Cwnd returnd Undefined Value

I want to use Setwindowpos() in global function to change the postiion of one dialog. So i coded like below CWnd *pWnd = (CWnd*)pMain->GetDlgItem(IDD_TOOLBAR_DIALOG);//GetActiveFrame (); pWnd->SetWindowPos(&CWnd::wndBottom,0,80,45,900,SWP_SHOWWINDOW); pWnd returns as undefined value. So i follow this method CToolTab * tab; tab = new ...

DuplicateHandle, why duplicate instead of just acquire?

Why would a process want to call DuplicateHandle from the Win32API, and get it from another process instead of just acquiring the handle on some object itself? Is there some advantage to calling DuplicateHandle or something? ...

jQuery Slider How do I lock a handle in place?

I have a jQuery slider with a two handles. I'm looking to lock the first in place based on the second handle. I've tried checking the values on the slide event and then setting the first handle back to it's lock position but it basically ignores what I set it to and continues to slide. I have gotten it to work with the stop event bu...

is it possible to resize/hide Window Standard Dialog ("choose file to upload" window) ?

The "choose file to upload" window which pops up when the browse button is clicked in the file input element on a web page. Is it possible to hide/resize this "choose file to upload" window using user32 lib functions like ShowWindow etc. I tried using ShowWindow by providing the handle of the "choose file to upload" window but it didn'...

Handling Application Exit events RubyCocoa

Hi, I guess the title is very clear. I would like to handle the Application exit event in RubyCocoa in order to write a file just before closing. Thanks for your help ...

Replace an existing Winform HWND with another one?

Hi, I'm trying to hijack an existing window and replace it with the contents of a Winforms I own. I figured it would be pretty cool swapping the form's inner handle with the one I want to override, and wondered if anyone ever tried it? Cheers, Florian ...