Recent Posts

Pages: [1] 2 3 ... 10
1
64-bit SDK programming / DWM Blur for Mica/Acrylic
« Last post by Patrice Terrier on October 30, 2025, 09:26:25 pm »
A compact demo of real DWM blur with an image overlay, gradient tint, and DPI-aware text rendering.
All packed in a stand-alone 24 KB /MT binary linked with TClib.lib.

Main Highlights
  • True DWM blur toggle (Right-Click) with instant switch — no transition flash.
  • Optional image overlay (Middle-Click), scaled and clipped to cover the client while preserving aspect.
  • Mouse-wheel–driven alpha control with speed-sensitive step (base 8 → up to 64).
  • DPI-aware (Per-Monitor-V2) rendering, sharp at any scaling.
  • Seamless maximize/restore via off-viewport reposition — no white flash or DWM fade.
  • Off-screen GDI+ compositing (double-buffered).
  • Two-color linear gradient overlay via GradientPaintDC, variable opacity / angle.
  • Private font collection with dynamic memory allocation (use-and-forget).
  • Text orientation: horizontal, bottom-up, or top-down, perfectly centered and clipped.
  • Black-theme caption bar with adaptive text color.
  • Custom small rounded corners replacing Windows 11’s exaggerated defaults.
  • Compatible with Windows 10 & 11 (Mica / Acrylic supported).

Controls
Mouse Right-Click Toggle DWM blur
Mouse Middle-Click Toggle overlay image
Mouse Wheel Adjust overlay alpha (speed-based)


Technical Notes
  • Pure Win32 / GDI+ C++ (Visual Studio 2022).
  • Static link /MT with TClib.lib → stand-alone 24 KB executable.
  • Direct-linked DPI APIs (SetThreadDpiAwarenessContext, GetDpiForWindow, etc.).
  • No external runtime or dependencies.
  • GDI+ text pipeline: DrawStringFormatedEx + BlurTextPlus.
  • Gradient painting handled by GradientPaintDC (two-color ARGB, any angle).
  • Caption bar color auto-adapts to Windows theme.
  • Custom region defines small uniform corner radius for balanced frame geometry.
  • Works seamlessly with DWM blur, Mica, or Acrylic on Windows 11.





Developer Notes

Project goal
To recreate the original Vista-style blur aesthetic with a modern, DPI-aware GDI+ implementation, packaged in a self-contained 24 KB binary (no runtime dependencies).
The design emphasizes simplicity, instant response, and pixel-perfect rendering at any scale.


Rendering architecture
  • All drawing is performed on an off-screen buffer created via GDI+ (Graphics object) to guarantee flicker-free updates.
  • Final presentation uses BitBlt to the window DC in WM_PAINT.
  • WM_ERASEBKGND always returns 1 to avoid background flashes.
  • Composition order:
    • DWM blur background (if enabled)
    • Background image (aspect-preserving cover fit, clipped to client)
    • Gradient overlay via GradientPaintDC (two-color linear fill with alpha)
    • Text and caption rendering (horizontal or rotated)


Image handling
  • Loaded once at WM_CREATE using GDI+ (GdipCreateBitmapFromFile).
  • Auto-fit logic computes the largest uniform scale to cover the client area while preserving aspect ratio.
  • Clipping handled with IntersectClipRect.
  • The image alpha channel is applied dynamically with GdipApplyImageAlpha(img, imgAlpha).


Alpha control
  • WM_MOUSEWHEEL adjusts imgAlpha with a base step of 8, automatically scaled for faster wheel spins (up to 64).
  • Alpha change triggers a re-composite via InvalidateRect (no erase).


Gradient overlay
  • Implemented by GradientPaintDC.
  • Simple two-color linear gradient (ARGB start → end), angle-based, with full opacity control.
  • Blended using SourceOver compositing on top of the image background.


Text engine
  • Uses custom DrawStringFormatedEx and BlurTextPlus for precise GDI+ text layout.
  • Supports three orientations: horizontal, bottom-up, and top-down.
  • Centered rotation around the text bounding box, with automatic clipping and no duplication artifacts.
  • Anti-aliased text rendering via TextRenderingHintAntiAlias.
  • Optional soft shadow or blur behind text.


Font management
  • Uses GDI+ Private Font Collection API (GdipPrivateAddFontFile / GdipPrivateAddMemoryFont).
  • Fonts are loaded dynamically, kept in memory only while needed ("use-and-forget").
  • Supports multiple concurrent fonts without leaks or persistent registry installs.


