winapi

Can you render a Direct3D window for one process into another process' HWND?

What I want to do is have a Windows application launch another Direct3D application and have the Direct3D application render into a control provided by the parent process. Is this even possible? If it is, how would it be done? ...

IPC on Vista (service and application)

I am creating an appcation on Vista,which include a service and a Console application .Both running in same user account In service i am creating an event and waits for that event.In console application i am opening the same event (problem starts here) and calling SetEvent function. I can not open the event (getting error 5,Access is ...

Variable height items in Win32 TreeView using NM_CUSTOMDRAW.

Is it possible for items in a WIn32 TreeView control to have variable heights when using NM_CUSTOMDRAW? Right now, I can successfully select variable sized fonts in the dc in NM_CUSTOMDRAW, but the item texts get clipped. ...

Is the Win32 API function definition available in a "database"/XML format ?

I'm looking for a list of win32 API in some "database"/XML format. I'd need it to easily create a "conversion layer" between win32 API and the higher level language I'm using (harbour/xharbour). Since this runs Pcode, it is necessary to transform parameters to C standard... Instead of doing manual code write, I'd like to automate the...

Mac toolbar via WINE / Crossover

Does anyone know if it's possible to get a Win32 application to run under wine / crossover but have the main toolbar appear as a Mac toolbar (i.e. outside the wine / crossover app)? ...

How to initialize Pango under Win32?

Having downloaded Pango and GLib from the GTK+ Project's Win32 downloads page and having created and configured a Win32 project under Visual Studio 2005 so it points to the proper lib and include directories, how do you initialize Pango for rendering to a Win32 window? Should the first call be to pango_win32_get_context()? Calling that ...

Best method for storing this pointer for use in WndProc

I'm interested to know the best / common way of storing a this pointer for use in the WndProc. I know of several approaches, but each as I understand it have their own drawbacks. My questions are: What different ways are there of producing this kind of code: CWindow::WndProc(UINT msg, WPARAM wParam, LPARAM) { this->DoSomething(); } ...

Creating a ZIP file on Windows (XP/2003) in C/C++

I am looking for a way to create a ZIP file from a folder in Windows C/C++ APIs. I can find the way to do this in VBScript using the Shell32.Application CopyHere method, and I found a tutorial explaining how to do it in C# also, but nothing for the C API (C++ is fine too, project already uses MFC). I'd be really grateful if anyone can s...

How do I use Qt and SDL together?

I am building a physics simulation engine and editor in Windows. I want to build the editor part using Qt and I want to run the engine using SDL with OpenGL. My first idea was to build the editor using only Qt and share as much code with the engine (the resource manager, the renderer, the maths). But, I would also like to be able to run...

Is there a clean way to prevent windows.h from creating a near & far macro?

Deep down in WinDef.h there's this relic from the segmented memory era: #define far #define near This obviously causes problems if you attempt to use near or near as variable names. Any clean workarounds? Other then renaming my variables? ...

How do you extract an RT_RCDATA section from a Win32 executable (preferably in C#)?

The only way I know how to do this currently is opening up the EXE in Visual Studio. I'd love to be able to do this entirely in C# if possible. Other options include: P/Invoking LoadResource() from the Win32 API Using an existing tool (anybody know one?) Other ideas? Thanks! ...

How to get my own code's module handle?

I'm trying to find a resource in my own module. If this module is an executable, that's trivial - GetModuleHandle(NULL) returns the handle of the "main" module. My module, however, is a DLL that is loaded by another executable. So GetModuleHandle(NULL) will return the module handle to that executable, which is obviously not what I want....

How can I ensure fopen() won't block when not connected to the network?

My win32 C++ application frequently checks a file that normally resides on a network share [in our corporate network]. But if the computer isn't connected to a network, the application freezes for several minutes and the user usually has to end the process. How can I check if the file is accessible before I open it? Checking if any netw...

Simulate Control-Alt-Delete key sequence in Vista and XP

Can I simulate in C#/C++ code Control-Alt-Delete sequence in Vista? When UAC enabled/disabled? How it is done in XP? Can you provide a code sample that works in Vista? ...

Reducing memory footprint of large unfamiliar codebase.

Suppose you have a fairly large (~2.2 MLOC), fairly old (started more than 10 years ago) Windows desktop application in C/C++. About 10% of modules are external and don't have sources, only debug symbols. How would you go about reducing application's memory footprint in half? At least, what would you do to find out where memory is consu...

How deep is the Win32 message queue?

How many messages does the queue for a standard window hold? What happens when the queue overflows? The documentation for GetMessage and relatives doesn't say anything about this, and PeekMessage only gives you a yes/no for certain classes of messages, not a message count. This page says that the queues are implemented using memory-map...

DLL information

How exactly do dlls work? There seems to be an awful lot of them, but I don't know what they are or how they work. So, what's the deal with them? ...

GetPrivateProfileString Oddity

I was just tinkering around with calling GetPrivateProfileString and GetPrivateProfileSection in kernel32 from .NET and came across something odd I don't understand. Let's start with this encantation: Private Declare Unicode Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringW" ( _ ByVal lpApplication...

How to get the application executable name in Windows (C++ Win32 or C++/CLI)?

I need to change the functionality of an application based on the executable name. Nothing huge, just changing strings that are displayed and some internal identifiers. The application is written in a mixture of native and .Net C++ code. Two ways that I have looked at are to parse the GetCommandLine() function in Win32 and stuffing aro...

Getting logged on user's name with or without domain in Windows

Hello all, Is there a direct API to get the currently logged in user's name with the domain? So, it would return something like "domain\user" when a machine is on the domain, but at the same time it would return "user" when the machine is not on the domain? If there's not, what's the best way to get this information? I noticed there's ...