Tip: Turning Win32 Console app to non-Console app

September 30, 2013

Let’s say you’ve created a Win32 Console Application in Visual Studio:We get the classic main function.Now suppose that after working on the project for a while we want to turn the app into a Windows app – no console. At first, this seems easy: just replace the main function with a proper WinMain: int _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR lpCmdLine, int nCmdShow) Unfortunately, that’s not enough. Building the project produces the following linker error:MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartupThe linker still expects a main function.The solution is (apart...
no comments

Getting rid of the Start button – Adding a Hook

September 16, 2013

In the previous post we saw how to find and remove the start button and move the task bar window to the left to occupy the free space left by the former start button.However, we saw that by opening the system tray, the task bar moves back to its original position. We need to know when that happens, and then use the same trick to move it back to the “right” position.To do that we would need to register somehow for the WM_MOVE message. This is one option, and we can verify this using Spy++’s Message window for task...

Getting rid of the Start button in Windows 8.1

September 15, 2013

Windows 8.1 brings back the famous Start button, but alas – it’s not the good Start button from Windows 7. It’s just yet another way to get to the new Home screen. This makes the Start button (at least for me) completely useless, as there are already several ways to get to the Home screen (Windows key on the keyboard, mouse moved to the bottom left corner, touch devices can press the hardware Start button, the Charms bar has a Start button…).There are utilities that can simulate the old Windows 7 Start button, if I don’t have such a...