DPI awareness
  • Fully Per-Monitor-V2 compliant; no manifest required.
  • Enabled through direct calls to SetProcessDpiAwarenessContext and SetThreadDpiAwarenessContext.
  • Scale factor (dpi_scale) computed from GetDpiForSystem or GetDpiForWindow as fallback.


Window behavior
  • Maximize handling: the window is temporarily moved off-viewport (y = -5000) during SC_MAXIMIZE to suppress DWM transition flashes, then restored normally on SIZE_RESTORED.
  • Rounded corners: replaced the default Windows 11 exaggeration with a small, uniform radius using a custom region.
  • Caption bar: custom draw with adaptive color — black for dark theme, light for bright.
  • Theme changes: WM_SETTINGCHANGE updates caption and text colors automatically.


Performance & build
  • Compiled with Visual Studio 2022 /MT.
  • Linked with TClib.lib for minimal runtime footprint.
  • Final binary: approximately 24 KB stand-alone executable.
  • No heap allocations during painting (only during initialization).
  • Compatible with Windows 10 and 11, both light and dark modes.


  • The full VS2022 C/C++ 64-bit project is attached to this post.
2
FFcapture / FFcapture C++ version 3.00
« Last post by Patrice Terrier on October 25, 2025, 11:30:20 am »
FFcapture v3.00 — Release Candidate

Headline

New in 3.00: record a specific window or the full desktop with DPI-accurate coordinates.


How it works

During recording, the FFcapture window is minimized (iconized), so it never appears in the video.

Restoring FFcapture from the taskbar stops recording (clean Ctrl+Break handling preserved).


Other notes

Real-time capture stays on MP4 (x264) for zero dropped frames; .webm is available as a post-conversion step.

DPI helpers ensure correct sizing on high-DPI/multi-monitor setups.

Smaller binary size (French localization removed).


The full VS2022 C/C++ 64-bit project is attached to this post.
3
64-bit SDK programming / zTrace version 3.02 (DPI aware)
« Last post by Patrice Terrier on September 27, 2025, 07:36:27 pm »
Since I have a new laptop with a 2560x1600 resolution, I am slowly converting my utilities to become DPI aware.

The latest zTrace.dll version 3.02 is attached to this post, with full C/C++ VS 2022 source code.
The resulting DLL binary size is only 12 Kb.
4
Get ObjReader & Documentation / About OR Version 4.02
« Last post by Patrice Terrier on September 24, 2025, 03:39:47 pm »
ObjReader v4.02 released

New material directives, improved navigation, and multiple refinements to both the UI and the .orb workflow.
Make sure to use "File" -> "Load model..." and select the demo project to see the new features in context.

New in version 4.02:
  • Auto sync detection adjustment for audio-driven animations.
  • New directives: #inflate and #autorotate.
  • Zoom inertia to complement LMB orbit & RMB pan inertia.
  • Better keyboard handling for plus/minus keys when adjusting rotation speed.
  • .ORB improvements: higher compression + auto-refresh on .mtl changes.
  • UI/UX: new Save screenshot icon, polished toast animation, cleaner wireframe overlay, fixed list view scrollbar at first display.
  • Both orbtool and ORDLL64.dll updated in sync with OR v4.02.

See on top of this thread for new attachments.
5
Get ObjReader & Documentation / ORV_64 Version 3.20 - the .ORB challenge
« Last post by Patrice Terrier on August 26, 2025, 12:23:06 pm »
About ORV_64 v3.20
(sample app for embedding ObjReader via ORDLL64.dll.)



What it is
ORV_64 is a complete C/C++ (VS2022, x64) example that hosts the ObjReader engine through ORDLL64.dll.
The DLL exposes a focused C API, just enough to create a viewer window, load a model, animate it, and query stats.
So you can render ObjReader content inside your own application UI.

What ORDLL64.dll is
  • The embeddable runtime of ObjReader (Win64).
  • Owns the renderer, model loading (.orb, .obj/.mtl), animation timer, and optional audio sync.
  • You supply the top-level window and message loop; the DLL creates and manages its child viewport.

Why v3.10 matters,  native .ORB compatibility
  • Cuts startup time (no text parsing/reindexing).
  • Reduces disk size for large meshes.
  • Simplifies packaging: ship model.orb + textures in the same folder.
Your code can prefer .orb and automatically fall back to .obj when needed.

Typical integration flow
  • Create your main window (CreateWindowExW).
  • Call OR_CreateWindow(...) to create the viewer child HWND.
  • (Optional) OR_SetSwapInterval(TRUE) for V-sync, OR_TimerEnable(TRUE) to animate.
  • Load a file via:
