RSSAmplifier

Blog

Catch22

Recent content on Catch22

catch22.netRSS feed ↗74 posts

Latest posts

Strata

Introducing Strata After a long period of inactivity, one of the older parts of Catch22 HexEdit has recently come back to life. The original HexEdit (does anyone remember this still!?) had a feature called TypeLib for describing structured binary data. The language and parser I built predates HexEdit’s 2012-era implementation by several years, and I haven’t touched the code in a long…

Loxone vs Zigbee

Loxone has its own proprietary wireless technology called Loxone Air. Peripherals based on this technology integrate seamlessly into the Miniserver and controlling them is no different to hard-wired devices. The problem with Loxone Air is that it is a closed technology, and the Loxone peripherals are also relatively expensive, often 2-4 times more so than their Zigbee equivalents.

What goes around

It seems like a long time ago when I originally launched this site. I can’t really remember when it was now, but the wayback machine traces it back to 2001, when the site was hosted on catch22.uk.net. HexEdit and my other software were in development for a considerable time before that even, sometime from the mid 90’s I think.

Integrating Sonos with Loxone

Introduction I&rsquo;ve recently had a Loxone home automation installed. And rather than go with Loxone&rsquo;s own music system, I wanted to use my existing Sonos setup. I&rsquo;ve got a lot of Sonos speakers < diagram of setup ?> My system comprises

Source Archive

This page is an archive of win32 source code snippets & examples that were originally published on catch22.net. These sources are old. Like, really old. I doubt they are useful anymore, and anyone looking through them is advised to do so through a le

C & C++ Tricks

This section contains code snippets which I have acquired over time. Most of the code samples are in the C programming language. Just a couple require C++. Wherever possible, I have accredited the code with the respective authors. However, there are quite a few samples of which I have lost the original author&rsquo;s details.

Unicode Text Editing

Unicode character input presents some unique problems for text-editors - issues that did not have to be considered when the first ASCII editors were written. The main difficulties are the Unicode &lsquo;combining sequences&rsquo; - where multiple code-points are combined to form a single selectable &lsquo;character cluster&rsquo;.

Piece Chains

OK so I lied about getting the syntax-highlighting implemented this time around. I got bogged down in &ldquo;regular expression hell&rdquo; and needed something else to concentrate on. So during the summer period I&rsquo;ve instead been slowly implementing Neatpad&rsquo;s text-editing capability. As I hinted at in the very first installment of this tutorial series, I have decided to follow the…

Keyboard Navigation

Keeping with the Uniscribe theme brings us to the next area of Neatpad&rsquo;s development that hasn&rsquo;t been touched on yet, which is keyboard-input. I&rsquo;ve deliberately left this stage until now because I knew that without Uniscribe keyboard-navigation would be very difficult indeed.

Win32 Tips & Tricks - Part 2

Continuing on from the last part, here are more Win32 Tips and Tricks for you to browse. XP Themes Common-control manifests (which enable the XP themes) can be added to an executable in one of two ways: Firstly, the manifest can be saved inside a file in the same directory as your executable.

Drawing styled text with Uniscribe

The last tutorial saw the completion of the UspAnalyze function, one of the main APIs of the new UspLib text-rendering engine. We will now switch our attention to the implementation of the UspTextOut function. Our goal is to divide up the glyph-lists we ceated in the last tutorial, and apply colour information prior to display with ScriptTextOut.

Integrating UspLib

It&rsquo;s finally here! - a new and improved Neatpad which demonstrates the rendering capabilities of UspLib. The purpose of this is tutorial to document the UspLib API, and secondly to mention a few details about how UspLib was integrated into Neatpad&rsquo;s code.

More Uniscribe Mysteries

Uniscribe Mysteries continued&hellip; We are going to pick up directly from where we left the last tutorial, in which we began to look at the Uniscribe API in detail. Remember that we are still working on the UspAnalyze function, and the sequence of events last time had led us to the point where we had broken a string of Unicode text into several item-runs.

Uniscribe Mysteries

The last tutorial presented a very brief overview of the Uniscribe ScriptString API. Unfortunately ScriptString is insufficient for our purposes with Neatpad because of the limitations of a single font and colour. The aim of this tutorial is to therefore investigate the &ldquo;low-level&rdquo; Uniscribe API.

Introduction to Uniscribe

Uniscribe is a low-level Win32 API that provides a high degree of control over the processing and display of Unicode text. The API is designed to provide a generic interface to all forms of Unicode text (complex or otherwise), and transparently handles properties such as bi-directional text and combining characters sequences.

Transparent Text

It&rsquo;s been almost three months since I posted the last Neatpad tutorial, and it&rsquo;s also been over a year since I started this project. During this time I have been steadily working on the migration to the Uniscribe API. Alot of issues have become apparent with the way I am rendering text in Neatpad, so this tutorial will hopefully highlight these issues and offer a solution.

Unicode Text Processing

The last tutorial presented an overview of the various encoding formats that are used to store Unicode text. It is now time to take this theory and apply it to Neatpad. Therefore the subject of this article will be Unicode text processing.

