Wednesday 27 May 2020

Character Table OEM, ANSI, and Unicode - To see what character will display in the console and how it will appear in Notepad.

Informational Posts

Character Table

Codepages 850/1252
Name OEM Type Range (Unicode conversion of OEM Character)

    0 0x0 ␀  Control  Control Codes

    1 0x1 ␁ ☺ Control  Control Codes

    2 0x2 ␂ ☻ Control  Control Codes

    3 0x3 ␃ ♥ Control  Control Codes

    4 0x4 ␄ ♦ Control  Control Codes

    5 0x5 ␅ ♣ Control  Control Codes

    6 0x6 ␆ ♠ Control  Control Codes

    7 0x7 ␇ • Control  Control Codes

    8 0x8 ␈ ◘ Control  Control Codes

    9 0x9 ␉ ○ Blank Control Space  Control Codes

    10 0xA ␊ ◙ Control Space  Control Codes

    11 0xB ␋ ♂ Control Space  Control Codes

    12 0xC ␌ ♀ Control Space  Control Codes

    13 0xD ␍ ♪ Control Space  Control Codes

    14 0xE ␎ ♫ Control  Control Codes

    15 0xF ␏ ☼ Control  Control Codes

    16 0x10 ␐ ► Control  Control Codes

    17 0x11 ␑ ◄ Control  Control Codes

    18 0x12 ␒ ↕ Control  Control Codes

    19 0x13 ␓ ‼ Control  Control Codes

    20 0x14 ␔ ¶ Control  Control Codes

    21 0x15 ␕ § Control  Control Codes

    22 0x16 ␖ ▬ Control  Control Codes

    23 0x17 ␗ ↨ Control  Control Codes

    24 0x18 ␘ ↑ Control  Control Codes

    25 0x19 ␙ ↓ Control  Control Codes

    26 0x1A ␚ → Control  Control Codes

    27 0x1B ␛ ← Control  Control Codes

    28 0x1C ␜ ∟ Control  Control Codes

    29 0x1D ␝ ↔ Control  Control Codes

    30 0x1E ␞ ▲ Control  Control Codes

    31 0x1F ␟ ▼ Control  Control Codes

    

      Char Type Range

    32 0x20   Blank Space  Basic Latin

    33 0x21 ! Punct  Basic Latin

    34 0x22 " Punct  Basic Latin

    35 0x23 # Punct  Basic Latin

    36 0x24 $ Punct  Basic Latin

    37 0x25 % Punct  Basic Latin

    38 0x26 & Punct  Basic Latin

    39 0x27 ' Punct  Basic Latin

    40 0x28 ( Punct  Basic Latin

    41 0x29 ) Punct  Basic Latin

    42 0x2A * Punct  Basic Latin

    43 0x2B + Punct  Basic Latin

    44 0x2C , Punct  Basic Latin

    45 0x2D - Punct  Basic Latin

    46 0x2E . Punct  Basic Latin

    47 0x2F / Punct  Basic Latin

    48 0x30 0 Number Hex  Basic Latin

    49 0x31 1 Number Hex  Basic Latin

    50 0x32 2 Number Hex  Basic Latin

    51 0x33 3 Number Hex  Basic Latin

    52 0x34 4 Number Hex  Basic Latin

    53 0x35 5 Number Hex  Basic Latin

    54 0x36 6 Number Hex  Basic Latin

    55 0x37 7 Number Hex  Basic Latin

    56 0x38 8 Number Hex  Basic Latin

    57 0x39 9 Number Hex  Basic Latin

    58 0x3A : Punct  Basic Latin

    59 0x3B ; Punct  Basic Latin

    60 0x3C < Punct  Basic Latin

    61 0x3D = Punct  Basic Latin

    62 0x3E > Punct  Basic Latin

    63 0x3F ? Punct  Basic Latin

    64 0x40 @ Punct  Basic Latin

    65 0x41 A Alpha Upper Hex  Basic Latin

    66 0x42 B Alpha Upper Hex  Basic Latin

    67 0x43 C Alpha Upper Hex  Basic Latin

    68 0x44 D Alpha Upper Hex  Basic Latin

    69 0x45 E Alpha Upper Hex  Basic Latin

    70 0x46 F Alpha Upper Hex  Basic Latin

    71 0x47 G Alpha Upper  Basic Latin

    72 0x48 H Alpha Upper  Basic Latin

    73 0x49 I Alpha Upper  Basic Latin

    74 0x4A J Alpha Upper  Basic Latin

    75 0x4B K Alpha Upper  Basic Latin

    76 0x4C L Alpha Upper  Basic Latin

    77 0x4D M Alpha Upper  Basic Latin

    78 0x4E N Alpha Upper  Basic Latin

    79 0x4F O Alpha Upper  Basic Latin

    80 0x50 P Alpha Upper  Basic Latin

    81 0x51 Q Alpha Upper  Basic Latin

    82 0x52 R Alpha Upper  Basic Latin

    83 0x53 S Alpha Upper  Basic Latin

    84 0x54 T Alpha Upper  Basic Latin

    85 0x55 U Alpha Upper  Basic Latin

    86 0x56 V Alpha Upper  Basic Latin

    87 0x57 W Alpha Upper  Basic Latin

    88 0x58 X Alpha Upper  Basic Latin

    89 0x59 Y Alpha Upper  Basic Latin

    90 0x5A Z Alpha Upper  Basic Latin

    91 0x5B [ Punct  Basic Latin

    92 0x5C \ Punct  Basic Latin

    93 0x5D ] Punct  Basic Latin

    94 0x5E ^ Punct  Basic Latin

    95 0x5F _ Punct  Basic Latin

    96 0x60 ` Punct  Basic Latin

    97 0x61 a Alpha Lower Hex  Basic Latin

    98 0x62 b Alpha Lower Hex  Basic Latin

    99 0x63 c Alpha Lower Hex  Basic Latin

    100 0x64 d Alpha Lower Hex  Basic Latin

    101 0x65 e Alpha Lower Hex  Basic Latin

    102 0x66 f Alpha Lower Hex  Basic Latin

    103 0x67 g Alpha Lower  Basic Latin

    104 0x68 h Alpha Lower  Basic Latin

    105 0x69 i Alpha Lower  Basic Latin

    106 0x6A j Alpha Lower  Basic Latin

    107 0x6B k Alpha Lower  Basic Latin

    108 0x6C l Alpha Lower  Basic Latin

    109 0x6D m Alpha Lower  Basic Latin

    110 0x6E n Alpha Lower  Basic Latin

    111 0x6F o Alpha Lower  Basic Latin

    112 0x70 p Alpha Lower  Basic Latin

    113 0x71 q Alpha Lower  Basic Latin

    114 0x72 r Alpha Lower  Basic Latin

    115 0x73 s Alpha Lower  Basic Latin

    116 0x74 t Alpha Lower  Basic Latin

    117 0x75 u Alpha Lower  Basic Latin

    118 0x76 v Alpha Lower  Basic Latin

    119 0x77 w Alpha Lower  Basic Latin

    120 0x78 x Alpha Lower  Basic Latin

    121 0x79 y Alpha Lower  Basic Latin

    122 0x7A z Alpha Lower  Basic Latin

    123 0x7B { Punct  Basic Latin

    124 0x7C | Punct  Basic Latin

    125 0x7D } Punct  Basic Latin

    126 0x7E ~ Punct  Basic Latin

    127 0x7F  Control  Basic Latin

    

      UTF ANSI OEM Type Range (ANSI conversion of OEM Character eg ® replaced by R)

    128 0x80 € € ¼ Control  Control Codes

    129 0x81   ü Control  Control Codes

    130 0x82 ‚ ‚ → Control  Control Codes

    131 0x83 ƒ ƒ Æ Control  Control Codes

    132 0x84 „ „ ▲ Control  Control Codes

    133 0x85 … … & Control Space  Control Codes

    134 0x86 † †  Control  Control Codes

    135 0x87 ‡ ‡ ! Control  Control Codes

    136 0x88 ˆ ˆ ã Control  Control Codes

    137 0x89 ‰ ‰ 0 Control  Control Codes

    138 0x8A Š Š ` Control  Control Codes

    139 0x8B ‹ ‹ 9 Control  Control Codes

    140 0x8C ΠΠR Control  Control Codes

    141 0x8D   ì Control  Control Codes

    142 0x8E Ž Ž } Control  Control Codes

    143 0x8F   Å Control  Control Codes

    144 0x90   É Control  Control Codes

    145 0x91 ‘ ‘ ↑ Control  Control Codes

    146 0x92 ’ ’ ↓ Control  Control Codes

    147 0x93 “ “ ∟ Control  Control Codes

    148 0x94 ” ” ↔ Control  Control Codes

    149 0x95 • • " Control  Control Codes

    150 0x96 – – ‼ Control  Control Codes

    151 0x97 — — ¶ Control  Control Codes

    152 0x98 ˜ ˜ ▄ Control  Control Codes

    153 0x99 ™ ™ " Control  Control Codes

    154 0x9A š š a Control  Control Codes

    155 0x9B › › : Control  Control Codes

    156 0x9C œ œ S Control  Control Codes

    157 0x9D   Ø Control  Control Codes

    158 0x9E ž ž ~ Control  Control Codes

    159 0x9F Ÿ Ÿ x Control  Control Codes

    160 0xA0     á Blank Space  Latin-1 Supplement

    161 0xA1 ¡ ¡ í Punct  Latin-1 Supplement

    162 0xA2 ¢ ¢ ó Punct  Latin-1 Supplement

    163 0xA3 £ £ ú Punct  Latin-1 Supplement

    164 0xA4 ¤ ¤ ñ Punct  Latin-1 Supplement

    165 0xA5 ¥ ¥ Ñ Punct  Latin-1 Supplement

    166 0xA6 ¦ ¦ ª Punct  Latin-1 Supplement

    167 0xA7 § § º Punct  Latin-1 Supplement

    168 0xA8 ¨ ¨ ¿ Punct  Latin-1 Supplement

    169 0xA9 © © ® Punct  Latin-1 Supplement

    170 0xAA ª ª ¬ Alpha Lower Punct  Latin-1 Supplement

    171 0xAB « « ½ Punct  Latin-1 Supplement

    172 0xAC ¬ ¬ ¼ Punct  Latin-1 Supplement

    173 0xAD ­ ­ ¡ Control Punct  Latin-1 Supplement

    174 0xAE ® ® « Punct  Latin-1 Supplement

    175 0xAF ¯ ¯ » Punct  Latin-1 Supplement

    176 0xB0 ° ° ░ Punct  Latin-1 Supplement

    177 0xB1 ± ± ▒ Punct  Latin-1 Supplement

    178 0xB2 ² ² ▓ Number Punct  Latin-1 Supplement

    179 0xB3 ³ ³ │ Number Punct  Latin-1 Supplement

    180 0xB4 ´ ´ ┤ Punct  Latin-1 Supplement

    181 0xB5 µ µ Á Alpha Lower Punct  Latin-1 Supplement

    182 0xB6 ¶ ¶ Â Punct  Latin-1 Supplement

    183 0xB7 · · À Punct  Latin-1 Supplement

    184 0xB8 ¸ ¸ © Punct  Latin-1 Supplement

    185 0xB9 ¹ ¹ ╣ Number Punct  Latin-1 Supplement

    186 0xBA º º ║ Alpha Lower Punct  Latin-1 Supplement

    187 0xBB » » ╗ Punct  Latin-1 Supplement

    188 0xBC ¼ ¼ ╝ Punct  Latin-1 Supplement

    189 0xBD ½ ½ ¢ Punct  Latin-1 Supplement

    190 0xBE ¾ ¾ ¥ Punct  Latin-1 Supplement

    191 0xBF ¿ ¿ ┐ Punct  Latin-1 Supplement

    192 0xC0 À À └ Alpha Upper  Latin-1 Supplement

    193 0xC1 Á Á ┴ Alpha Upper  Latin-1 Supplement

    194 0xC2 Â Â ┬ Alpha Upper  Latin-1 Supplement

    195 0xC3 Ã Ã ├ Alpha Upper  Latin-1 Supplement

    196 0xC4 Ä Ä ─ Alpha Upper  Latin-1 Supplement

    197 0xC5 Å Å ┼ Alpha Upper  Latin-1 Supplement

    198 0xC6 Æ Æ ã Alpha Upper  Latin-1 Supplement

    199 0xC7 Ç Ç Ã Alpha Upper  Latin-1 Supplement

    200 0xC8 È È ╚ Alpha Upper  Latin-1 Supplement

    201 0xC9 É É ╔ Alpha Upper  Latin-1 Supplement

    202 0xCA Ê Ê ╩ Alpha Upper  Latin-1 Supplement

    203 0xCB Ë Ë ╦ Alpha Upper  Latin-1 Supplement

    204 0xCC Ì Ì ╠ Alpha Upper  Latin-1 Supplement

    205 0xCD Í Í ═ Alpha Upper  Latin-1 Supplement

    206 0xCE Î Î ╬ Alpha Upper  Latin-1 Supplement

    207 0xCF Ï Ï ¤ Alpha Upper  Latin-1 Supplement

    208 0xD0 Ð Ð ð Alpha Upper  Latin-1 Supplement

    209 0xD1 Ñ Ñ Ð Alpha Upper  Latin-1 Supplement

    210 0xD2 Ò Ò Ê Alpha Upper  Latin-1 Supplement

    211 0xD3 Ó Ó Ë Alpha Upper  Latin-1 Supplement

    212 0xD4 Ô Ô È Alpha Upper  Latin-1 Supplement

    213 0xD5 Õ Õ ı Alpha Upper  Latin-1 Supplement

    214 0xD6 Ö Ö Í Alpha Upper  Latin-1 Supplement

    215 0xD7 × × Î Punct  Latin-1 Supplement

    216 0xD8 Ø Ø Ï Alpha Upper  Latin-1 Supplement

    217 0xD9 Ù Ù ┘ Alpha Upper  Latin-1 Supplement

    218 0xDA Ú Ú ┌ Alpha Upper  Latin-1 Supplement

    219 0xDB Û Û █ Alpha Upper  Latin-1 Supplement

    220 0xDC Ü Ü ▄ Alpha Upper  Latin-1 Supplement

    221 0xDD Ý Ý ¦ Alpha Upper  Latin-1 Supplement

    222 0xDE Þ Þ Ì Alpha Upper  Latin-1 Supplement

    223 0xDF ß ß ▀ Alpha Lower  Latin-1 Supplement

    224 0xE0 à à Ó Alpha Lower  Latin-1 Supplement

    225 0xE1 á á ß Alpha Lower  Latin-1 Supplement

    226 0xE2 â â Ô Alpha Lower  Latin-1 Supplement

    227 0xE3 ã ã Ò Alpha Lower  Latin-1 Supplement

    228 0xE4 ä ä õ Alpha Lower  Latin-1 Supplement

    229 0xE5 å å Õ Alpha Lower  Latin-1 Supplement

    230 0xE6 æ æ µ Alpha Lower  Latin-1 Supplement

    231 0xE7 ç ç þ Alpha Lower  Latin-1 Supplement

    232 0xE8 è è Þ Alpha Lower  Latin-1 Supplement

    233 0xE9 é é Ú Alpha Lower  Latin-1 Supplement

    234 0xEA ê ê Û Alpha Lower  Latin-1 Supplement

    235 0xEB ë ë Ù Alpha Lower  Latin-1 Supplement

    236 0xEC ì ì ý Alpha Lower  Latin-1 Supplement

    237 0xED í í Ý Alpha Lower  Latin-1 Supplement

    238 0xEE î î ¯ Alpha Lower  Latin-1 Supplement

    239 0xEF ï ï ´ Alpha Lower  Latin-1 Supplement

    240 0xF0 ð ð ­ Alpha Lower  Latin-1 Supplement

    241 0xF1 ñ ñ ± Alpha Lower  Latin-1 Supplement

    242 0xF2 ò ò ‗ Alpha Lower  Latin-1 Supplement

    243 0xF3 ó ó ¾ Alpha Lower  Latin-1 Supplement

    244 0xF4 ô ô ¶ Alpha Lower  Latin-1 Supplement

    245 0xF5 õ õ § Alpha Lower  Latin-1 Supplement

    246 0xF6 ö ö ÷ Alpha Lower  Latin-1 Supplement

    247 0xF7 ÷ ÷ ¸ Punct  Latin-1 Supplement

    248 0xF8 ø ø ° Alpha Lower  Latin-1 Supplement

    249 0xF9 ù ù ¨ Alpha Lower  Latin-1 Supplement

    250 0xFA ú ú · Alpha Lower  Latin-1 Supplement

    251 0xFB û û ¹ Alpha Lower  Latin-1 Supplement

    252 0xFC ü ü ³ Alpha Lower  Latin-1 Supplement

    253 0xFD ý ý ² Alpha Lower  Latin-1 Supplement

    254 0xFE þ þ ■ Alpha Lower  Latin-1 Supplement

    255 0xFF ÿ ÿ   Alpha Lower  Latin-1 Supplement