Code: [Select]
OR_ProcessCommandLine(L"path\\to\\model.orb");
  • On WM_SIZE, resize the child window.
  • Populate your UI with getters (OR_Vertices(), OR_Triangles(), …).
  • Offer controls: OR_ViewReset(), OR_Get/SetAudioVolume(), OR_Screen_Shot().
  • On exit, call OR_CloseAll().
API at a glance (what you’ll actually use)
  • Create/host: OR_CreateWindow, OR_CloseAll
  • Open model: OR_ProcessCommandLine (accepts .orb and .obj)
  • Animation & timing: OR_TimerEnable, OR_GetAniTick
  • Display options: OR_SetSwapInterval, OR_ViewReset, OR_Screen_Shot
  • Info for UI:
    • OR_Version, OR_ObjFileName
    • OR_Vertices, OR_Triangles, OR_Indices
    • OR_Meshes, OR_Materials, OR_ObjSize, OR_LoadTime
    • OR_DetectGPU, OR_GPUinfo, OR_GPU, OR_CPU
  • Audio: OR_GetAudioVolume, OR_SetAudioVolume
Attachment
  • ORV_64 Version 3.20, is attached to this post.
6
Get ObjReader & Documentation / ObjReader 4.00+ - the .ORB challenge
« Last post by Patrice Terrier on August 25, 2025, 12:18:51 pm »
ObjReader 4.00+ - the .ORB challenge

New in version 4.00:

TL;DR: A compact binary format for Wavefront models that loads faster, takes less disk space, needs no extra DLLs, and stays fully compatible with OBJ/MTL.

What is .ORB?
.ORB = ObjReader Binary. It’s a compound file format for ObjReader that preserves Wavefront OBJ/MTL compatibility while dramatically reducing size and load time.

File layout
  • PNG thumbnail — preview of the model (visible in Windows Explorer thumbnail view).
  • Header — a small block storing internal offsets to each data section.
  • Compressed geometry — mesh data matching the source Wavefront OBJ.
  • Compressed MTL trailer — verbatim copy of the original .mtl file, stored at the end.
Compression: to avoid extra dependencies, .orb uses Windows’ built-in LZNT1 (NTDLL, LZ77-based). No external DLL required.

Explorer thumbnail

The thumbnail embedded in a [.orb] file is created the first time you open the model in ObjReader.
ObjReader renders the current viewport with its OpenGL pipeline (gl_DrawScene) and stores that live capture as the file’s preview.

What it reflects:
  • Geometry, materials, and textures actually loaded
  • Camera position and FOV
  • Active lighting preset and background
  • The model’s current pose/orientation
Why it matters: it lets you recognize models at a glance in Explorer and file pickers. The thumbnail is only a preview—it does not affect the model data.

Integration
  • File association: .orb is registered to launch ObjReader directly from Explorer.
  • ObjReader 4.00 size: the new executable is 14 KB smaller than v3.00+, thanks to aggressive code optimization and compiler settings.
  • ORDLL64 / ORV64: ORV64 and ORDLL64.dll are updated to understand .orb directly; ORV64 can open .orb even if no .mtl is present on disk.
Round-trip compatibility
  • Export from .ORB: ObjReader adds a menu option: File ? Export .ORB to .MTL/.OBJ.
  • Console tool: orbtool.exe provides standalone compile/decompile:
Compile  (OBJ ? ORB): orbtool -c <input.obj> -o <output.orb>
Decompile(ORB ? OBJ): orbtool -x <input.orb> -o <outputBase>
     (produces <outputBase>.obj and <outputBase>.mtl)


Why this is good
  • Smaller files on disk.
  • Faster loads in memory.
  • No extra runtime dependencies (uses Windows’ own LZNT1).
  • Still Wavefront-compatible (verbatim .mtl preserved; lossless geometry).
Overall performance
  • Disk space: ~50% of the original OBJ/MTL size (typical).
  • Loading speed: Up to 10× faster on large models (no text parsing; contiguous, precompiled geometry).
...
New in version 4.01:
  • Complete VS2022 source code (for posterity).
  • Further code reduction (binary now ~478 KB).
  • Menu simplification (removed unused features).
  • New Orbit & Pan inertia (toggle in Animation → Camera inertia (Orbit & Pan)).
  • Mesh info tips totally reworked to resolve conflicts when Use popup tips is enabled.

