This page shows the posts published with the category 'Windows'

Tip: Automatically create a crash dump file on error

Crash dumps are very useful to debug an application. Recently, I worked on a Visual Studio extension we use in my company. It's very easy to develop such kind of application. However, there are lots of reasons for your extension to crash. Of course you can add lots of try/catch, but you'll for sure forget the good one, so VS will crash. When it's happening, you would like to be able to attach a debugger… [read more]

Starting a http file server from the file explorer using .NET Core 2.0 and Kestrel

The previous version of this post was using .NET Core 1.1. Today, we'll do the same but using .NET Core 2.0. The main change concern the web server startup method. If you're developing html/js applications and want to test locally (file:///c:/...), many times your browser will prevent you from using some functionalities such as accessing local files using XMLHttpRequest. In Google Chrome, you can disable… [read more]

Starting a http file server from the file explorer using .NET Core

This post uses .NET Core 1.1. If you use .NET Core 2.0, please read the updated post here. If you're developing html/js applications and want to test locally (file:///c:/...), many times your browser will prevent you from using some functionalities such as accessing local files using XMLHttpRequest. In Google Chrome, you can disable this check using the command line argument… [read more]

Convert a VMDK (VMWare) file to VHDX (Hyper-V)

Microsoft provides a free tool to convert an existing virtual machine to a Hyper-V virtual machine: Microsoft Virtual Machine Converter. This tool has a graphical interface allowing to carry out the most common operations. However, in some cases (often non-enterprise), you must use the supplied PowerShell cmdlet. For example, the following script converts a virtual hard disk of type VMDK (VMWare) to a… [read more]

Prevent Windows shutdown or session ending in .NET

When the user logs off or when he stops his machine, Windows quits all open applications. Some applications want to execute code before ending in order not to lose the current state (a document being written for example). For this Windows sends a message to all applications: WM_QUERYENDSESSION when closing the session WM_ENDSESSION when shutting down the machine If the application does not process these… [read more]

Detect the opening of a new window in C#

One can sometimes need to detect the opening of a new window to perform a treatment: close a popup, automatically enter some information… In order to avoid using interop and the RegisterShellHookWindow method, UI Automation can be used. UI Automation provides programmatic UI access initially to create assistive software for people with disabilities, but it is also used to create automated graphical user… [read more]