handle

Intercepting a WM_PAINT message and acting upon this

I'm trying to intercept/hook the WM_PAINT message of the desktop in C++. I'm currently drawing with the desktop handle, my only problem is that I'm not in sync so it might flicker. What I basically would like is a statement where I can check on the WM_PAINT of UINT message. When this is the case, I want to do something else. I'm going ...

Problems with declarations and initializations

I am trying to rewrite a code I have written earlier. The code uses cplex concert API; #include <ilcplex/ilocplex.h> using namespace std; ILOSTLBEGIN int main(){ IloEnv env; IloModel model(env); IloVarArray x(env); IloCplex cplex(model); return 0; } This code (though it doesn't do anything) w...

How to get hWnd of window opened by ShellExecuteEx.. hProcess?

This "simple" issue seems to be fraught with side issues. eg. Does the new process open multiple windows; Does it have a splash screen? Is there a simple way? (I'm starting a new instance of Notepad++) ... std::tstring tstrNotepad_exe = tstrProgramFiles + _T("\\Notepad++\\notepad++.exe"); SHELLEXECUTEINFO SEI={0}; sei.cbSize ...

Access is denied - when trying to get the url (text) from address bar's handle

I'm trying to extract the URL from the address bar of IE. (IE 8 on Windows 7) using the following C# code. static string GetUrlFromIE() { IntPtr windowHandle = APIFuncs.getForegroundWindow(); IntPtr childHandle; String strUrlToReturn = ""; //try to get a handle to IE's too...

View does not handle click events after changing screen orientation

Hi all, I have one weird issue. I have developed application (Android 1.5) which does not recreates itself on changing screen orientation (android:configChanges="orientation|keyboardHidden") and do nothing on configChange method (just to forbid recreating activity), but some of my special views lost possibility to handle onClick events, ...

C Handles - How to work with them?

I have in some documentation for a plugin for Dreamweaver I am making that says the following: void **connectionData • The connectionData argument is a handle to the data that the agent wants Dreamweaver to pass to it when calling other API functions. I have no other information than this from the manual in regard to con...

[C#] How do I get the access mask of a handle?

Let's say I have a handle. How do I get the access mask of that handle? I need to check if the access mask is 0x001a019f, which indicates the handle is that of a blocking pipe. If it helps, this is a post related to this post. In short, since I'm hooking ntdll.dll's NtCreateFile(), I need to filter out some file handles, since resolving...

Process handle count increasing with long running server application

I have an application that is transferring files across the network, doing FTP, etc. I am launching these tasks using the new Task functionality in .NET 4.0. Aside from a problem where I have not figured out why my application hangs when running in Debug or Release from the IDE, the application has been deployed to a test server and ha...

Error passing socket to child process when using STARTF_USESTDHANDLES flag with CreateProcess()

I am trying to call a FastCGI application from .Net - this means that I need to pass a handle to a socket to the child process. However what I'm seeing is that if I use the STARTF_USESTDHANDLES flag with CreateProcess() then the child application fails when it attempts to read from the socket. I've worked out that I get around this by ...

Difference between SafeProcessHandle and IntPtr for an API call

While working with WinAPI, I decided to implement a call to GetProcessAfinityMask in my C# application. However, I've seen two different signatures for this function. One of them uses SafeProcessHandle for the handle: [DllImport("kernel32.dll", CharSet=CharSet.Auto, SetLastError=true)] public static extern bool GetProcessAffinityMask(...

Finding text input control in other application by mouse

I'm trying to write a password storing application (similar to KeePass, for practice purposes), and i would like this application to have a selection mode similar to Spy++'s Find Window function. The goal is to obtain a window handle to a password control the user selects, so that my app can send a stored password to this control, perh...

Register to be default app for custom file type

Register to be able to open files of custom type. Say i have .cool files, and if the user tries to oepn it, Android asks if they would like to open it with my application. How? ...

How to implement "Handles" via Codedom

I've been trying figure out how to add a handler to a method using Codedom, but am not getting very far. The method I want to reproduce via Codedom is: Private Sub Startup() Handles btnStart.Click ''# Do work End Sub The method is easy enough to create with: Dim StartupMethod As New CodeMemberMethod StartupMethod.Name = "Startup...

How to send shortcut to another application in c++ in MS Windows?

My question is how to send shortcut from c++ to another application. Let's say for example that the notepad is open, and I want send to them shortcut like CTRL+P, or more complexive shortcut like CTRL+SHIFT+HOME, or ALT+F4, I find many good tutorials that explained how to send one key like 'A' or 'ALT', but I did not find how to send it ...

How to Compare Two variable of HANDLE type

i have to variable of HANDLE type . first variable is a process HANDLE (with name hProcess) that have'nt PROCESS_QUERY_INFORMATION access right. second variable is a process HANDLE (with name hwndProcess) too that i opened via OpenProcess function and have PROCESS_QUERY_INFORMATION access right. i sure both process is a one. but when ...

JQuery UI Slider with Multiple handles: How to stop the handles from crossing ?

Hi, I'm developing a quick solution that uses a Slider with multiple handles to define widths for a dynamic layout. I've attempted to use both ExtJS3 and the latest JQuery UI. In ExtJS, you can constrain the handles so the don't cross over each other, and it's quite an intuitive approach to the UI I need, however there are reasons why...

How do I find an annotation handle in MATLAB?

I'm trying to implement a modified version of datetick2 from the MATLAB FEX. When plots are zoomed in on a small date range, the day/month/year, etc. isn't shown, depending on the range of times in the plot. I'd like to put a 'dd-mmm-yyyy' formatted starting date as an annotation in the bottom left corner of the figure. No problem, that'...

How can I make a window appear behind the desktop icons?

I am making an app that needs a window appear behind the desktop icons. It must be visible. I am using C#. But If it's needed I can make C/C++ dll's. I know this question was already asked, but none of the aswers are realy usefull. the link to the other question: http://stackoverflow.com/questions/1978077/c-set-window-behind-desktop-ic...

How to convert a pipe handle to file_descriptor(int) for Google's protobuf

I tried to use the handle hPipe as following the example here: hPipe = CreateNamedPipe( lpszPipename, // pipe name PIPE_ACCESS_DUPLEX, // read/write access PIPE_TYPE_MESSAGE | // message type pipe PIPE_READMODE_MESSAGE | // message-read mode PIPE_WAIT, // bloc...

Android Handle requests

Hi all! I am developing a multi-player game for android. I already have all the mechanical part of the game done and for now, I have to handle the requests between players. So, imagine the follow situation. The player A choose his opponent and make his move. He only can play x or y. The player B have to receive a notification that the ...