Source file: /~heha/ewa/Motor/cdesk.zip/staticx.h

#pragma once
//#define WINVER 0x0500
#if !defined(_WIN32_WINNT) || _WIN32_WINNT<0x0500
# undef _WIN32_WINNT
# define _WIN32_WINNT 0x0500
#endif
#include <windows.h>

/* Realisiert ein (einzeiliges) Label-Fenster als RichEdit
 + Tiefstellung mit "_"
 + Hochstellung mit "~"
 + Fett mit " *" "* ", Kursiv mit " /" "/ ", Unterstrichen mit " _" "_ "
 + Schriftgröße passend zur Höhe?
Das kann ohne viel Wenn-und-Aber in einer Ressource liegen.
 */


struct StaticX{
 static WNDPROC oldproc;
 static int oldwndextra;
 static HMODULE hDll;
 static BOOL init();
 static LRESULT CALLBACK wndproc(HWND,UINT,WPARAM,LPARAM);
 HWND wnd;
 StaticX(HWND w):wnd(w) {}
 LRESULT wndproc(UINT,WPARAM,LPARAM);
 void setText(const TCHAR*);
};

struct DrawTextParams:public DRAWTEXTPARAMS {
  const int*iTabStops;
  int nTabStops;
  int nTabOrigin;
  int nMinSpace;
};
/* The iTabStops array defines tabstop positions in logical coordinates.
 * 0b00xx xxxx xxxx xxxx = left-aligned
 * 0b01xx xxxx xxxx xxxx = center-aligned
 * 0b10xx xxxx xxxx xxxx = decimal-point / decimal-comma aligned
 * 0b11xx xxxx xxxx xxxx = right-aligned (negative value compatible to TabbedTextOut)
 DT_AUTOTAB modifies iTabPositions so each cell fits into the table
 keeping nMinSpace space between items.
 With this info return, a user program may draw vertical bars between items afterwards.
 If nMinSpace is <=0, it defaults to dc.getCurrentFont.TextMetrics.tmAverageWidth.
*/

// Ohne RichEdit: Programm startet schneller
int WINAPI hehaDrawText(HDC,const TCHAR*,int,RECT*,UINT);
int WINAPI hehaDrawTextEx(HDC,TCHAR*,int,RECT*,UINT,DRAWTEXTPARAMS*);

// 0x01	Bruchstrich?
// 0x02	Übereinander? (wie Bruchstrich nur ohne Strich)
// 0x03
// 0x04
// 0x05
// 0x06
// 0x07
// 0x08	Tab mit rechtsbündiger Textausgabe
// 0x09	Tab mit linksbündiger Textausgabe
// 0x0A	Neue Zeile
// 0x0B	-
// 0x0C	-
// 0x0D	wird ignoriert
// 0x0E	Scope-Klammer auf (Schrift+Farbe auf Stack; Bruch/Übereinander beginnt)
// 0x0F	Scope-Klammer zu (Schrift+Farbe wiederherstellen; Bruch/Übereinander endet)
// Die Steuerkodes 0x10..0x1A schalten ein oder aus, das ist am flexibelsten und Platz sparendsten!
// Normale Schriftattribute:
// 0x10	Fett ein/aus
// 0x11	Kursiv ein/aus
// 0x12	Unterstreichen ein/aus
// 0x13	Durchstreichen ein/aus
// 0x14 25% größer ein/aus
// 0x15	25% kleiner ein/aus
// 0x16 Serifen ein/aus (Umschaltung Arial<->Times New Roman)
// 0x17 Schrift mit fester Breite ein/aus
// Extra-Schriftattribute
// 0x18	Tiefgestellt ein/aus (gleichzeitig 25% kleiner)
// 0x19	Hochgestellt ein/aus (gleichzeitig 25% kleiner)
// 0x1A Überstreichen ein/aus (für Wurzeln)
// 0x1B (freigehalten für ANSI-Steuersequenzen)
// Schrift und Farbe
// 0x1C	Schriftart, danach Fontname
// 0x1D	Schriftgröße 
// 0x1E	Vordergrundfarbe hexadezimal RGB (interessant: Win10 DrawText: Alternatives PrefixChar (statt '&'), "\x1E&" ergibt unterstrichenes & was sonst nicht anders geht)
// 0x1F	Hintergrundfarbe hexadezimal RGB, bei ungültigen Ziffern transparent
// 0x7F	-

// Additional DrawText flags
enum{
  DT_SUPERSUB	 =0x00400000,	// Additional "_^" processing
  DT_KEEPCONTROLS=0x00800000,	// If not specified, " *bold* " displays " bold "
  DT_AUTOTAB	 =0x01000000,
};

INT_PTR WINAPI DrawTextTestDlg(HWND,UINT,WPARAM,LPARAM);
Detected encoding: ANSI (CP1252)4
Wrong umlauts? - Assume file is ANSI (CP1252) encoded