New in version 4.02:
  • Auto sync detection adjustment for improved audio-driven animation stability.
  • New #inflate directive (expand/deflate geometry along normals).
  • New #autorotate directive (automatic rotation with configurable axis & speed).
  • Zoom inertia added to complement LMB orbit & RMB pan inertia.
  • Better keyboard handling for +/- rotation speed adjustment.
  • Higher-ratio compression when building .orb files.
  • Smarter .mtl change detection to auto-refresh the .orb when materials are updated.
  • New Save screenshot UI icon for one-click snapshot capture.
  • Wireframe overlay cleanup (crisper edges, skips transparent meshes).
  • Toast animation polish for smoother transitions.
  • List view horizontal scrollbar no longer shown at first display (fixed).
  • Both orbtool and ORDLL64.dll reworked to stay in sync with OR v4.02.

...
Attachments
  • ObjReader Version 4.02, is attached to this post.
  • Orbtool console utility, is attached to this post.
7
Get ObjReader & Documentation / Version 4.00 is around the corner
« Last post by Patrice Terrier on August 12, 2025, 10:16:34 pm »
Version 4.00 is around the corner


New in 4.00: ObjReader now creates and uses the .ORB format.

📦 What is .ORB?
The “B” stands for Binary
.ORB is a compiled, binary version of a Wavefront .OBJ (and its .MTL), built on the fly by ObjReader. 
Reloads are near-instant because text parsing is no longer needed.

✨ Highlights
  • First-ever .ORB support — automatic compile from .OBJ/.MTL to a single binary file.
  • Explorer integration
       
    • .ORB is associated with ObjReader — double-click filename.orb in Explorer to launch ObjReader.exe.
         
    • Embedded PNG thumbnail — Explorer shows a preview thumbnail directly from the .ORB.
         
  • Fast loading — geometry, attributes, and materials are prepackaged for immediate use.
  • Material preservation — original .MTL references are retained and restored.
  • Robustness — safer handling for edge-case OBJ/MTL inputs.
8
Eye Candies / Re: Of The Bay (version 3.00)
« Last post by Patrice Terrier on July 29, 2025, 07:51:22 pm »
OfTheBay (OTB) – A modern FreeBASIC desktop dock bar



"OfTheBay" (OTB) is a lightweight, high-performance dock bar launcher developed in FreeBASIC 64-bit Unicode
It creates a visually appealing Mac-style dock along the bottom of the screen using layered windows and smooth GDI+ rendering.

Key features:
  • Fully skinned dock bar with per-pixel alpha blending (PNG + GDI+)
  • Supports both desktop shortcuts and taskbar-pinned entries
  • Pinned shortcuts are marked with a small overlay icon ("Pin.png") at top-left
  • Shortcuts automatically loaded from:
   - Desktop (Admin + Public)
   - Taskbar pinned folder (%APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar)
  • Dynamic sizing and layout based on number of entries
  • Right-click anywhere on the dock to show the contextual popup menu
  • Can optionally hide desktop shortcut icons for a cleaner workspace
  • Automatic icon extraction from ".lnk", ".url", ".exe" targets
  • Fallback to custom icons when extraction fails (e.g. "Unknown.png")
  • Fast runtime execution with no dependencies beyond GDI+ and shell APIs
  • Final EXE size: ~140 KB (without UPX), under 60 KB with TCLib for the C/C++ version

Technical highlights:
  • Written entirely in procedural FreeBASIC (no classes, no external DLLs)
  • Shell integration via IShellLinkW and SHGetPathFromIDList
  • Support for ".lnk", ".url", and ".exe" entries using direct file scanning
  • Optional pin overlay uses "Pin.png" drawn over "UseFrame.png" on pinned entries
  • All rendering uses GDI+ with premultiplied alpha and layered window styles
  • Memory-efficient: dynamically manages all icon resources and bitmap handles
  • Clean startup/shutdown sequence, fully integrated with Windows environment

Usage tips:
  • Hover over icons to see labels and activate zoom animation
  • Click to launch
  • Right-click to open the context menu with OTB commands
  • To clean up your desktop, just enable "Hide Desktop Shortcuts" from the menu

Built and tested on: Windows 10 and Windows 11 (64-bit)

Made with ❤️ using FreeBASIC and native Windows API.

Demo and source code will be shared soon.
9
Eye Candies / Of The Bay (version 4.00)
« Last post by Patrice Terrier on July 25, 2025, 01:57:36 pm »
Andrey,

I have converted OfTheBay to work with VS2022, and TCLib.lib.

And now the binary size is only 47 Kb!
10
64-bit SDK programming / Re: APNG Viewer
« Last post by Patrice Terrier on July 24, 2025, 02:22:51 pm »
The project has been updated to link with TCLib.lib to reduce the size of the binary EXE down to 13 Kb, including the icon!

The FreeBasic 64-bit version is here.
Pages: [1] 2 3 ... 10