Monday 25 May 2020

HideWindow Hides an existing window or shows a hidden window.

This uses the inbuilt compilers in Windows 10 - there are three VB.NET compilers and three C# compilers - just copy each text file into the same folder and double click the batch file to make the program.
Window Manipulation Posts

@Echo Off
Echo HideWindow.bat
Echo This file compiles HideWindow.vb to HideWindow.exe
Echo HideWindow.exe hide or shows a window
Echo To use 
Echo     HideWindow Hide ^<Window Title^>
Echo     HideWindow Show ^<Window Title^>
Echo E.G.
Echo     HideWindow Hide Untitled - Notepad
Echo     HideWindow Show Untitled - Notepad
Echo -----------------------------------------------------
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\vbc.exe" /target:winexe /out:"%~dp0\HideWindow.exe" "%~dp0\HideWindow.vb" 
pause


'HideWindow.vb
Imports System
Imports System.IO
Imports System.Runtime.InteropServices
Imports Microsoft.Win32
Public Module TopMost
 Public Declare UNICODE Function FindWindowW Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
 Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As IntPtr, ByVal hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer
 Public Const HWND_TOPMOST = -1
 Public Const HWND_NOTOPMOST = -2
 Public Const SWP_NOMOVE = &H2
 Public Const SWP_NOSIZE = &H1
 Public Const SWP_SHOWWINDOW = &H40
 Public Const SWP_HIDEWINDOW = &H80
 Public Const SWP_NOOWNERZORDER = &H200      '  Don't do owner Z ordering
 Public Const SWP_NOREDRAW = &H8
 Public Const SWP_NOREPOSITION = &H200
 Public Const SWP_NOZORDER = &H4

 Sub Main()
  On Error Resume Next
  Dim hWindows as IntPtr
  Dim CmdLine as String
  Dim Ret as Integer
  CmdLine = Mid(Command(),6)
  hwindows = FindWindowW(vbNullString, CmdLine)
  If hwindows = 0 then
   Msgbox(Cmdline & " cannot be found.")
  Else
   If LCase(Left(Command(), 4)) = LCase("Hide") then
    Ret = SetWindowPos(hwindows, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE + SWP_NOZORDER + SWP_HIDEWINDOW)
    If Ret = 0 Then MsgBox("Set Pos Error is " & Err.LastDllError)
   ElseIf LCase(Left(Command(), 4)) = LCase("Show") then
    Ret = SetWindowPos(hwindows, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE + SWP_NOZORDER + SWP_SHOWWINDOW)
    If Ret = 0 Then MsgBox("Set Pos Error is " & Err.LastDllError)
   Else
    Msgbox("Command line not recognised")
   End If
  End If
 End Sub
