Archives For VB.NET – Windows API

Useful Windows APIs that I have used in VB.NET

Using .NET you may think that determining which permissions are assigned to a directory/file should be quite easy, as there is a FileSystemRights Enum defined that seems to contain every possible permission that a file/directory can have and calling AccessRule.FileSystemRights returns a combination of these values. However, you will soon come across some permissions where the value in this property does not match any of the values in the FileSystemRights Enum.

Continue Reading…

When deploying a package that installs fonts (a simple MSI installation in our case) via SCCM, the user that is logged on to the computer when the MSI is installed will not be able to use these new fonts until they log out and log back on. Read on for my explanation and solution…

Continue Reading…

There are not that many changes in this release as I was only updating it for my own use really but I figured other people may benefit from the new API definitions and managed methods included.

Launching a process that the currently logged on user can see on their desktop session (and interact with) from a Windows service is a popular topic – and there are a wide variety of answers out there when someone asks how to do this, some people say it is not even possible on Windows Vista or Windows 7. Turns out it is actually very easy…

Continue Reading…

I’ve been trying to find a way to script or automate the creation of a new Windows VPN connection that uses L2TP/IPSEC with a pre shared key and automatically uses the current user’s credentials, but it seems there is no way to do this using the CMAK, netsh, various powershell scripts, or GPO Preferences as none of them include all of the options we needed to set. So I have come up with a .NET app for doing this and am posting the code here in case it helps anyone else out.

Continue Reading…

Well getting the power scheme APIs working on Windows 7 and Vista is taking a little longer than expected so I thought I would bring this new version out without the power related methods so that people can use the other new methods sooner rather than later. Download link for new version is at the end of this post, but I encourage you to read the full post to see what has changed in this version.

Continue Reading…

Even though I only released my .NET Windows API library (Cjwdev.WindowsAPI) quite recently, I’m planning to release a new version pretty soon as there are still plenty of things I want to add to it. EDIT: New version is now available, see this post. I will be releasing updated versions fairly often rather than waiting until I have a large amount of new methods etc, so keep checking back on this blog for updates. This post describes the new methods and classes that I have added (or am planning to add) to the next release, along with the Windows APIs that the managed methods use. As always, let me know if there are any particular APIs you would like to see in here and I will try and get them in.

Continue Reading…