winapi

Module versions in a crash dump

Hi, Is there a way to figure out versions of modules that were loaded into the process' address space when the process crashed from a crash dump that was generated by the process calling the MiniDumpWriteDump function? In other words, is any version information stored inside a dmp file? Thanks. ...

How to avoid rounding problems when comparing currency values in Delphi?

AFAIK, Currency type in Delphi Win32 depends on the processor floating point precision. Because of this I'm having rounding problems when comparing two Currency values, returning different results depending on the machine. For now I'm using the SameValue function passing a Epsilon parameter = 0.009, because I only need 2 decimal digits ...

What Win32 API can be used to find the process that has a given file open?

If I read or write to a file and receive a 33 or 32 error, I would like to log a message containing the name of the other process(es) that have the file opened. There must be a Win32 API I could use to get this info. Process Explorer displays it. Of course, Process Explorer also has info about all processes in memory. I'd prefer to find ...

EnumPorts() returns strange error on some machines

I maintain an application that uses the win32 EnumPorts() function to help determine the set of serial ports installed on the computer. I have seen cases on some computers where the call to get this information fails with a GetLastError() code of 1722 (RPC server is unavailable). I assume that this has something to do with either regis...

How can a Win32 process get the pid of its parent?

I'm currently passing the pid on the command line to the child, but is there a way to do this in the Win32 API? Alternatively, can someone alleviate my fear that the pid I'm passing might belong to another process after some time if the parent has died? ...

What's a ".dll.a" file?

I'm trying to use a open source library from a Windows application, and the only pre-built version I can find comes as a file called "lib.dll.a" What format is this, and can I convert it to a normal dll file? ...

GDI resource leak in DrawFrameControl

It seems that DrawFrameControl() creates Font and Brush objects, select them into dc, and doesn't delete them. (according to BoundsChecker messages). Does anyone faced such thing? ...

Where can I find my .emacs file for Emacs running on Windows?

I tried looking for the .emacs file for my Windows install for Emacs but could not find it. Does it have the same filename under Windows as in Unix? Do I have to create it myself? If so, under what specific directory does it go? ...

What is the purpose of the cbSize member in Win32API structs

I frequently encounter some definitions for Win32API structures (but not limited to it) that have a cbSize member as in the following example. typedef struct _TEST { int cbSize; // other members follow } TEST, *PTEST; And then we use it like this: TEST t = { sizeof(TEST) }; ... or TEST t; t.cbSize = sizeof(TEST); ... My ...

Drag and drop in winapi

I have a pure Winapi application that needs a few new features. One of them would best be implemented as two lists where you can drag-and-drop (multiple) elements between the lists. The new feature can be limited to a single dialog. What would be the quickest way to implement this? A few ideas: Pure Winapi (is it DetectDrag) A separat...

How to write to the console in a GUI application

Hi, Background: We develop win32 applications, and use the "Thompson Toolkit" on windows to give us a unix-like shell that we use as our command-line. We have a GUI program (with a WinMain and message loop) that we want to write to the console, but printf and so on don't work, even when we launch the program from the console. How can w...

How can I set different Tooltip text for each item in a listbox?

I have a listbox that is databound to a Collection of objects. The listbox is configured to display an identifier property of each object. I would like to show a tooltip with information specific to the item within the listbox that is being hovered over rather than one tooltip for the listbox as a whole. I am working within WinForms a...

Capicom 3des: 2 key or 3 key?

Much searching and reading has not told me whether the capicom.encrypteddata class module (it's VB6, but that shouldn't matter in answering this question) is using 2-key 3DES or 3-key 3DES. (.Algorithm.Name = CAPICOM_ENCRYPTION_ALGORITHM_3DES) Anyone know which one it is using? A source of this information would also be helpful. I sus...

Why does handling WM_NCCALCSIZE cause my window to jump?

I have a WPF app which snaps to screen edges (I just set the .Top or .Left of the window if you're within 20 pixels of the screen edge), but I recently added some code provided by the WPF SDK Team to "mess" with the window chrome, and although it's working great (screenshot), it's causing the "snapto" to move the window unexpectedly (e.g...

Recommend language for learning GUI on Windows

This question is slightly similar, but I'd like some different emphases. I'd like to build a small Windows Firewall log viewer application, while in the process teaching myself both GUI programming and another programming language. My goals? Write efficient code on an efficient framework. This is all relative, maybe a good benchmark is...

C# and .NET FOLDERID

How do I use Windows Vista's FOLDERID API in order to retrieve filepaths for "known folders" such as System or Windows? I've seen some APIs but I don't know how to import them properly. And yes, I know this is a very newbie question, but I spent a half hour googling and couldn't find the answer; I'd also appreciate a way to find an answe...

Win32 WM_SETCURSOR, WM_MOUSEMOVE always in pair?

I'm working on a Win32 control. There could be hundreds of "items" on this control. Those are not windows, but internal objects (eg: rectangles). Depending on the mouse position I want to change the mouse cursor. That is fine, I can use WM_SETCURSOR. At the same time based on mouse move I want to display a status bar which shows details...

Design: Large archive file editor, file mapping

Hello! I'm writing an editor for large archive files (see below) of 4GB+, in native&managed C++. For accessing the files, I'm using file mapping (see below) like any sane person. This is absolutely great for reading data, but a problem arises in actually editing the archive. File mapping does not allow resizing a file while it's being a...

Capture which step of an animated system cursor is being shown on Windows

I want to capture as a bitmap the system cursor on Windows OSes as accurately as possible. The provided API for this is to my knowledge GetCursorInfo, DrawIconEx. The simple chain of actions is: Get cursor by using GetCursorInfo Paint the cursor in a memory DC by using DrawIconEx. Here is how the code looks roughly. CURSORINFO Cur...

How to find full path of Outlook .pst file?

Is there a way to programmatically find the location of the current user's Outlook .pst file(s) through an API call or registry entry? ...