End Module

Saturday 9 May 2020

KeepDisplayOn - Runs a program preventing sleeping or the display turning off while the program runs

This uses the inbuilt compilers in Windows 10 - there are three VB.NET compilers and three C# compilers - just copy each text file into the same folder and double click the batch file to make the program.


@Echo Off
ECHO Three files follow
ECHO PreventSleep.bat
ECHO.
ECHO This file compiles KeepDisplayOn.vb and KeepSystemOn.vb to KeepDisplayOn.exe and KeepSystemOn.exe using the system VB.NET compiler.
ECHO.
ECHO Runs a program preventing sleeping or the display turning off while the program runs
ECHO.
ECHO To Use
ECHO      KeepDisplayOn "C:\windows\notepad"
ECHO      KeepSystemOn "C:\windows\notepad"
ECHO.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\vbc "%~dp0\KeepDisplayOn.vb" /out:"%~dp0\KeepDisplayOn.exe" /target:winexe
C:\Windows\Microsoft.NET\Framework\v4.0.30319\vbc "%~dp0\KeepSystemOn.vb" /out:"%~dp0\KeepSystemOn.exe" /target:winexe
pause






'KeepSystemOn.vb
imports System.Runtime.InteropServices
Public Module MyApplication 
Public Declare UNICODE Function SetThreadExecutionState Lib "Kernel32" (ByVal esFlags as Integer) as Integer
Public Const  ES_AWAYMODE_REQUIRED = &h40
Public Const  ES_CONTINUOUS = &h80000000
Public Const  ES_DISPLAY_REQUIRED = &h2
Public Const  ES_SYSTEM_REQUIRED = &h1
Public Const  ES_USER_PRESENT = &h4

 Public Sub Main ()
  Dim wshshell as Object
  Dim Ret as Integer
  WshShell = CreateObject("WScript.Shell")
  Ret = SetThreadExecutionState(ES_Continuous + ES_System_Required + ES_Awaymode_Required)
  WshShell.Run(Command(), , True)
 End Sub
End Module





'KeepDisplayOn.vb
imports System.Runtime.InteropServices
Public Module MyApplication 
Public Declare UNICODE Function SetThreadExecutionState Lib "Kernel32" (ByVal esFlags as Integer) as Integer
Public Const  ES_AWAYMODE_REQUIRED = &h40
Public Const  ES_CONTINUOUS = &h80000000
Public Const  ES_DISPLAY_REQUIRED = &h2
Public Const  ES_SYSTEM_REQUIRED = &h1
Public Const  ES_USER_PRESENT = &h4

 Public Sub Main ()
  Dim wshshell as Object
  Dim Ret as Integer
  WshShell = CreateObject("WScript.Shell")
  Ret = SetThreadExecutionState(ES_Continuous + ES_Display_Required + ES_Awaymode_Required)
  WshShell.Run(Command(), , True)
 End Sub
End Module