How to disable caps lock in Windows

Registry entry to disable caps lock.
Registry entry to disable caps lock.

I find that the caps lock key is useless for me and it only hinders typing when accidentally pressed. It can be disabled on Windows by adding a registry entry.

  • Save the text below as a disable_caps_lock.reg file:

It creates a new registry entry HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout

  • Double-click the file to add this registry entry and its value. It will ask for Administrator permissions.

  • Restart Windows. Your caps lock key should be disabled now.

  • To enable the caps lock back, open the Registry Editor, delete the above entry and restart Windows.

Tried with: Windows 7 Professional 64-bit

Advertisements

Driver Store Explorer

Windows (Vista and later) manage device drivers in a location called the driver store. This makes it easy to manage both the inbuilt and third-party drivers on the system. When you face some driver problems, you may want to view and manipulate with drivers.

The Driver Store Explorer (RAPR) is an useful tool to view, add or remove drivers from the driver store. I found it useful to fix a recent problem where a newer driver was not being installed over an older one.

I opened RAPR with Administrator privileges, clicked Enumerate to view the list of drivers, found the old offending driver and removed it. I later installed the new driver using its installer.

Tried with: RAPR 0.5 and Windows 7 x64

How to get started with wxWidgets on Windows

wxWidgets is a cross-platform GUI library, that is also available for Windows. You can get started with using wxWidgets in a few steps:

  1. Download and install the Windows installer for the current stable release of wxWidgets from its download page. It installs the source and build files in C:. For example, in C:\wxWidgets-3.0.0\

  2. wxWidgets needs to be built before it can be used with your application. Go to C:\wxWidgets-3.0.0\build\msw and open the .sln file that matches the Visual Studio version you intend to use for your application. For example, I open wx_vc10.sln using Visual Studio 2010.

  3. Choose one of the build types: Debug, Release, DLL Debug or DLL Release and build the solution. The resulting .lib files are placed in C:\wxWidgets-3.0.0\lib\vc_lib

  4. Create a new Visual Studio solution for your C++ application. Remember that it has to be Win32 Project, not a Win32 Console Project. The difference is that the main function is defined inside wxWidgets and does not need to be defined in your application code.

  5. Add a .cpp file to your solution and copy the Hello World code into it.

  6. Add C:\wxWidgets-3.0.0\include and C:\wxWidgets-3.0.0\include\msvc as additional include directories to the solution.

  7. Add C:\wxWidgets-3.0.0\lib\vc_lib as additional library directory to the solution.

  8. Build the solution and run it to see an empty wxWidgets window.

Tried with: wxWidgets 3.0.0, Visual Studio 2012 and Windows 7 x64

How to get started with Qt on Windows

Qt is a popular application framework to develop cross-platform GUI applications. Installing and using it on Windows is quite easy:

  1. From the Qt downloads page, download a Windows installer. The online installer is the best choice, since it allows you to install Qt built for all types of platforms. However, I found that the online installer was very slow and would stop downloading after a while. So, I decided to go with an offline installer. For Windows offline installers, you need to decide among these parameters: compiler (MinGW or Visual C++), compiler version (Visual Studio 2010 or 2012), architecture (32-bit or 64-bit) and OpenGL support. Depending on the combination you pick, say Visual Studio 2012 32-bit with OpenGL, you can find a corresponding installer for offline installation. Download and run the installer and it will install Qt source, libraries and tools under C:\Qt directory. The actual executables will be placed in a deeper directory. For example, mine were in C:\Qt\Qt5.2.0\5.2.0\msvc2012

  2. From the Start menu, open Qt Creator. This is the IDE that needs to be used to write a Qt application.

  3. In Qt Creator, create a new project by choosing File > New File or Project. Choose Applications and Qt Widgets Application if you want to create a GUI program. In the following dialogs, you will be asked to provide a name for the project, directory to store the files and a kit to use for compilation.

  4. This creates a project file with extension .pro and three source files: main.cpp, mainwindow.cpp and mainwindow.h.

  5. To compile this project, right-click on the project name in Projects section and choose Run qmake. This runs qmake which creates Makefiles relevant to your environment. Right-click on project name again and choose Build. This uses the Makefiles that was created earlier to build an executable. Finally right-click and choose Run. This runs the executable, which should result in an empty window being displayed. From here on, you can add source code to these files or more source files to extend this window into a Qt application.

Tried with: Qt 5.2.0, Visual Studio 2012 and Windows 7 x64

How to build RDKit on Windows

RDKit is a cheminformatics library with a C++ and Python API. You typically need to build it only if you need to use the C++ API on Windows. Here are the steps that worked for me:

1. Install Python and Numpy.

2. Install Boost.

3. Install CMake.

4. Download the latest RDKit source code from Github here. I have found that their Sourceforge releases do not include the C++ libraries.