Introduction to Unicode

The user-interface for the TextView has progressed enough to allow us to switch our attention back to the TextDocument. I am now concentrating on adding full Unicode support to Neatpad. Because Unicode is such a complicated subject I won&rsquo;t attempt to tackle it all at once so instead I will split the various aspects of Unicode across several tutorials.

64bit Scrollbars

Recently I have been rewriting part of my HexEdit application. One specific area was to properly handle 64bit file sizes (i.e. files that were over 4Gb in size). The problem I faced was not the loading of files this large, but the issue of initializing Win32 scrollbars with 64bit values.

Margins and Long Lines

This will probably be quite a short tutorial as the subject of margins is really quite simple to implement. This time around we will look at implementing a selection margin (complete with full-line selection), line numbers, line-indicator icons (e.g. like the breakpoint bitmaps in Visual Studio), and lastly the problem of long-line display.

Scrolling with the Mouse

Originally I had planned to keep all of the mouse-related concepts together in one tutorial. The problem is, does mouse-scrolling belong in the mouse tutorial (part#5) or the scrolling tutorial (part#3)? In the end I&rsquo;ve decided to make it a separate topic by itself.

Mouse Selection & Highlighting

Mouse input has proven to be the most intricate and difficult to write part of Neatpad to date. It hasn&rsquo;t been helped by the fact that Neatpad now supports variable-width fonts, so in some ways I am still unsure if this extra complexity is a good thing or not (from a tutorial / learning point of view).

Enhanced Drawing & Painting

Welcome to the fourth installment of the &ldquo;Design and Implementation of a Win32 Text Editor&rdquo; article series! I realise that you were probably expecting a different tutorial this time around. However, it was only after starting to implement mouse selection and highlighting that I realised there wasn&rsquo;t proper support in the drawing &ldquo;engine&rdquo;.

Remote Debugging using VMWare

Introduction There are two ways to debug a device-driver in Windows. The first is to install the driver on your development machine and run a local kernel-mode debugger such as SoftIce. Although SoftIce is a very powerful tool, debugging a driver on your development machine is not a good idea because you will be guaranteed to destroy all your work if the driver crashes the system.

Visual C++ Tips & Tricks

This section presents a collection of Visual C++ 6.0 tips which are often hard to find information about. All of the tips are useful in their own way, and many will work exactly as-is in Visual Studio .NET also, so take a moment to browse through the collection.

Introduction to Device Drivers

Introduction to Device Drivers Seeing as I&rsquo;ve been spending alot of time doing kernel-level programming recently I thought it was time I wrote a few articles on the subject. This first article (and the rest in this &ldquo;kernel&rdquo; series) will cover the steps needed to build, install and start a Windows NT device-driver.

Scrollbars & Scrolling

Welcome to the third installment of the &ldquo;Design and Implementation of a Win32 Text Editor&rdquo; article series! In this part we will look at adding scrollbars and scrolling to our TextView control. Scrolling in Win32 In Windows, scrolling is divided into three areas: The first is the physical scrollbars, whether they be scrollbars built into a window, or separate scrollbar controls.

Loading a text file

Introduction This is the second part of the &ldquo;Design and Implementation of a Win32 Text Editor&rdquo; article series. If you haven&rsquo;t already read part 1 then please do so now! OK, so assuming you&rsquo;ve downloaded, assimilated and compiled the source code that was made available, you should have a basic skeleton text editor which doesn&rsquo;t do anything yet.

Neatpad Overview

Introduction Welcome to the brand new tutorial series - &ldquo;Design and Implementation of a Win32 Text Editor!&rdquo; The purpose of these tutorials is to follow the development of a win32 text editor - codenamed Neatpad. Each tutorial will take you step-by-step over the major components and design decisions that lay ahead.

Drop Source

Updated 6 Dec 2006 Many thanks to Davide Chiodi from Italy who has very kindly converted the drop-source code into a Pure C implementation Welcome to the fifth article in the &ldquo;OLE Drag and Drop&rdquo; tutorial series! We are almost at the final stages in our OLE drag and drop implementation.

Drop Target

Updated 6 Dec 2006 Many thanks to Davide Chiodi from Italy who has very kindly converted the drop-target code into a Pure C implementation - download now! Welcome to the sixth part of the &ldquo;OLE Drag and Drop&rdquo; tutorial series! This article will concentrate on implementing a small application which will act as a drop-target.

Enumerating FORMATETC

This tutorial will concentrate on implementing a COM object which exposes the IEnumFORMATETC interface. There are two code downloads this time. The first includes a complete implementation of a generic IEnumFORMATETC which you can use in your applications. The second code download is the full source code to an application called &ldquo;IDataObject Viewer&rdquo;.

Implementing IDataObject

Updated 6 Dec 2006 Many thanks to Davide Chiodi from Italy who has very kindly converted the data-obect code into a Pure C implementation - the download link is available at the bottom of this article! In the last part of the tutorial we looked at how to access the Windows clipboard using OLE and the IDataObject.

OLE Data Transfers

Welcome to the second article in the &ldquo;OLE Drag and Drop&rdquo; tutorial series! The purpose of this article is to explore how data is represented and transferred between applications in the OLE environment. The very heart of OLE data transfers is the IDataObject COM interface.

Drag and Drop Introduction

The aim of this series of tutorials is to enable the reader to implement complete drag and drop support for their applications. Drag and drop became a standard feature of many Windows applications when Windows 95 was launched. With COM and OLE becoming more mainstream at this time, applications had the power to interact seamlessly with the Windows Shell and even other Windows applications.

Undocumented CreateProcess

This tutorial forms a part of a new series which will concentrate on some of the non-GUI related issues in Windows programming. The subject of this tutorial will be the CreateProcess win32 API call. The tutorial is split into several sections, each one describing a neat fact about CreateProcess which you can use to your advantage.

Custom Combobox

Introduction It&rsquo;s time for a new tutorial, something that has been overdue for a long time. The first new tutorial I want to write is going to explore how to implement a flat combo-box. The same technique will also be suitable for making combo-boxes with customized borders as well.

System Image List

Chinese translation atwww.titilima.cn Introduction The System Image List (or Shell Icon Cache as it is sometimes called) is an icon resource maintained by the Windows Shell. This list is used by Explorer, among other applications, to display the icons for system objects, programs and document types.

Custom MessageBox

This tutorial will show a simple technique for customizing a standard Windows message-box. A standard message-box is not usually customizable, because you are never normally able to find it&rsquo;s window handle. This is because the MessageBox API call only returns control to a program when the message-box has been destroyed.

Docking Toolbars - Part 2

Updated 3 May 2005 The following projects are enhancements of the original docking code found in this tutorial. Docking Windows using DWinLib by David O&rsquo;Neil www.randommonkeyworks.com Docking Toolbars by Jeff Glatt www.codeproject.com/useritems/dockwnd.asp Introduction After a long delay I&rsquo;ve finally finished part 2 of the Docking Toolbar series.

Custom Scrollbars - Reference

SCROLLBUT Specifies the attributes of a button which has been inserted into a window&rsquo;s scrollbar. This structure is used by the CoolSB_InsertButton, CoolSB_ModifyButton and CoolSB_RemoveButton API calls. typedef struct { UINT fMask; /* which members are in use */ UINT uPlacement; /* which side of the scrollbar to insert */ UINT uCmdId; /* command identifier (WM\_COMMAND value to send)*/ UINT…

Custom Scrollbars

New features in Version 1.2 TreeView problem fixed, thanks go to Diego Tártara. A few other minor problems also fixed. New features in Version 1.1 Supports ALL types of window (only in Windows NT, 2000 and XP). Simplified demo application.

CardLib

(How to use cards.dll, Part 3) Updated 14th Jul 2005 Fixed bug in Cardlib&rsquo;s CardRgnMouse.cpp which caused cardgames to hang when a stack was clicked (only occurred when compiled with VC7.0+) Introduction The previous two tutorials in this series concentrated on accessing the playing-card bitmap images from cards.

CardLib Reference

CardLib User Guide The following document describes the various C++ classes which make up the CardLib game library. class Card Function Prototype Description int Suit() Returns the suit of the card [0..3] int LoVal() Returns the value of the card, Aces Low, [1.

Custom Controls

A custom control is any child window which displays information or allows the user to interact with it in some way. This article describes the steps required to create a custom user control from scratch, using pure Win32 techniques. This custom control will not be an ActiveX control, or possess any other magical properties.

Docking Toolbars - Part 1

Introduction This tutorial will show you how to create docking toolbars, using pure Win32 techniques. I&rsquo;m going to split this topic in two separate pages. The first tutorial will cover the &ldquo;floating&rdquo; aspect of toolbars - i.e. how to get tool windows to stay floating on top of all other windows, how to get the window activation working correctly etc.

Flicker-free Drawing

Flicker is the sign of sloppy programming and a lack of attention to detail. There is no reason why any part of a Windows program should flicker. The aim of this article is to present the reader (that&rsquo;s you) with the techniques used to prevent their windows applications from flickering.

Cards.dll direct bitmap access

The first tutorial I wrote about cards.dll described how to use the exported card-drawing functions ( cdtInit , cdtDraw etc). This tutorial will take a different approach to card drawing. Instead of calling the card-functions, I will show you how to directly access the bitmap resources stored inside cards.

Custom Titlebar

This article will teach you the techniques used to insert one or more buttons into the title bar (caption area) of any window. The source code download implements a complete library which supports all types of window, including standard frame windows, and tool windows with smaller captions.

Reducing Executable Size

There are so many large and bloated applications around today that most people just assume that this is normal and quite willingly put up with poor performance and having to buy larger harddrives. In this tutorial I will present all of the techniques I know (and use) to reduce the size of executables.

Catch22 · RSS Amplifier