winapi

Anyone encountered a INT 3 debugger break in mscorwks.dll?

We host the .NET runtime as part of a Win32 program, and lately it has begun to consistently break at a specific address, in mscorwks.dll. At the specified address, there is a 0xCC byte, which is a INT 3 instruction, which fires the debugger. Has anyone else seen this? I can't see enough information in the dll to know specifically whe...

How to access win32 console App Data in VC++ MFC GUI.

I have two apps: Win32 Console App. MFC GUI App. I wanted to execute the console app in MFC GUI and I am want to get data from that Console app and display them in GUI. I get this error: "fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do ...

Reading the local password policy programmatically.

Are there Windows API functions that allows reading what the current password policy is? For instance, minimum length, complexity etc. If not reading, is there a way to verify a password against the policy programmatically? ...

What is your favorite Delphi open source functional testing tool?

I'm aware of Selenium which is a very good open source automated website testing tool. Is there any equivalent open source tool to provide functional testing for Win32 GUI Delphi Applications? After a quick Google I've found this one : EFT So my question is what is your favourite functional testing tool and why? ...

How to use a FolderBrowserDialog from a WPF application

I'm trying to use the FolderBrowserDialog from my WPF application - nothing fancy. I don't much care that it has the Windows Forms look to it. However, when I call ShowDialog, I want to pass the owner window which is an IWin32Window. How do I get this from my WPF control? Actually, does it matter? If I run this code and use the ShowDia...

Can I use two incompatible versions of the same DLL in the same process?

I'm using two commercial libraries that are produced by the same vendor, called VendorLibA and VendorLibB. The libraries are distributed as many DLLs that depend on the compiler version (e.g. VC7, VC8). Both libraries depend on a another library, produced by this vendor, called VendorLibUtils and contained in one DLL. The problem: Vendo...

Detect file handle leaks with Win32 C++

Is there some way to detect file handle leaks at program termination? In particular I would like to make sure that all of my handles that get created are being freed in code. For example, I may have a CreateFile() somewhere, and at program termination I want to detect and ensure that all of them are closed. ...

Problem compiling MySQLdb for Python 2.6 on Win32

I'm using Django and Python 2.6, and I want to grow my application using a MySQL backend. Problem is that there isn't a win32 package for MySQLdb on Python 2.6. Now I'm no hacker, but I thought I might compile it myself using MSVC++9 Express. But I run into a problem that the compiler quickly can't find config_win.h, which I assume is...

is it possible to create DLL for both win32 console and MFC GUI

is it possible to develop DLL for both win32 console and MFC GUI. If yes please explain. What i want to do is to create dll that contains certain API's for both win32 console and MFC GUI. ...

Win32: Write to file without buffering ?

I need to create a new file handle so that any write operations to that handle get written to disk immediately. Extra info: The handle will be the inherited STDOUT of a child process, so I need any output from that process to immediately be written to disk. Studying the CreateFile documentation, the FILE_FLAG_WRITE_THROUGH flag looked...

How to indent a selection in gvim (win32)?

I'd like to indent a block of text. I am able to do this in the linux build of givm. I do this is the state of gvim where I'm not in the insert or visual mode. The bar at the bottom is blank on the left and the line number, percentage are showing on the right hand side. Then I perform the following procedure: I select a block of text...

What Arguments are you supposed to give to the Windows API call VerQueryValue

I understand the first argument must be the result of GetFileVersionInfo(). The third and forth are target buffer and size What is the second argument, lpSubBlock? Thanks In Advance ...

What is the difference between HANDLE and HFILE in WinAPI?

WinAPI OpenFile function returns HFILE, and GetFileTime for instance needs HANDLE. When I feed it with (HANDLE)some_hFile it seems to work fine. Is there any difference in this types, or one of these is simply rudimental? ...

How to get the name/description of an exception?

How do you get the name and/or description of an SEH exception without having to hard-code the strings into your application? I tried to use FormatMessage(), but it truncates the message sometimes, even if you specify to ignore inserts: __asm { // raise access violation xor eax, eax mov eax, [eax] } Raises an exception ...

How do I convert a Char into a Keycode in .Net?

I want to convert a string into a series of Keycodes, so that I can then send them via PostMessage to a control. I need to simulate actual keyboard input, and I'm wondering if a massive switch statement is the only way to convert a character into the correct keycode, or if there's a simpler method. ==== Got my solution - http://msdn.m...

Export HTML to PDF (C++, Windows)

I am looking for a redistributable component to convert HTML to PDF. I would - at the moment - like to avoid using a "PDF printer", as this requires a printer installation and some user "playing around" in the printers panel might break that feature. The HTML is available in a Browser control or as external file. The HTML is normally f...

How do I get the current state of a thread (e.g. blocking, suspended, running, etc..) in win32?

I couldn't find a documented API that yields this information. A friend suggested I use NtQuerySystemInformation. After looking it up, the information is there (see SYSTEM_THREAD ) but it is undocumented, and not very elegant - I get the information for all threads in the system. Do you know of a more elegant, preferably documented API...

Finding out why a process is spending time in the kernel in win32

I'm compiling a vc8 C++ project in a WinXp VmWare session. It's a hell of a lot slower than gcc3.2 in a RedHat VmWare session, so I'm looking at Task Manager. It's saying a very large percentage of my compile process is spent in the kernel. That doesn't sounds right to me. Is there an equivalent of strace for Win32? At least somethin...

How can you write info to a Windows "global (in-memory) variable" than can be shared by various applications, using Windows APIs?

Maybe this cannot be done, but please help or suggest how this can be achieved without writing something to disk. Lets suppose there are two string values that I want to share between two independent applications. You are welcome to provide code sample in any programming language. ...

Detect an internet connection activation with Delphi

I've been using a 3G wireless card for a while and every time I connect, my anti-virus fires up the updates. I'm wondering what is the Win32 API set of functions that I can use to, either, get notified or query about the event of an Internet Connection coming up? And is there already a set of ported headers for Delphi? ...