rCons — quake-style console wrapper for Windows

At the time, when getting acquainted with Linux I was intrigued by the opportunity to bring up the console in the form in which this is done in numerous games. Examples of such programs can be mention Guake and Yakuake. Sane options on Windows find did not work, so after some time I matured to the writing of his option.



Remembering that I'm not a programmer, but just a normal admin, I realized that writing a terminal completely from scratch will not pull. Therefore, the logical solution was to use what is there — cmd.exe native a shell from PS.
At first I tried to embed a native window in its shell, cutting off his boarders and the title, but suddenly it turned out that the terminal emulator doesn't behave like a normal window and by cutting the title (WS_CAPTION) using the SetWindowLong() start strange glitches with rendering. Other "bonuses" — WS_VSCROLL exhibited permanently and not removable, and the size of the window can't be resized pixel by pixel, only taking into account the width of the screen buffer and font size.

It became clear that terminal window will have to be left alone. Then I just decided to move it to the left-up so that the header and the border was not visible, and the right to cover the border and scrolling with another blank window.

Total, logic has turned out approximately such:
the
    the
  • Spaanim process of the shell, looking for the handle of the window using the GetWindowThreadProcessId()
  • the
  • Kastuem window on SetParent()
  • the
  • Sliding window left SM_CXFRAME and SM_CYFRAME up to + SM_CYCAPTION
  • the
  • Adjust the height of the main window to account for the inability to specify the exact sizes of terminal
  • the
  • to the Right to cover the border and scrolling (optional) separate window, any rendering shoving him HWND_TOP

Despite the blatant crutches this scheme adequately work on everything from Windows XP.

Known bugs:
the
    the
  • Random boards with the rendering in the terminal emulator, until I realized how to treat
  • the
  • Inability to use "find" in context menu

Download: setup, portable, bad code
Tested on Windows XP/Vista/7/8, as terminal emulators, tested cmd, bash and powershell.

UPD: To specify the font and the width of the working space you need to run cmd.exe separately, click the RMB on the header and set the defaults. Alternative — suggested zzeneg.
The default hotkey to bring up the console Ctrl-TAB

UPD2: All the suggestions I will consider and try to implement in the next big update after the new year. Well, you know ;)

UPD3: New version:
the
    the
  • Partially fixed potential blinking when the opening and closing
  • the
  • rCons will now look for a config first in its directory, and then in AppData

Features will in the next big update, in short the list is:
1. The ability to set the size of the window horizontally.
2. mintty Support (manual)
3. The ability to specify a hotkey without a modifier.

I think for now. Thank you all for the feedback and happy new year! :)
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

A Bunch Of MODx Revolution + LiveStreet

Monitoring PostgreSQL with Zabbix

PostgreSQL load testing using JMeter, Yandex.Tank and Overload