Skip to content

RagingRedRiot/windows-cpl-experiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust_cpl

A proof-of-concept Windows Control Panel Applet (.cpl) written in Rust, built without any helper libraries — just the windows crate and the raw Win32 CPL interface.

Purpose

This was a learning exercise to answer the question: what does it actually take to implement a Windows Control Panel applet in Rust from scratch?

It covers:

  • Building a cdylib that control.exe can load as a .cpl file
  • Implementing the CPlApplet exported entry point and handling CPL messages
  • Embedding Windows resources (icon, string table) using winres and a .rc file

How CPL applets work

A .cpl file is a renamed DLL that exports a single function, CPlApplet. Windows' control.exe loads it and drives it via message passing:

Message Purpose
CPL_INIT Applet loaded; return nonzero to signal success
CPL_GETCOUNT Return the number of applets this DLL provides
CPL_INQUIRE Fill a CPLINFO struct with icon/name/description resource IDs
CPL_DBLCLK User double-clicked the applet
CPL_STOP / CPL_EXIT Control Panel is closing

Building

Requires a Windows target and the MSVC toolchain:

cargo build --target x86_64-pc-windows-msvc

Rename the output .dll to .cpl and drop it into C:\Windows\System32, or invoke it directly:

control.exe path\to\rust_cpl.cpl

About

Proof-of-concept Windows Control Panel Applet (.cpl) written in Rust using the raw Win32 CPL interface

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages