Skip to content

Instantly share code, notes, and snippets.

View retorillo's full-sized avatar

Retorillo retorillo

View GitHub Profile
let list = split(globpath('./,lib,bin,test', '*'), '\v\r?\n')
for l in list
if !isdirectory(l) && filewritable(l)
exec printf('e %s', l)
exec 'set ff=unix'
exec 'set nobomb'
exec '%s/\s*$//'
endif
endfor

Playing short audio file on Firefox

The following problems seems to raise only on Firefox. (Chrome and Edge can play short audio file well)

This problems and solutions are confirmed on Firefox 52.0.2 (32-bit) on Windows 10 (x64)

Go to mute state

@retorillo
retorillo / lzw-refs.md
Last active July 14, 2017 10:27
GIF and LZW References

Frequently Used

  • Pencil B
  • Erase E
  • Default Foregroud/Background Colors D
  • Toggle Quick Mask X
  • Hue/Saturation Ctrl + U
  • Color Balance Ctrl + B
  • Image Size Alt + Ctrl + I
  • Canvas Size Alt + Ctrl + C
@retorillo
retorillo / unpacking-variable-length-bitstream-for-gif-like-lsb-first-packing.gif
Last active July 19, 2017 12:26
Unpacking Variable-Length Bitstream for GIF-like LSB first Packing
unpacking-variable-length-bitstream-for-gif-like-lsb-first-packing.gif

CL command does not work on the following batch file because build.bat will stop by showing message "Hit any key to close this window..." before CL. (vcvarsall.bat uses exit /b)

rem buid.bat
...\vcvarsall.bat x64
cl ...

USE &&

@retorillo
retorillo / win32_layered_window.md
Last active February 23, 2023 08:59
Summarise about layered window introduced on Windows 2000 (tested on Windows 10 and Windows 11)

How to display OutputDebugMessage-output without Visual Studio

According of my attempt, windbg could not accomplish this task. dbgview is one of alternative.

dbgview is not included to common SDK or Devtools. Can download from: https://technet.microsoft.com/en-us/sysinternals/bb896647.aspx

To use, run dbgview.exe and configure its filter, finally run debug target application. For modern Windows, must run dbgview.exe as Administrator, otherwise cannot receive debug messages from common applications.

Note that OutputDebugMessage (https://msdn.microsoft.com/en-us/library/windows/desktop/aa363362(v=vs.85).aspx) seems to work fine without debug configuration. (/Zi, /DEBUG) So, should do like this for release build:

WinHTTP Development Tips

WinHTTP vs WinINet

According to this chart, WinHTTP has a lot weak points in comparison with WinINet. But WinHttp supports the following features:

  • Services Support (Can be run from a service or a service account)
  • Session Isolation(Separate sessions do not impact each other)
  • Impersonation(Supports being called while the thread is impersonating a different user)

Win32 Window Basic

Minimal setting to registry window class

The following members of WNDCLASSEX/WNDCLASS are mandatory to register class. Note that name of WNDCLASS structure is NOT WINDOWCLASS or WNDCLS.

  • cbSize
  • lpszClassName (Must be NON-empty string, otherwise, RegisterClass or RegisterClassEx will fail)
  • lpfnWndProc