5. Create a build directory in RDKit directory and open a command-prompt there and type cmake-gui ..

6. In the CMake GUI, pick the version of Visual Studio. Click Configure, click Configure again and then click Generate. CMake generates the Visual Studio solution for RDKit.

7. Open the generated RDKit.sln solution file. Choose a build type (Release or Debug) that matches that of the cheminformatics project you are working on. Choose Build > Build Solution. RDKit should build successfully.

8. Add an environment variable named RDBASE with a value of the RDKit base directory.

9. Open the cheminformatics C++ project you are working on. Add $(RDBASE)/Code as an Include directory. Add $(RDBASE)/Build/lib/Debug or $(RDBASE)/Build/lib/Release as a Library directory. Add all the .lib files in the library directory for linking.

10. To use a RDKit class in your C++ source file, find the header file that contains it. You can do this by looking at C++ documentation of RDKit. You may need to add the header file path relative to $(RDBASE)/Code

Tried with: Visual Studio 2010, Boost 1.51 and Windows 7 x64

How to list installed programs at commandline in Windows

To list all the installed programs at the commandline in Windows, use this command: wmic product

A lot of parameters are listed for every product. Some of the parameters are: name, description, URL, telephone number (not kidding!), ID, installed date, installed directory, source directory from which it was installed, language, name of installer file, vendor and version.

With so many parameters, the output for each prorgram simply cannot fit on a single line. So, it is better to redirect it to a file: wmic product > proglist.txt

Tried with: Windows 7 x64

How to get started with Kinect for Windows on Windows

The Kinect for WindowsΒ sensor can be programmed, controlled and used in your code easily on Windows. Getting started is really easy.

  1. The Kinect has a USB input and power input. Plug the power input to a power socket and the USB input to a USB port on your computer. The light on the Kinect should turn on to green color. If the light does not turn on or it is red in color, then something is badly wrong at the hardware level.Β The green light on the Kinect will blink slowly. This is all right since it indicates that the Kinect is not currently controlled by any computer. Though Windows has detected the Kinect device on its USB port, it cannot yet control it because it does not have the necessary Kinect drivers.
  2. Go to the Kinect for Windows webpage, download the Kinect for Windows SDK and install it. This provides the Kinect drivers and a library that provides basic access to the output of Kinect. Once this installation is complete, Windows should be able to detect your Kinect and its light should glow green steadily. That is, it should have stopped blinking now.
  3. It is highly recommended to install the Kinect for Windows Developer Toolkit, since this provides higher level libraries, API, sample codes and tools. This can be downloaded from the Kinect for Windows webpage too and installed.
  4. After installation, it is time to take the Kinect out for a spin! Open C:\Program Files\Microsoft SDKs\Kinect\Developer Toolkit v1.7.0\Samples\bin. You can see that it is full of binaries of various Kinect programs. Try them out! For example, the Kinect Explorer tool should show you the color, depth and audio output of your Kinect.
  5. To get started on programming the Kinect, head over to C:\Program Files\Microsoft SDKs\Kinect\Developer Toolkit v1.7.0\Samples. You can see the C++, C# and VB source code of the sample programs here. This should get you started on hacking your Kinect.

Tried with:Β Kinect for Windows, Kinect for Windows SDK 1.7, Kinect for Windows Developer Toolkit 1.7.0 and Windows 7 x64

How to write a disk image using Win32 Disk Imager

You are sometimes given a disk image that needs to be written to a USB thumbdrive or a SD card. This is typically used to create something that you can use to boot a device. The image file typically has the .img file extension, though its not necessary and does not matter.

  1. One way to write a disk image on Windows is using Win32 Disk Imager. Download it and unzip the contents.
  2. Plug in the USB thumbdrive or SD or microSD card to your computer. It should be detected and appear as a drive in Windows.
  3. Open Win32 Disk Imager, choose the .img or image file you want to write as Image File and choose the USB or SD drive as Device and press Write.
  4. The write may take a while. Once it is done, remove the USB thumbdrive or SD card and insert it into the device you want to use with.

Also see: How to write a disk image on Linux

Tried with: Win32 Disk Imager 0.8 and Windows 8 x64

How to mount and unmount ISO using Virtual CloneDrive

A lot of software is available as ISO files or IMG files and most folks would like to install this directly without having to go through the hassle of burning a DVD. This can be done by mounting the ISO file as a drive and installing from that drive.

Windows 7 and older Windows do not include the capability to mount a ISO file, but there are tools that offer this feature. The best I have found is Virtual CloneDrive. Download it, install it and any time you need to mount a ISO file, right-click it and choose Mount. When you are done and unmount it by clicking on the Virtual CloneDrive icon in the system tray.

Tried with: Virtual CloneDrive 5.4.6.0 and Windows 7 x64