Convert a C++ program to a Windows service?

There’s a good example on how to set up a minimal service on MSDN. See the parts about writing the main function, entry point and also the example code. Once you’ve got a windows service built and running, you’ll discover the next major gotcha: it’s a pain to debug. There’s no terminal (and hence no … Read more

How get list of local network computers?

You will need to use the System.DirectoryServices namespace and try the following: DirectoryEntry root = new DirectoryEntry(“WinNT:”); foreach (DirectoryEntry computers in root.Children) { foreach (DirectoryEntry computer in computers.Children) { if (computer.Name != “Schema”) { textBox1.Text += computer.Name + “\r\n”; } } } It worked for me.

What is the range of a Windows HANDLE on a 64 bits application?

MSDN states: Interprocess Communication Between 32-bit and 64-bit Applications 64-bit versions of Windows use 32-bit handles for interoperability. When sharing a handle between 32-bit and 64-bit applications, only the lower 32 bits are significant, so it is safe to truncate the handle (when passing it from 64-bit to 32-bit) or sign-extend the handle (when passing … Read more