winapi

What is the Linux/X11 (and Mac OS X) equivalent to Win API SetCapture() function?

On Windows you can "capture" the mouse to continue receiving mouse events even when it goes outside the window's client area. Here the SetCapture() documentation: http://msdn.microsoft.com/en-us/library/ms646262(VS.85).aspx I would like to know what is the equivalent function in Linux (X11) and Mac OS X (Cocoa). ...

Disable buffering on redirected stdout Pipe (Win32 API, C++)

Hi, I'm spawning a process from Win32 using CreateProcess, setting the hStdOutput and hStdError properties of STARTUPINFO to pipe handles created with CreatePipe. I've got two threads reading the pipes, waiting for data to become available (or the process to complete, at which point it checks that there is no data left before terminati...

Tool for examining the structure of a windows forms application

Hi, does anybody know a tool for examining the structure of a windows forms application? I want to get information about every control on the form like buttons, labels etc. I tried Spy++ but it tells me only some information about the window structure, but nothing about the internal controls. Thanks! Mark ...

Handling invalid window handle

The application retrieve window handles, using Enum* routines. It happens that in the while the application manage the handle (get class name, window statistics...) of an enumerated/created window, the handle is no more valid. The code managing window handles are protected using a try/catch block, but the window handle is stored and the...

How to access specific address of a USB drive

Hello everyone I need to access the partition table of a USB stick and change the first byte of partition 0 to make it bootable. And I also want to copy a bin file to a specific address of that USB drive. So can any one tell me how to perform these kind of tasks? I badly in need of some examples... If you could provide any links of suc...

Convert LPSTR to BSTR using win32

I see how to do this using MFC, but what is the best way to convert a LPSTR to a BSTR in C++ using only the win32 libraries. ...

Win32 API Console Programming in C.

I am stuck with the problems like, reading text from a specific location (x=10, y=5) on the console window. Where can I find a detail tutorial on Win32 API Console mode programming in C? ...

Differentiating between USB flash drive and USB hard drive on Windows

Hi, I'm trying to differentiate between a USB flash drive and a USB hard drive on Windows using the Win32 API. The GetDriveType() function will return DRIVE_REMOVABLE if the drive is removable, and USB flash drives are of course removable. But I'm thinking that Windows probably considers USB hard drives removable as well (unfortunately ...

Does OpenSSL has any event callback function for 'Read' data?

I was looking for event callback function when OpenSSL has incoming 'Read' data. Does OpenSSL has this kind of function? If yes, could you please show me some example code please? I'm thinking to write a simple wrapper for my application. This wrapper will make a callback when data arrive. My initial thought would be create a thread loo...

A well explained Windows API book or tutorial

I'm planing to go for the API and learn how it works, I've been looking and found some books (preferably for C++), but I'd like advice which book would be a best buy. I'd like something that keeps code simple and explains it well. Thanks in advance. ...

Print image with embedded color profile using GDI

What is the correct way to print an image containing an embedded icc profile? The way I am trying right now is to: call DocumentProperties to get the size of a DEVMODE struct call DocumentProperties to get a default DEVMODE set dmICMMethod = DMICMMETHOD_SYSTEM and dmICMIntent = DMICM_CONTRAST call DocumentProperties to merge my setti...

Windows API for Creating User Profile

Hi, I'm trying to find the Window API for creating user profile. I'm creating local user in windows, and i'm trying to run process with this user using CreateProcessWithLogonW with LOGON_WITH_PROFILE flag set. Since the profile does not exist (the user was not interactively logged on yet) the CreateProcessWithLogonW fails. When perf...

CreateProcess to run as administrator

In my Win32 application I have the ability to run child processes with redirected input and output to anonymous pipes that I create and manage - this all works with the CreateProcess() function. However on Win7 (and presumably Vista) if that process is required to be run as administrator then this fails. So what I am looking for is a way...

remote desktop software

hello, i want to know how remote desktop softer is done on windows os. (low level technical stuff) where is the best way to "hook" the gui from server host, and send it via tcp to client. so that client can see remote desktop. ...

DEP and ASLR and how to use it?

ASLR and DEP are two techniques that are used to protect applications from hackers. With many modern applications becoming more security-aware, these techniques are becoming more important. For now, I just focus on Windows 7 and these techniques. I wonder when and how I can best use these techniques, especially when developing desktop ap...

Where can I find windows crash dump (Blue screen crash dump)?

Where can I find blue screen of death crash dump? ...

WinAPI - Problem to append text to an editbox

Hi, I created a simple window with a multiline Edit Control: Edit = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("EDIT"), NULL, WS_CHILD | WS_VISIBLE | ES_MULTILINE, 20, 200, 200, 200, hWnd, (HMENU)EDIT, GetModuleHandle(NULL), NULL); If I set text using a WM_SETTEXT message, I don't...

Process with administrative privileges run on user logon

I'm trying to figure out how to solve the privilege acquisition. The application requires a desktop access, so it cannot be executed as a Windows service: it have to create a window for receiving message sent by other processes using SendMessage (it must be used for waiting message acknowledge). The application shall be started when an...

Win32API replicate Spy++ window-information capabilities within Python

Hi all - I have a third-party GUI program that I'm wrapping with a Python class (using ctypes). Are there Win32 API functions that can do the following? 1) Obtain the window handle for a window at a given screen location. 2) Obtain the window handle for a Button or Static window with a given caption. 3) Send text to an Edit window. ...

Why am I not getting events for a checkbox click in a treeview control?

In my MFC dialog, i have a tree view control with checkboxes. Clicking the checkbox does not raise the NM_CLICK nor the TVN_SELCHANGED events, which I had hoped it would do. How do I correctly determine when a checkbox is checked/unchecked in a tree view control? ...