└── README.md /README.md: -------------------------------------------------------------------------------- 1 | ![Last Sync](https://img.shields.io/badge/Last_Sync-February_17,_2024-brightgreen) 2 | 3 | # The Old New Win32API 4 | 5 | This page provides a list of links to subset of posts of Raymond Chen's famous 6 | blog **[The Old New Thing](https://devblogs.microsoft.com/oldnewthing/)**. The 7 | subset is limited mainly to Win32API and some COM-related stuff. 8 | 9 | The reason why I maintain this page is that it often provides information which 10 | is missing on MSDN or which is described there in a cryptic way, and also 11 | because the blog is not easily searchable. 12 | 13 | The links here are categorized by their topic instead of a chronological order. 14 | Sometimes, when appropriate, a single post may be put into multiple categories. 15 | 16 | In some (quite rare) cases, links to other sources are included if they are 17 | found useful. 18 | 19 | **Disclaimer:** I am not claiming authorship of any linked contents. This is 20 | only about hopefully useful organization of the great articles Raymond has 21 | written over the years. 22 | 23 | 24 | ## Table of Contents 25 | 26 | * [Processes and Threads](#processes-and-threads) 27 | * [Processes](#processes) 28 | * [Threads](#threads) 29 | * [Thread Pools](#thread-pools) 30 | * [Thread Affinity of Objects](#thread-affinity-of-objects) 31 | * [Thread Stack](#thread-stack) 32 | * [Fibers](#fibers) 33 | * [Synchronization](#synchronization) 34 | * [`WaitOnAddress()`](#waitonaddress) 35 | * [`WaitForMultipleObjects()` and Relatives](#waitformultipleobjects-and-relatives) 36 | * [Lock-Free Patterns](#lock-free-patterns) 37 | * [DLLs](#dlls) 38 | * [`DllMain()`](#dllmain) 39 | * [Resources](#resources) 40 | * [Bitmap and Icon Resources](#bitmap-and-icon-resources) 41 | * [Dialog Templates](#dialog-templates) 42 | * [Menu Templates and Accelerator Resources](#menu-templates-and-accelerator-resources) 43 | * [String Resources](#string-resources) 44 | * [Version Templates](#version-templates) 45 | * [Data and Custom Resources](#data-and-custom-resources) 46 | * [Application (as a whole)](#application-as-a-whole) 47 | * [Command Line](#command-line) 48 | * [Taskbar](#taskbar) 49 | * [`HWND` (General Point of View)](#hwnd-general-point-of-view) 50 | * [Windows Hierarchy](#windows-hierarchy) 51 | * [Window Styles](#window-styles) 52 | * [Window Classes](#window-classes) 53 | * [Top-Level Windows](#top-level-windows) 54 | * [Window Frame and Caption](#window-frame-and-caption) 55 | * [DWM](#dwm) 56 | * [Dialogs](#dialogs) 57 | * [Nested and Embedded Dialogs](#nested-and-embedded-dialogs) 58 | * [Common Dialogs](#common-dialogs) 59 | * [Control Navigation](#control-navigation) 60 | * [Dialog Manager](#dialog-manager) 61 | * [Modality](#modality) 62 | * [Property Sheets](#property-sheets) 63 | * [Controls](#controls) 64 | * [Animation Controls](#animation-controls) 65 | * [Buttons](#buttons) 66 | * [Combo Boxes](#combo-boxes) 67 | * [Edit Controls](#edit-controls) 68 | * [List Views](#list-views) 69 | * [Rich Text Controls](#rich-text-controls) 70 | * [Scrollbars](#scrollbars) 71 | * [Static Controls](#static-controls) 72 | * [Toolbars](#toolbars) 73 | * [Tooltips](#tooltips) 74 | * [Trackbars](#trackbars) 75 | * [Tree List Views](#tree-list-views) 76 | * [Processing of Messages](#processing-of-messages) 77 | * [Hooking](#hooking) 78 | * [Specific Messages](#specific-messages) 79 | * [Notifications](#notifications) 80 | * [Window Construction and Destruction](#window-construction-and-destruction) 81 | * [Window Geometry Messages](#window-geometry-messages) 82 | * [Window Painting Messages](#window-painting-messages) 83 | * [Window Focus Messages](#window-focus-messages) 84 | * [Keyboard Messages](#keyboard-messages) 85 | * [Mouse Messages](#mouse-messages) 86 | * [Dialog Messages](#dialog-mesages) 87 | * [Other Window Messages](#other-window-messages) 88 | * [System Messages](#system-messages) 89 | * [GDI](#gdi) 90 | * [Cursors](#cursors) 91 | * [Brushes](#brushes) 92 | * [Pens](#pens) 93 | * [Bitmaps](#bitmaps) 94 | * [DIB](#dib) 95 | * [`LockWindowUpdate()`](#lockwindowupdate) 96 | * [Painting Standard Elements](#painting-standard-elements) 97 | * [`UXTHEME.DLL`](#uxthemedll) 98 | * [Multiple Monitors](#multiple-monitors) 99 | * [Accessibility](#accessibility) 100 | * [COM](#com) 101 | * [Declaring COM Interfaces](#declaring-com-interfaces) 102 | * [COM Apartments](#com-apartments) 103 | * [COM Initialization](#com-initialization) 104 | * [COM Static Store](#com-static-store) 105 | * [COM Marshaling](#com-marshaling) 106 | * [COM Error Handling](#com-error-handling) 107 | * [COM Asynchronous Interfaces](#com-asynchronous-interfaces) 108 | * [GUIDs](#guids) 109 | * [COM Strings](#com-strings) 110 | * [COM Variants](#com-variants) 111 | * [`IUnknown`](#iunknown) 112 | * [`IMoniker`](#imoniker) 113 | * [`ICallback`](#icallback) 114 | * [`IContextMenu`](#icontextmenu) 115 | * [`IFileDialog`](#ifiledialog) 116 | * [`IMultiLanguage`](#imultilanguage) 117 | * [`INamespaceWalk`](#inamespacewalk) 118 | * [`IStream`](#istream) 119 | * [`IVirtual­Desktop­Manager`](#ivirtual­desktop­manager) 120 | * [Clipboard](#clipboard) 121 | * [Drag and Drop](#drag-and-drop) 122 | * [Enumeration](#enumeration) 123 | * [Shell](#shell) 124 | * [Uncategorized COM Stuff](#uncategorized-com-stuff) 125 | * [Memory](#memory) 126 | * [Input and Output](#input-and-output) 127 | * [Asynchronous Input and Output](#asynchronous-input-and-output) 128 | * [Files and Directories](#files-and-directories) 129 | * [ACL](#acl) 130 | * [Security Permissions, Attributes and Identifiers](#security-permissions-attributes-and-identifiers) 131 | * [Registry](#registry) 132 | * [Strings and Locales](#strings-and-locales) 133 | * [NT Services](#nt-services) 134 | * [Uncategorized](#uncategorized) 135 | 136 | 137 | ## Processes and Threads 138 | 139 | ### Processes 140 | * [`CreateProcess` does not wait for the process to start](https://devblogs.microsoft.com/oldnewthing/20050119-00/?p=36663) 141 | * [Why does the `CreateProcess` function modify its input command line?](https://devblogs.microsoft.com/oldnewthing/20090601-00/?p=18083) 142 | * [Why do people take a lock around `CreateProcess` calls?](https://devblogs.microsoft.com/oldnewthing/20200306-00/?p=103538) 143 | * [Disabling the program crash dialog](https://devblogs.microsoft.com/oldnewthing/20040727-00/?p=38323) 144 | * [How do I pass a lot of data to a process when it starts up?](https://devblogs.microsoft.com/oldnewthing/20031211-00/?p=41543) 145 | * [What was the purpose of the `hPrevInstance` parameter to `WinMain`?](https://devblogs.microsoft.com/oldnewthing/20040615-00/?p=38873) 146 | * [Is `RunAsInvoker` a secret, even higher UAC setting?](https://devblogs.microsoft.com/oldnewthing/20161117-00/?p=94735) 147 | * [How do I prevent a child process from displaying the Windows Error Reporting dialog?](https://devblogs.microsoft.com/oldnewthing/20160204-00/?p=92972) 148 | * [How is it that `WriteProcessMemory` succeeds in writing to read-only memory?](https://devblogs.microsoft.com/oldnewthing/?p=100415) 149 | * [Is it a good idea to let `WriteProcessMemory` manage the page protection for me?](https://devblogs.microsoft.com/oldnewthing/20190729-00/?p=102737) 150 | * [How can I launch an unelevated process from my elevated process, redux](https://devblogs.microsoft.com/oldnewthing/20190425-00/?p=102443) 151 | * [How can I check the integrity level of my process?](https://devblogs.microsoft.com/oldnewthing/20221017-00/?p=107291) 152 | * [Is it true that raising a structured exception from a structured exception handler terminates the process?](https://devblogs.microsoft.com/oldnewthing/20221020-00/?p=107303) 153 | * [A more direct and mistake-free way of creating a process in a job object](https://devblogs.microsoft.com/oldnewthing/20230209-00/?p=107812) 154 | 155 | ### Threads 156 | * [Invalid thread and process IDs](https://devblogs.microsoft.com/oldnewthing/20040223-00/?p=40503) 157 | * [Why does my thread handle suddenly go bad? All I did was wait on it!](https://devblogs.microsoft.com/oldnewthing/20170929-00/?p=97115) 158 | * [What happens if you simply return from the thread callback passed to `_beginthread` and `_beginthreadex`?](https://devblogs.microsoft.com/oldnewthing/20171115-00/?p=97405) 159 | * [Why you should never suspend a thread](https://devblogs.microsoft.com/oldnewthing/20031209-00/?p=41573) 160 | * [The dangers of sleeping on a UI thread](https://devblogs.microsoft.com/oldnewthing/20060210-00/?p=32323) 161 | * [In pursuit of the message queue](https://devblogs.microsoft.com/oldnewthing/20060221-09/?p=32203) 162 | * [Enumerating threads in a process](https://devblogs.microsoft.com/oldnewthing/20060223-14/?p=32173) 163 | * [Win32 user interface work is inherently single-threaded](https://devblogs.microsoft.com/oldnewthing/20071018-00/?p=24743) 164 | * [How bad is it to delay closing a thread handle for a long time after the thread has exited?](https://devblogs.microsoft.com/oldnewthing/20161215-00/?p=94945) 165 | * [If I call `GetExitCodeThread` for a thread that I know for sure has exited, why does it still say `STILL_ACTIVE`?](https://devblogs.microsoft.com/oldnewthing/20180302-00/?p=98145) 166 | * [Is there a problem with `Create­Remote­Thread` on 64-bit systems?](https://devblogs.microsoft.com/oldnewthing/20180615-00/?p=99025) 167 | * [Is the `Terminate­Thread` function synchronous?](https://devblogs.microsoft.com/oldnewthing/20180727-00/?p=99355) 168 | * [Removing the `Terminate­Thread` from code that waits for a job object to empty](https://devblogs.microsoft.com/oldnewthing/20180831-00/?p=99625) 169 | * [What is the point of `FreeLibraryAndExitThread`?](https://devblogs.microsoft.com/oldnewthing/20131105-00/?p=2733) 170 | * [What happens if I give contradictory values for the stack commit and stack reserve?](https://devblogs.microsoft.com/oldnewthing/20210107-00/?p=104680) 171 | 172 | ### Thread Pools 173 | * [What exactly does the `msWindowLength` parameter to `SetThreadpoolTimer` mean?](https://devblogs.microsoft.com/oldnewthing/20160914-00/?p=94315) 174 | * [What’s the difference between `CreateTimerQueueTimer` and `SetThreadpoolTimer`?](https://devblogs.microsoft.com/oldnewthing/20180308-00/?p=98185) 175 | * [How to avoid accessing freed memory when canceling a thread pool callback](https://devblogs.microsoft.com/oldnewthing/20180502-00/?p=98655) 176 | * [Avoiding deadlocks when cancelling a thread pool callback, part 1: External callback data](https://devblogs.microsoft.com/oldnewthing/20180503-00/?p=98665) 177 | * [Avoiding deadlocks when cancelling a thread pool callback, part 2: Referring back to the containing object](https://devblogs.microsoft.com/oldnewthing/20180504-00/?p=98675) 178 | * [Gotcha: A threadpool periodic timer will not wait for the previous tick to complete](https://devblogs.microsoft.com/oldnewthing/20200217-00/?p=103441) 179 | * [Why am I getting an exception from the thread pool during process shutdown?](https://devblogs.microsoft.com/oldnewthing/20200130-00/?p=103385) 180 | * [What happens to the value returned from the function passed to `Queue­User­Work­Item`?](https://devblogs.microsoft.com/oldnewthing/20210121-00/?p=104746) 181 | * [The mental model for `StartThreadpoolIo`](https://devblogs.microsoft.com/oldnewthing/20211117-00/?p=105933) 182 | * [How can I detect that a thread pool work item is taking too long?](https://devblogs.microsoft.com/oldnewthing/20220110-00/?p=106139) 183 | * [How can I close a thread pool and cancel all work that had been queued to it?](https://devblogs.microsoft.com/oldnewthing/20240205-00/?p=109360) 184 | 185 | 186 | ### Thread Affinity of Objects 187 | * [Thread affinity of user interface objects, part 1: Window handles](https://devblogs.microsoft.com/oldnewthing/20051010-09/?p=33843) 188 | * [Thread affinity of user interface objects, part 2: Device contexts](https://devblogs.microsoft.com/oldnewthing/20051011-10/?p=33823) 189 | * [Thread affinity of user interface objects, part 3: Menus, icons, cursors, and accelerator tables](https://devblogs.microsoft.com/oldnewthing/20051012-00/?p=33803) 190 | * [Thread affinity of user interface objects, part 4: GDI objects and other notes on affinity](https://devblogs.microsoft.com/oldnewthing/20051013-11/?p=33783) 191 | * [Thread affinity of user interface objects, part 5: Object clean-up](https://devblogs.microsoft.com/oldnewthing/20051014-19/?p=33763) 192 | * [Thread affinity of user interface objects: Addendum](https://devblogs.microsoft.com/oldnewthing/20121109-00/?p=6133) 193 | 194 | ### Thread Stack 195 | * [How can I expand my thread’s stack at runtime?](https://devblogs.microsoft.com/oldnewthing/20200601-00/?p=103815) 196 | * [Using fibers to expand a thread’s stack at runtime, part 1](https://devblogs.microsoft.com/oldnewthing/20200602-00/?p=103819) 197 | * [Using fibers to expand a thread’s stack at runtime, part 2](https://devblogs.microsoft.com/oldnewthing/20200603-00/?p=103824) 198 | * [Using fibers to expand a thread’s stack at runtime, part 3](https://devblogs.microsoft.com/oldnewthing/20200604-00/?p=103833) 199 | * [Using fibers to expand a thread’s stack at runtime, part 4](https://devblogs.microsoft.com/oldnewthing/20200605-00/?p=103840) 200 | * [Using fibers to expand a thread’s stack at runtime, part 5](https://devblogs.microsoft.com/oldnewthing/20200611-00/?p=103858) 201 | * [Using fibers to expand a thread’s stack at runtime, part 6](https://devblogs.microsoft.com/oldnewthing/20200612-00/?p=103865) 202 | * [Comparing fibers to threads for the purpose of expanding a thread’s stack at runtime](https://devblogs.microsoft.com/oldnewthing/20200608-00/?p=103844) 203 | * [Determining approximately how much stack space is available, part 1](https://devblogs.microsoft.com/oldnewthing/20200609-00/?p=103847) 204 | * [Determining approximately how much stack space is available, part 2](https://devblogs.microsoft.com/oldnewthing/20200610-00/?p=103855) 205 | 206 | ### Fibers 207 | * [What happens to the fibers which ran on a thread when the thread exits?](https://devblogs.microsoft.com/oldnewthing/20100225-00/?p=14813) 208 | * [It's fine to use fibers, but everybody has to be on board with the plan](https://devblogs.microsoft.com/oldnewthing/20100226-00/?p=14793) 209 | * [Fibers aren’t useful for much any more; there’s just one corner of it that remains useful for a reason unrelated to fibers](https://devblogs.microsoft.com/oldnewthing/20191011-00/?p=102989) 210 | 211 | 212 | ## Synchronization 213 | 214 | * [Understanding the consequences of `WAIT_ABANDONED`](https://devblogs.microsoft.com/oldnewthing/20050912-14/?p=34253) 215 | * [Windows keyed events, critical sections, and new Vista synchronization features](http://joeduffyblog.com/2006/11/28/windows-keyed-events-critical-sections-and-new-vista-synchronization-features/) 216 | * [Combining the work queue of distinct events, order not important, with an auto-reset event](https://devblogs.microsoft.com/oldnewthing/20170616-00/?p=96405) 217 | * [How fair are SRW locks, particularly when there are both readers and writers?](https://devblogs.microsoft.com/oldnewthing/20170705-00/?p=96535) 218 | * [You can use a file as a synchronization object, too](https://devblogs.microsoft.com/oldnewthing/20140905-00/?p=63) 219 | * [Can I wait for a kernel event to become *unsignaled*?](https://devblogs.microsoft.com/oldnewthing/20200305-00/?p=103535) 220 | * [If the slim reader/writer lock (`SRWLOCK`) doesn’t remember who the shared lock owner is, does that mean it’s okay to acquire it recursively?](https://devblogs.microsoft.com/oldnewthing/20220304-00/?p=106309) 221 | 222 | ### `WaitOnAddress()` 223 | * [`WaitOnAddress` lets you create a synchronization object out of any data variable, even a byte](https://devblogs.microsoft.com/oldnewthing/20160823-00/?p=94145) 224 | * [Implementing a synchronization barrier in terms of `WaitOnAddress`](https://devblogs.microsoft.com/oldnewthing/20160824-00/?p=94155) 225 | * [Implementing a critical section in terms of `WaitOnAddress`](https://devblogs.microsoft.com/oldnewthing/20160825-00/?p=94165) 226 | * [Extending our critical section based on `WaitOnAddress` to support timeouts](https://devblogs.microsoft.com/oldnewthing/20170531-00/?p=96255) 227 | * [Comparing `WaitOnAddress` with futexes (futexi? futexen?)](https://devblogs.microsoft.com/oldnewthing/20170601-00/?p=96265) 228 | * [Creating a semaphore from `WaitOnAddress`](https://devblogs.microsoft.com/oldnewthing/20170612-00/?p=96375) 229 | * [Creating a semaphore with a maximum count from `WaitOnAddress`](https://devblogs.microsoft.com/oldnewthing/20170613-00/?p=96385) 230 | * [Creating a manual-reset event from `WaitOnAddress`](https://devblogs.microsoft.com/oldnewthing/20170614-00/?p=96395) 231 | * [Creating an automatic-reset event from `WaitOnAddress`](https://devblogs.microsoft.com/oldnewthing/20170615-00/?p=96396) 232 | 233 | ### `WaitForMultipleObjects()` and Relatives 234 | 235 | * [`MsgWaitForMultipleObjects` and the queue state](https://devblogs.microsoft.com/oldnewthing/20050217-00/?p=36423) 236 | * [You can call `MsgWaitForMultipleObjects` with zero handles](https://devblogs.microsoft.com/oldnewthing/20060125-18/?p=32533) 237 | * [Pumping messages while waiting for a period of time](https://devblogs.microsoft.com/oldnewthing/20060126-00/?p=32513) 238 | * [Waiting for all handles with `MsgWaitForMultipleObjects` is a bug waiting to happen](https://devblogs.microsoft.com/oldnewthing/20060127-17/?p=32493) 239 | * [Why does `WaitForMultipleObjects` return `ERROR_INVALID_PARAMETER` when all the parameters look valid to me?](https://devblogs.microsoft.com/oldnewthing/20110225-00/?p=11383) 240 | * [If more than one object causes a `WaitForMultipleObjects` to return, how do I find out about the other ones?](https://devblogs.microsoft.com/oldnewthing/20150409-00/?p=44273) 241 | * [What’s the point of passing a never-signaled event to `MsgWaitForMultipleObjects`?](https://devblogs.microsoft.com/oldnewthing/20181114-00/?p=100215) 242 | 243 | ### Lock-Free Patterns 244 | * [Lock free many-producer/single-consumer patterns: A work queue with task coalescing](https://devblogs.microsoft.com/oldnewthing/20161121-00/?p=94755) 245 | * [Lock free many-producer/single-consumer patterns: A work queue where the last one wins](https://devblogs.microsoft.com/oldnewthing/20161122-00/?p=94765) 246 | * [Lock free many-producer/single-consumer patterns: A work queue of identical non-coalescable events](https://devblogs.microsoft.com/oldnewthing/20161123-00/?p=94766) 247 | * [Lock free many-producer/single-consumer patterns: A work queue of distinct events, order not important](https://devblogs.microsoft.com/oldnewthing/20161124-00/?p=94775) 248 | * [Lock free many-producer/single-consumer patterns: A work queue of distinct events, FIFO](https://devblogs.microsoft.com/oldnewthing/20161125-00/?p=94795) 249 | * [Lock free many-producer/single-consumer patterns: A work queue of distinct events, order not important, follow-up question](https://devblogs.microsoft.com/oldnewthing/20180627-00/?p=99105) 250 | 251 | 252 | ## DLLs 253 | 254 | * [Don't trust the return address](https://devblogs.microsoft.com/oldnewthing/20040101-00/?p=41223) 255 | * [Why can't I `GetProcAddress` a function I dllexport'ed?](https://devblogs.microsoft.com/oldnewthing/20040112-00/?p=41083) 256 | * [What is the difference between `HINSTANCE` and `HMODULE`?](https://devblogs.microsoft.com/oldnewthing/20040614-00/?p=38903) 257 | * [Accessing the current module's `HINSTANCE` from a static library](https://devblogs.microsoft.com/oldnewthing/20041025-00/?p=37483) 258 | * [`LoadLibraryEx(DONT_RESOLVE_DLL_REFERENCES)` is fundamentally flawed](https://devblogs.microsoft.com/oldnewthing/20050214-00/?p=36463) 259 | * [Why are DLLs unloaded in the "wrong" order?](https://devblogs.microsoft.com/oldnewthing/20050523-05/?p=35573) 260 | * [How are DLL functions exported in 32-bit Windows?](https://devblogs.microsoft.com/oldnewthing/20060718-32/?p=30483) 261 | * [Exported functions that are really forwarders](https://devblogs.microsoft.com/oldnewthing/?p=30473) 262 | * [Rethinking the way DLL exports are resolved for 32-bit Windows](https://devblogs.microsoft.com/oldnewthing/20060720-20/?p=30453) 263 | * [Names in the import library are decorated for a reason](https://devblogs.microsoft.com/oldnewthing/20060727-00/?p=30343) 264 | * [What happens when you get dllimport wrong?](https://devblogs.microsoft.com/oldnewthing/20060726-00/?p=30363) 265 | * [Issues related to forcing a stub to be created for an imported function](https://devblogs.microsoft.com/oldnewthing/20060725-00/?p=30383) 266 | * [Allocating and freeing memory across module boundaries](https://devblogs.microsoft.com/oldnewthing/20060915-04/?p=29723) 267 | * [DLL forwarding is not the same as delay-loading](https://devblogs.microsoft.com/oldnewthing/20080204-00/?p=23593) 268 | * [What is DLL import hinting?](https://devblogs.microsoft.com/oldnewthing/20100317-00/?p=14573) 269 | * [What is DLL import binding?](https://devblogs.microsoft.com/oldnewthing/20100318-00/?p=14563) 270 | * [What is the point of `FreeLibraryAndExitThread`?](https://devblogs.microsoft.com/oldnewthing/20131105-00/?p=2733) 271 | * [A library loaded via `LOAD_LIBRARY_AS_DATAFILE` (or similar flags) doesn't get to play in any reindeer module games](https://devblogs.microsoft.com/oldnewthing/20141120-00/?p=43573) 272 | * [Could there be any problems with calling `GetModuleFileNameEx` on your own process?](https://devblogs.microsoft.com/oldnewthing/20160310-00/?p=93141) 273 | * [How can I specify that my DLL should resolve a DLL dependency from the same directory that the DLL is in?](https://devblogs.microsoft.com/oldnewthing/20171011-00/?p=97195) 274 | * [After I made my DLL delay-load another DLL, my DLL has started crashing in its process detach code](https://devblogs.microsoft.com/oldnewthing/20190718-00/?p=102719) 275 | * [The different kinds of DLL planting](https://devblogs.microsoft.com/oldnewthing/20191231-00/?p=103282) 276 | * [Why does `GetModuleInfo` fail to produce an entry point for executables?](https://devblogs.microsoft.com/oldnewthing/20211014-00/?p=105800) 277 | * [What does the `SizeOfImage` mean in the `MODULEINFO` structure?](https://devblogs.microsoft.com/oldnewthing/20211015-00/?p=105802) 278 | * [How do I suppress the error box that appears when a `LoadLibrary` fails?](https://devblogs.microsoft.com/oldnewthing/20240208-00/?p=109374) 279 | 280 | ### `DllMain()` 281 | * [Some reasons not to do anything scary in your `DllMain`](https://devblogs.microsoft.com/oldnewthing/20040127-00/?p=40873) 282 | * [Another reason not to do anything scary in your `DllMain`: Inadvertent deadlock](https://devblogs.microsoft.com/oldnewthing/20040128-00/?p=40853) 283 | * [Some reasons not to do anything scary in your `DllMain`, part 3](https://devblogs.microsoft.com/oldnewthing/20140821-00/?p=183) 284 | * [The thread that gets the `DLL_PROCESS_DETACH` notification is not necessarily the one that got the `DLL_PROCESS_ATTACH notification`](https://devblogs.microsoft.com/oldnewthing/20090626-00/?p=17733) 285 | * [How you might be loading a DLL during `DLL_PROCESS_DETACH` without even realizing it](https://devblogs.microsoft.com/oldnewthing/20100115-00/?p=15253) 286 | * [When `DLL_PROCESS_DETACH` tells you that the process is exiting, your best bet is just to return without doing anything](https://devblogs.microsoft.com/oldnewthing/20120105-00/?p=8683) 287 | 288 | 289 | ## Resources 290 | 291 | * [The Resource Compiler defaults to `CP_ACP`, even in the face of subtle hints that the file is UTF-8](https://devblogs.microsoft.com/oldnewthing/20190607-00/?p=102569) 292 | * [The relationship between module resources and resource-derived objects in 32-bit Windows](https://devblogs.microsoft.com/oldnewthing/20131003-00/?p=3043) 293 | * [What's the difference between `FreeResource` and, say, `DestroyAcceleratorTable`](https://devblogs.microsoft.com/oldnewthing/20110307-00/?p=11283) 294 | * [PE resources must be 4-byte aligned, but that doesn't stop people from trying other alignments](https://devblogs.microsoft.com/oldnewthing/20110609-00/?p=10463) 295 | * [How can I tell that somebody used the `MAKEINTRESOURCE` macro to smuggle an integer inside a pointer?](https://devblogs.microsoft.com/oldnewthing/20130925-00/?p=3123) 296 | * [Horrifically nasty gotcha: `FindResource` and `FindResourceEx`](https://devblogs.microsoft.com/oldnewthing/20150101-00/?p=43243) 297 | 298 | ### Bitmap and Icon Resources 299 | * [Why are device-independent bitmaps upside down?](https://devblogs.microsoft.com/oldnewthing/20210525-00/?p=105250) 300 | * [The format of bitmap resources](https://devblogs.microsoft.com/oldnewthing/20091211-00/?p=15693) 301 | * [The format of icon resources](https://devblogs.microsoft.com/oldnewthing/20120720-00/?p=7083) 302 | * [The format of icon resources, revisited](https://devblogs.microsoft.com/oldnewthing/20231025-00/?p=108925) 303 | * [The evolution of the ICO file format, part 1: Monochrome beginnings](https://devblogs.microsoft.com/oldnewthing/20101018-00/?p=12513) 304 | * [The evolution of the ICO file format, part 2: Now in color!](https://devblogs.microsoft.com/oldnewthing/20101019-00/?p=12503) 305 | * [The evolution of the ICO file format, part 3: Alpha-blended images](https://devblogs.microsoft.com/oldnewthing/20101021-00/?p=12483) 306 | * [The evolution of the ICO file format, part 4: PNG images](https://devblogs.microsoft.com/oldnewthing/20101022-00/?p=12473) 307 | * [How do I set the alpha channel of a GDI bitmap to 255?](https://devblogs.microsoft.com/oldnewthing/20210915-00/?p=105687) 308 | 309 | ### Message String Resources 310 | * [Why does `Format­Message` say that `%0` terminates the message without a trailing newline? Is it secretly adding newlines?](https://devblogs.microsoft.com/oldnewthing/20191025-00/?p=103025) 311 | 312 | ### Dialog Templates 313 | * [On the difficulty of getting pixel-perfect layout in Win32 dialog templates](https://devblogs.microsoft.com/oldnewthing/20180510-00/?p=98725) 314 | * [The evolution of dialog templates - 32-bit Classic Templates](https://devblogs.microsoft.com/oldnewthing/20040621-00/?p=38793) 315 | * [The evolution of dialog templates - 32-bit Extended Templates](https://devblogs.microsoft.com/oldnewthing/20040623-00/?p=38753) 316 | * [The evolution of dialog templates - Summary](https://devblogs.microsoft.com/oldnewthing/?p=38733) 317 | * [The resource compiler will helpfully add window styles for you, but if you're building a dialog template yourself, you don't get that help](https://devblogs.microsoft.com/oldnewthing/20121122-00/?p=6023) 318 | 319 | ### Menu Templates and Accelerator Resources 320 | * [The evolution of menu templates: Introduction](https://devblogs.microsoft.com/oldnewthing/20080708-00/?p=21713) 321 | * [The evolution of menu templates: 32-bit classic menus](https://devblogs.microsoft.com/oldnewthing/20080711-00/?p=21653) 322 | * [The evolution of menu templates: 32-bit extended menus](https://devblogs.microsoft.com/oldnewthing/20080716-00/?p=21603) 323 | * [The format of accelerator table resources](https://devblogs.microsoft.com/oldnewthing/20040130-00/?p=40813) 324 | 325 | ### String Resources 326 | * [The format of string resources](https://devblogs.microsoft.com/oldnewthing/20040130-00/?p=40813) 327 | * [`LoadString` can load strings with embedded nulls, but your wrapper function might not](https://devblogs.microsoft.com/oldnewthing/20091009-00/?p=16423) 328 | 329 | ### Version Templates 330 | * [The evolution of version resources - 32-bit version resources](https://devblogs.microsoft.com/oldnewthing/20061221-02/?p=28643) 331 | * [The evolution of version resources - corrupted 32-bit version resources](https://devblogs.microsoft.com/oldnewthing/20061222-00/?p=28623) 332 | 333 | ### Data and Custom Resources 334 | * [The format of data and custom resources](https://devblogs.microsoft.com/oldnewthing/20130828-00/?p=3383) 335 | 336 | 337 | ## Application (as a whole) 338 | 339 | * [Which windows appear in the `Alt+Tab` list?](https://devblogs.microsoft.com/oldnewthing/20071008-00/?p=24863) 340 | * [Windows Vista changed the `Alt+Tab` order slightly](https://devblogs.microsoft.com/oldnewthing/20080701-00/?p=21793) 341 | * [Win32 user interface work is inherently single-threaded](https://devblogs.microsoft.com/oldnewthing/20071018-00/?p=24743) 342 | * [When does `STARTF_USESHOWWINDOW` override the parameter passed to `ShowWindow`?](https://devblogs.microsoft.com/oldnewthing/20100301-00/?p=14773) 343 | * [`WaitForInputIdle` should really be called `WaitForProcessStartupComplete`](https://devblogs.microsoft.com/oldnewthing/20100325-00/?p=14493) 344 | * [`WaitForInputIdle` waits for any thread, which might not be the thread you care about](https://devblogs.microsoft.com/oldnewthing/20100326-00/?p=14483) 345 | * [What are the conventions for managing standard handles?](https://devblogs.microsoft.com/oldnewthing/20130307-00/?p=5033) 346 | * [Standard handles are really meant for single-threaded programs](https://devblogs.microsoft.com/oldnewthing/20141008-00/?p=43893) 347 | * [If only DLLs can get `DllMain` notifications, how can an EXE receive a notification when a thread is created (for example)?](https://devblogs.microsoft.com/oldnewthing/20141016-00/?p=43833) 348 | 349 | ### Command Line 350 | * [The first word on the command line is the program name only by convention](https://devblogs.microsoft.com/oldnewthing/20060515-07/?p=31203) 351 | * [How is the `CommandLineToArgvW` function intended to be used?](https://devblogs.microsoft.com/oldnewthing/20100916-00/?p=12843) 352 | * [What's up with the strange treatment of quotation marks and backslashes by `CommandLineToArgvW`](https://devblogs.microsoft.com/oldnewthing/20100917-00/?p=12833) 353 | 354 | ### Taskbar 355 | * [How do I prevent users from pinning my program to the taskbar?](https://devblogs.microsoft.com/oldnewthing/20110601-00/?p=10523) 356 | * [Instead of creating something and then trying to hide it, simply don't create it in the first place](https://devblogs.microsoft.com/oldnewthing/20120222-00/?p=8253) (tray icon) 357 | * [What if my application is really two applications bundled into a single file, and I want them collected into two groups on the taskbar in Windows 7?](https://devblogs.microsoft.com/oldnewthing/20120817-00/?p=6833) 358 | * [How do I customize how my application windows are grouped in the Taskbar?](https://devblogs.microsoft.com/oldnewthing/20120820-00/?p=6813) 359 | * [Display an overlay on the taskbar button](https://devblogs.microsoft.com/oldnewthing/20130211-00/?p=5283) 360 | * [Display control buttons on your taskbar preview window](https://devblogs.microsoft.com/oldnewthing/20130218-00/?p=5223) 361 | * [Display a custom thumbnail for your application (and while you're at it, a custom live preview)](https://devblogs.microsoft.com/oldnewthing/20130225-00/?p=5153) 362 | * [How can I query the location of the taskbar on secondary monitors?](https://devblogs.microsoft.com/oldnewthing/20141218-00/?p=43353) 363 | * [How did that program manage to pin itself to my taskbar when I installed it?](https://devblogs.microsoft.com/oldnewthing/20141230-00/?p=43273) 364 | * [What if I have two programs that are logically a single application, and I want them to be treated as a single group on the taskbar?](https://devblogs.microsoft.com/oldnewthing/20150810-00/?p=91141) 365 | * [Why does the taskbar icon for grouped windows change to something weird?](https://devblogs.microsoft.com/oldnewthing/20150812-00/?p=91831) 366 | 367 | 368 | ## `HWND` (General Point of View) 369 | 370 | * [What does it mean for a window to be Unicode?](https://devblogs.microsoft.com/oldnewthing/20180906-00/?p=99665) 371 | * [How can I get the actual window procedure address and not a thunk?](https://devblogs.microsoft.com/oldnewthing/20180720-00/?p=99295) 372 | * [What are these strange values returned from `GWLP_WNDPROC`?](https://devblogs.microsoft.com/oldnewthing/20031201-00/?p=41673) 373 | * [The bonus window bytes at `GWLP_USERDATA`](https://devblogs.microsoft.com/oldnewthing/20050303-00/?p=36293) 374 | * [What is the difference between `WM_DESTROY` and `WM_NCDESTROY`?](https://devblogs.microsoft.com/oldnewthing/20050726-00/?p=34803) 375 | * [Sending a window a `WM_DESTROY` message is like prank calling somebody pretending to be the police](https://devblogs.microsoft.com/oldnewthing/20110926-00/?p=9553) 376 | * [The secret life of `GetWindowText`](https://devblogs.microsoft.com/oldnewthing/20030821-00/?p=42833) 377 | * [Why are the rules for `GetWindowText` so weird?](https://devblogs.microsoft.com/oldnewthing/20030904-00/?p=42663) 378 | * [Painting only when your window is visible on the screen](https://devblogs.microsoft.com/oldnewthing/20030829-00/?p=42743) 379 | * [Determining whether your window is covered](https://devblogs.microsoft.com/oldnewthing/20030902-00/?p=42693) 380 | * [Obtaining a window's size and position while it is minimized](https://devblogs.microsoft.com/oldnewthing/20040707-00/?p=38523) 381 | * [Why does calling `SetForegroundWindow` immediately followed by `GetForegroundWindow` not return the same window back?](https://devblogs.microsoft.com/oldnewthing/20161118-00/?p=94745) 382 | * [How does Windows decide whether a newly-created window should use LTR or RTL layout?](https://devblogs.microsoft.com/oldnewthing/20220523-00/?p=106680) 383 | 384 | ### Windows Hierarchy 385 | * [What's so special about the desktop window?](https://devblogs.microsoft.com/oldnewthing/20040224-00/?p=40493) 386 | * [What is the window nesting limit?](https://devblogs.microsoft.com/oldnewthing/20031218-00/?p=41453) 387 | * [What's the difference between `HWND_TOP` and `HWND_TOPMOST`?](https://devblogs.microsoft.com/oldnewthing/20051121-10/?p=33263) 388 | * [A window can have a parent or an owner but not both](https://devblogs.microsoft.com/oldnewthing/20100315-00/?p=14613) 389 | * [Why does my control send its notifications to the wrong window after I reparent it?](https://devblogs.microsoft.com/oldnewthing/20100316-00/?p=14593) 390 | * [`WindowFromPoint`, `ChildWindowFromPoint`, `RealChildWindowFromPoint`, when will it all end?](https://devblogs.microsoft.com/oldnewthing/20101230-00/?p=11873) 391 | * [`GetParent`, just as confusing as `EnumClaw`, but it's an actual function!](https://devblogs.microsoft.com/oldnewthing/20111207-00/?p=8953) (`GetAncestor()`, `GetWindow()`) 392 | * [Having an owner window from another process is tricky, but it's sometimes the right thing to do](https://devblogs.microsoft.com/oldnewthing/20110331-00/?p=11083) 393 | * [What is the documentation for `SetParent` trying to tell me about synchronizing the UI state?](https://devblogs.microsoft.com/oldnewthing/20171122-00/?p=97445) 394 | * [Demonstrating what happens when a parent and child window have different UI states](https://devblogs.microsoft.com/oldnewthing/20171123-00/?p=97455) 395 | * [Getting a parent and child window to have the same UI states](https://devblogs.microsoft.com/oldnewthing/20171124-00/?p=97456) 396 | 397 | ### Window Styles 398 | * [Which window style bits belong to whom?](https://devblogs.microsoft.com/oldnewthing/20031203-00/?p=41633) 399 | * [How do I indicate that I want my window to follow right-to-left layout rules?](https://devblogs.microsoft.com/oldnewthing/20100611-00/?p=13743) 400 | * [Why isn't my transparent static control transparent?](https://devblogs.microsoft.com/oldnewthing/20111028-00/?p=9243) (`WS_EX_TRANSPARENT`) 401 | * [Like the cake, `WS_EX_TRANSPARENT` is a lie, or at least not the entire truth](https://devblogs.microsoft.com/oldnewthing/20121217-00/?p=5823) 402 | * [I used `WS_EX_COMPOSITED` to get rid of my redrawing flicker, but it resulted in sluggish response](https://devblogs.microsoft.com/oldnewthing/20171018-00/?p=97245) 403 | * [How can I use `WS_CLIP­CHILDREN` and still be able to draw a control with a transparent background?](https://devblogs.microsoft.com/oldnewthing/20180926-00/?p=99825) 404 | 405 | ### Window Classes 406 | * [What is the `HINSTANCE` passed to `CreateWindow` and `RegisterClass` used for?](https://devblogs.microsoft.com/oldnewthing/20050418-59/?p=35873) 407 | * [Using the wrong `HINSTANCE` in `RegisterClass` is like identity theft](https://devblogs.microsoft.com/oldnewthing/20110715-00/?p=10133) 408 | * [If the `RegisterClass` function takes ownership of the custom background brush, why is it leaking?](https://devblogs.microsoft.com/oldnewthing/20231218-00/?p=109163) 409 | * [Changing a window class affects all windows which belong to that class](https://devblogs.microsoft.com/oldnewthing/20060227-12/?p=32133) 410 | * [What does `CS_SAVEBITS` do?](https://devblogs.microsoft.com/oldnewthing/20060428-00/?p=31373) 411 | * [What does the `CS_OWNDC` class style do?](https://devblogs.microsoft.com/oldnewthing/20060601-06/?p=31003) 412 | * [What does the `CS_CLASSDC` class style do?](https://devblogs.microsoft.com/oldnewthing/20060602-00/?p=30993) 413 | * [Modifying the `CS_NOCLOSE` style does affect all windows of the class, just not necessarily in an immediately noticeable way](https://devblogs.microsoft.com/oldnewthing/20150305-00/?p=44533) 414 | * [Why does `PrintWindow` hate `CS_PARENTDC`? Because EVERYBODY hates `CS_PARENTDC`!](https://devblogs.microsoft.com/oldnewthing/20120604-00/?p=7463) 415 | * [Why does `PrintWindow` hate `CS_PARENTDC`? redux](https://devblogs.microsoft.com/oldnewthing/20140410-00/?p=1283) 416 | * [Safer subclassing](https://devblogs.microsoft.com/oldnewthing/20031111-00/?p=41883) 417 | * [Private classes, superclassing, and global subclassing](https://devblogs.microsoft.com/oldnewthing/20100215-00/?p=14943) 418 | * [What makes `RealGetWindowClass` so much more real than `GetClassName`?](https://devblogs.microsoft.com/oldnewthing/20101231-00/?p=11863) 419 | * [Why does `CreateWindowEx` take the extended style parameter as its first parameter instead of its last?](https://devblogs.microsoft.com/oldnewthing/20201207-00/?p=104518) 420 | * [When should I use `CS_GLOBALCLASS`?](https://devblogs.microsoft.com/oldnewthing/20230310-00/?p=107926) 421 | * [How unique must the uIdSubclass parameter be when I call `Set­Window­Subclass`?](https://devblogs.microsoft.com/oldnewthing/20230323-00/?p=107962) 422 | 423 | 424 | ## Top-Level Windows 425 | 426 | ### Window Frame and Caption 427 | * [Getting a custom right-click menu for the caption icon](https://devblogs.microsoft.com/oldnewthing/20031027-00/?p=42023) 428 | * [Drawing an active-looking caption even when not active](https://devblogs.microsoft.com/oldnewthing/20031029-00/?p=42003) 429 | * [How do I suppress full window drag/resize for just one window?](https://devblogs.microsoft.com/oldnewthing/20100129-01/?p=15133) 430 | * [How do I switch a window between normal and fullscreen?](https://devblogs.microsoft.com/oldnewthing/20100412-00/?p=14353) 431 | * [How do I enable and disable the minimize, maximize, and close buttons in my caption bar?](https://devblogs.microsoft.com/oldnewthing/20100604-00/?p=13803) 432 | * [Getting the location of the Close button in the title bar](https://devblogs.microsoft.com/oldnewthing/20140505-00/?p=1083) 433 | * [Getting the location of the Close button in the title bar, from Windows 2000 or Windows XP](https://devblogs.microsoft.com/oldnewthing/20140630-00/?p=623) 434 | * [Why are the dimensions of a maximized window larger than the monitor?](https://devblogs.microsoft.com/oldnewthing/20150304-00/?p=44543) 435 | * [Creating a window that can be resized in only one direction](https://devblogs.microsoft.com/oldnewthing/20150504-00/?p=44944) 436 | * [Why don't you forward `WM_GETMINMAXINFO` and clamp the results?](https://devblogs.microsoft.com/oldnewthing/20150513-00/?p=45611) 437 | 438 | ### DWM 439 | * [Why doesn't my program receive the `WM_DWMSENDICONICTHUMBNAIL` message when I ask for an iconic representation?](https://devblogs.microsoft.com/oldnewthing/20100205-00/?p=15043) 440 | * [The `MARGINS` parameter to the `DwmExtendFrameIntoClientArea` function controls how far the frame extends into the client area](https://devblogs.microsoft.com/oldnewthing/20110113-00/?p=11763) 441 | * [How do I suppress the default animation that occurs when I hide or show a window?](https://devblogs.microsoft.com/oldnewthing/20121003-00/?p=6423) 442 | * [Display a custom thumbnail for your application (and while you're at it, a custom live preview)](https://devblogs.microsoft.com/oldnewthing/20130225-00/?p=5153) 443 | * [How can I detect that my window has been suppressed from the screen by the shell?](https://devblogs.microsoft.com/oldnewthing/20200302-00/?p=103507) ("window cloaking") 444 | 445 | ### Dialogs 446 | * [Why can't I create my dialog box? Rookie mistake #1](https://devblogs.microsoft.com/oldnewthing/?p=28123) 447 | * [Why can't I create my dialog box? Rookie mistake #2](https://devblogs.microsoft.com/oldnewthing/20070207-04/?p=28113) 448 | * [Returning values from a dialog procedure](https://devblogs.microsoft.com/oldnewthing/20031107-00/?p=41923) 449 | * [A different type of dialog procedure](https://devblogs.microsoft.com/oldnewthing/20031112-00/?p=41863) 450 | * [Another different type of dialog procedure](https://devblogs.microsoft.com/oldnewthing/20031113-00/?p=41843) 451 | * [The default answer to every dialog box is "Cancel"](https://devblogs.microsoft.com/oldnewthing/20030901-00/?p=42723) 452 | * [Rotating the Z-order](https://devblogs.microsoft.com/oldnewthing/20030826-00/?p=42793) 453 | * [Using the `TAB` key to navigate in non-dialogs](https://devblogs.microsoft.com/oldnewthing/20031021-00/?p=42083) 454 | * [Using the `TAB` key to navigate in non-dialogs, redux](https://devblogs.microsoft.com/oldnewthing/20131009-00/?p=2983) 455 | * [Preventing edit control text from being autoselected in a dialog box](https://devblogs.microsoft.com/oldnewthing/20031114-00/?p=41823) 456 | * [Those who do not understand the dialog manager are doomed to reimplement it, badly](https://devblogs.microsoft.com/oldnewthing/20070627-00/?p=26243) 457 | * [Other tricks with `WM_GETDLGCODE`](https://devblogs.microsoft.com/oldnewthing/20031126-00/?p=41703) 458 | * [`GetDialogBaseUnits` is a crock](https://devblogs.microsoft.com/oldnewthing/20040217-00/?p=40573) 459 | * [Why isn’t `MapDialogRect` mapping dialog rectangles?](https://devblogs.microsoft.com/oldnewthing/20211021-00/?p=105818) 460 | * [Why are dialog boxes initially created hidden?](https://devblogs.microsoft.com/oldnewthing/20040311-00/?p=40303) 461 | * [What's the deal with the `DS_SHELLFONT` flag?](https://devblogs.microsoft.com/oldnewthing/20050204-00/?p=36523) 462 | * [Why does `DS_SHELLFONT = DS_FIXEDSYS | DS_SETFONT`?](https://devblogs.microsoft.com/oldnewthing/20050207-00/?p=36513) 463 | * [How to set focus in a dialog box](https://devblogs.microsoft.com/oldnewthing/20040802-00/?p=38283) 464 | * [Never leave focus on a disabled control](https://devblogs.microsoft.com/oldnewthing/20040804-00/?p=38243) 465 | * [A subtlety in restoring previous window position](https://devblogs.microsoft.com/oldnewthing/20050314-00/?p=36203) 466 | * [Things you already know: How do I wait until my dialog box is displayed before doing something?](https://devblogs.microsoft.com/oldnewthing/20060922-03/?p=29623) 467 | * [What does `TranslateAccelerator` do?](https://devblogs.microsoft.com/oldnewthing/20080523-00/?p=22203) 468 | * [If I have a modeless dialog box with custom accelerators, which should I call first: `IsDialogMessage` or `TranslateAccelerator`](https://devblogs.microsoft.com/oldnewthing/20160818-00/?p=94115) 469 | * [Gentle reminder: On a dialog box, do not give OK and Cancel accelerators](https://devblogs.microsoft.com/oldnewthing/20080508-00/?p=22403) 470 | * [Why are accelerators for hidden controls still active?](https://devblogs.microsoft.com/oldnewthing/?p=22113) 471 | * [How do I make my accelerators apply only when used in the main window and not when the user is using a modeless dialog?](https://devblogs.microsoft.com/oldnewthing/20200807-00/?p=104056) 472 | * [Why doesn't the `TAB` key work on controls I've marked as `WS_TABSTOP`?](https://devblogs.microsoft.com/oldnewthing/20100930-00/?p=12683) 473 | * [You can't use the `WM_USER` message in a dialog box](https://devblogs.microsoft.com/oldnewthing/20121024-00/?p=6263) 474 | * [How can I make a dialog box right-to-left at runtime?](https://devblogs.microsoft.com/oldnewthing/20181122-00/?p=100295) 475 | * [How does the dialog manager calculate the average width of a character?](https://devblogs.microsoft.com/oldnewthing/20221103-00/?p=107350) 476 | 477 | ### Nested and Embedded Dialogs 478 | * [What is the `DS_CONTROL` style for?](https://devblogs.microsoft.com/oldnewthing/20040730-00/?p=38293) 479 | * [More notes on use of the `DS_CONTROL` style](https://devblogs.microsoft.com/oldnewthing/20231101-00/?p=108952) 480 | * [It's not a good idea to give multiple controls on a dialog box the same ID](https://devblogs.microsoft.com/oldnewthing/20120619-00/?p=7343) 481 | * [When embedding a dialog inside another, make sure you don't accidentally create duplicate control IDs](https://devblogs.microsoft.com/oldnewthing/20120620-00/?p=7333) 482 | * [When the default pushbutton is invoked, the invoke goes to the top-level dialog](https://devblogs.microsoft.com/oldnewthing/?p=7313) 483 | 484 | ### Common Dialogs 485 | * [Why doesn't my `MessageBox` wrap at the right location?](https://devblogs.microsoft.com/oldnewthing/20110624-00/?p=10343) 486 | * [How do I customize the Favorite Links section of the File Open dialog?](https://devblogs.microsoft.com/oldnewthing/20100622-00/?p=13643) 487 | * [Why does the common file dialog change the current directory?](https://devblogs.microsoft.com/oldnewthing/20101112-00/?p=12293) 488 | * [You can filter the Common File dialog with wildcards](https://devblogs.microsoft.com/oldnewthing/20101124-00/?p=12213) 489 | * [How do I display the Find Printers dialog programmatically?](https://devblogs.microsoft.com/oldnewthing/20110628-00/?p=10323) 490 | * [Why doesn't the Open Files list in the Shared Folders snap-in show all my open files?](https://devblogs.microsoft.com/oldnewthing/20110823-00/?p=9833) 491 | * [A common control for associating extensions is well overdue](https://devblogs.microsoft.com/oldnewthing/20110914-00/?p=9653) 492 | * [Filtering the folders that appear in the Browse for Folder dialog](https://devblogs.microsoft.com/oldnewthing/20131014-00/?p=2943) 493 | * [Opening the classic folder browser dialog with a specific folder preselected](https://devblogs.microsoft.com/oldnewthing/20150406-00/?p=44303) 494 | * [Why does the common file save dialog create a temporary file and then delete it?](https://devblogs.microsoft.com/oldnewthing/?p=1123) 495 | * [Customing the standard color-picker dialog](https://devblogs.microsoft.com/oldnewthing/20140707-00/?p=563) 496 | * [How do I set the initial directory of the File Open dialog to a virtual directory?](https://devblogs.microsoft.com/oldnewthing/20170619-00/?p=96425) 497 | * [When I select multiple files in the File Open dialog, why does the last item come first?](https://devblogs.microsoft.com/oldnewthing/20190409-00/?p=102406) 498 | * [I set the `OFN_NONETWORKBUTTON` option in the `OPENFILENAME` structure, but it has no effect on the network item in the navigation pane](https://devblogs.microsoft.com/oldnewthing/20190705-00/?p=102660) 499 | * [How do I add custom controls to the common file open or file save dialogs?](https://devblogs.microsoft.com/oldnewthing/20211227-00/?p=106054) 500 | * [How can I get my `FileSavePicker` to open in the same folder that was picked by the `FileOpenPicker` or `FolderPicker`?](https://devblogs.microsoft.com/oldnewthing/20220525-00/?p=106685) (win32/COM equivalent mentioned at the end of the post) 501 | 502 | ### Control Navigation 503 | * [Using the `TAB` key to navigate in non-dialogs](https://devblogs.microsoft.com/oldnewthing/20031021-00/?p=42083) 504 | * [Using the `TAB` key to navigate in non-dialogs, redux](https://devblogs.microsoft.com/oldnewthing/20131009-00/?p=2983) 505 | * [Managing the UI state of accelerators and focus rectangles](https://devblogs.microsoft.com/oldnewthing/20050503-00/?p=35723) 506 | * [Custom navigation in dialog boxes, redux](https://devblogs.microsoft.com/oldnewthing/20100222-00/?p=14863) 507 | * [Dialog boxes return focus to the control that had focus when you last switched away; how do I get in on that action for my own windows?](https://devblogs.microsoft.com/oldnewthing/20140521-00/?p=943) 508 | * [How can I create a non-circular tab order, or some other type of custom ordering in my Win32 dialog?](https://devblogs.microsoft.com/oldnewthing/20201231-00/?p=104627) 509 | 510 | ### Dialog Manager 511 | * [The dialog manager, part 1: Warm-ups](https://devblogs.microsoft.com/oldnewthing/20050329-00/?p=36043) 512 | * [The dialog manager, part 2: Creating the frame window](https://devblogs.microsoft.com/oldnewthing/20050330-00/?p=36023) 513 | * [The dialog manager, part 3: Creating the controls](https://devblogs.microsoft.com/oldnewthing/20050331-00/?p=36003) 514 | * [The dialog manager, part 4: The dialog loop](https://devblogs.microsoft.com/oldnewthing/20050401-00/?p=35993) 515 | * [The dialog manager, part 5: Converting a non-modal dialog box to modal](https://devblogs.microsoft.com/oldnewthing/20050404-48/?p=35983) 516 | * [The dialog manager, part 6: Subtleties in message loops](https://devblogs.microsoft.com/oldnewthing/20050405-46/?p=35973) 517 | * [The dialog manager, part 7: More subtleties in message loops](https://devblogs.microsoft.com/oldnewthing/20050406-57/?p=35963) 518 | * [The dialog manager, part 8: Custom navigation in dialog boxes](https://devblogs.microsoft.com/oldnewthing/20050407-00/?p=35953) 519 | * [The dialog manager, part 9: Custom accelerators in dialog boxes](https://devblogs.microsoft.com/oldnewthing/20050408-41/?p=35943) 520 | 521 | ### Modality 522 | * [The correct order for disabling and enabling windows](https://devblogs.microsoft.com/oldnewthing/20040227-00/?p=40463) 523 | * [Modality, part 1: UI-modality vs code-modality](https://devblogs.microsoft.com/oldnewthing/20050218-00/?p=36413) 524 | * [Modality, part 2: Code-modality vs UI-modality](https://devblogs.microsoft.com/oldnewthing/20050221-00/?p=36403) 525 | * [Modality, part 3: The `WM_QUIT` message](https://devblogs.microsoft.com/oldnewthing/20050222-00/?p=36393) 526 | * [Modality, part 4: The importance of setting the correct owner for modal UI](https://devblogs.microsoft.com/oldnewthing/20050223-00/?p=36383) 527 | * [Modality, part 5: Setting the correct owner for modal UI](https://devblogs.microsoft.com/oldnewthing/20050224-00/?p=36373) 528 | * [Modality, part 6: Interacting with a program that has gone modal](https://devblogs.microsoft.com/oldnewthing/20050228-00/?p=36343) 529 | * [Modality, part 7: A timed `MessageBox`, the cheap version](https://devblogs.microsoft.com/oldnewthing/20050301-00/?p=36333) 530 | * [Modality, part 8: A timed `MessageBox`, the better version](https://devblogs.microsoft.com/oldnewthing/20050304-00/?p=36273) 531 | * [Modality, part 9: Setting the correct owner for modal UI, practical exam](https://devblogs.microsoft.com/oldnewthing/20110121-00/?p=11703) 532 | * [Thread messages are eaten by modal loops](https://devblogs.microsoft.com/oldnewthing/20050426-18/?p=35783) 533 | * [Rescuing thread messages from modal loops via message filters](https://devblogs.microsoft.com/oldnewthing/20050428-00/?p=35753) 534 | 535 | ### Property Sheets 536 | * [What other effects does `DS_SHELLFONT` have on property sheet pages?](https://devblogs.microsoft.com/oldnewthing/20050208-00/?p=36503) 537 | * [`PSM_ISDIALOGMESSAGE` is to modeless property sheets as `IsDialogMessage` is to modeless dialog boxes](https://devblogs.microsoft.com/oldnewthing/20100309-00/?p=14673) 538 | * [You can extend the `PROPSHEETPAGE` structure with your own bonus data](https://devblogs.microsoft.com/oldnewthing/20110318-00/?p=11183) 539 | * [The `PSN_SETACTIVE` notification is sent each time your wizard page is activated](https://devblogs.microsoft.com/oldnewthing/20111021-00/?p=9323) 540 | * [Appending additional payload to a `PROPSHEETPAGE` structure](https://devblogs.microsoft.com/oldnewthing/20211124-00/?p=105961) 541 | * [How do I pass an array of variable-sized `PROPSHEETPAGE` structures to PropertySheet?](https://devblogs.microsoft.com/oldnewthing/20211125-00/?p=105967) 542 | 543 | 544 | ## Controls 545 | 546 | * [Just because you're a control doesn't mean that you're necessarily inside a dialog box](https://devblogs.microsoft.com/oldnewthing/20070820-00/?p=25513) 547 | 548 | ### Animation Controls 549 | * [Limitations of the shell animation control](https://devblogs.microsoft.com/oldnewthing/20050216-00/?p=36433) 550 | * [Why does the version 6 animation control not use a background thread?](https://devblogs.microsoft.com/oldnewthing/?p=31883) 551 | 552 | ### Buttons 553 | * [What's the `BS_PUSHLIKE` button style for?](https://devblogs.microsoft.com/oldnewthing/20070921-00/?p=25023) (Don't use, it's completely obsolete nowadays. Use check box or radio button instead.) 554 | 555 | ### Combo Boxes 556 | * [Speeding up adding items to a combobox or listbox](https://devblogs.microsoft.com/oldnewthing/20040610-00/?p=38933) (`WM_SETREDRAW`) 557 | 558 | ### Edit Controls 559 | * [What's the deal with the `EM_SETHILITE` message?](https://devblogs.microsoft.com/oldnewthing/20071025-00/?p=24693) 560 | * [Preventing edit control text from being autoselected in a dialog box](https://devblogs.microsoft.com/oldnewthing/20031114-00/?p=41823) 561 | * [How do I suppress the `CapsLock` warning on password edit controls?](https://devblogs.microsoft.com/oldnewthing/20081010-00/?p=20603) 562 | * [The early history of the `ES_NUMBER` edit control style](https://devblogs.microsoft.com/oldnewthing/20190220-00/?p=100975) 563 | * [How do I allow negative numbers with the `ES_NUMBER` edit control style?](https://devblogs.microsoft.com/oldnewthing/20190221-00/?p=100985) 564 | * [How do I permit a minus sign to be entered into my edit control, but only if it’s the first character?](https://devblogs.microsoft.com/oldnewthing/20190222-00/?p=100995) 565 | 566 | ### List Views 567 | * [Positioned vs. non-positioned listview views](https://devblogs.microsoft.com/oldnewthing/?p=38483) 568 | * [Displaying infotips for folded and unfolded listview items](https://devblogs.microsoft.com/oldnewthing/20061213-00/?p=28733) 569 | * [Computing listview infotips in the background](https://devblogs.microsoft.com/oldnewthing/20061214-02/?p=28713) 570 | * [What's the difference between `LVM_HITTEST` and `LVM_INSERTMARKHITTEST`?](https://devblogs.microsoft.com/oldnewthing/20071024-00/?p=24703) 571 | * [Why is there an `LVN_ODSTATECHANGED` notification when there's already a perfectly good `LVN_ITEMCHANGED` notification?](https://devblogs.microsoft.com/oldnewthing/20101028-00/?p=12423) 572 | * [Creating a listview with checkboxes on some items but not others](https://devblogs.microsoft.com/oldnewthing/20140113-00/?p=2103) 573 | * [How can I programmatically resize a listview column to fit its contents?](https://devblogs.microsoft.com/oldnewthing/20150309-00/?p=44513) 574 | * [How do I create a disabled checkbox for a listview item?](https://devblogs.microsoft.com/oldnewthing/20180524-00/?p=98825) 575 | * [Speeding up adding items to a combobox or listbox](https://devblogs.microsoft.com/oldnewthing/20040610-00/?p=38933) (`WM_SETREDRAW`) 576 | 577 | ### Rich Text Controls 578 | * ~~[The history of the RichEdit control from Murray Sargent](https://devblogs.microsoft.com/oldnewthing/20070111-20/?p=28433)~~ 579 | (The post is just a (broken) link to [https://blogs.msdn.microsoft.com/murrays/2006/10/19/some-richedit-history/](https://blogs.msdn.microsoft.com/murrays/2006/10/19/some-richedit-history/)) 580 | * [How do I load an entire file into a rich text control?](https://devblogs.microsoft.com/oldnewthing/20070110-13/?p=28463) 581 | * [How do I put more than 32,000 characters into a rich text control?](https://devblogs.microsoft.com/oldnewthing/20070111-02/?p=28443) 582 | * [How do I print the contents of a rich text control?](https://devblogs.microsoft.com/oldnewthing/20070112-02/?p=28423) 583 | 584 | ### Scrollbars 585 | * [The scratch program](https://devblogs.microsoft.com/oldnewthing/20030723-00/?p=43073) 586 | * [Scrollbars, part 2](https://devblogs.microsoft.com/oldnewthing/20030725-00/?p=43053) 587 | * [Scrollbars, part 3: Optimizing the paint cycle](https://devblogs.microsoft.com/oldnewthing/20030729-00/?p=43033) 588 | * [Scrollbars, part 4: Adding a proportional scrollbar](https://devblogs.microsoft.com/oldnewthing/20030731-00/?p=43003) 589 | * Likely part 5: [Keyboard accessibility for scrollbars](https://devblogs.microsoft.com/oldnewthing/20030805-00/?p=42983) 590 | * Addendum to part 5: [A subtlety in the keyboard code](https://devblogs.microsoft.com/oldnewthing/20030807-00/?p=42953) 591 | * [Scrollbars part 6 - The wheel](https://devblogs.microsoft.com/oldnewthing/20030807-00/?p=42963) 592 | * [Scrollbars part 7 - Integrality](https://devblogs.microsoft.com/oldnewthing/20030811-00/?p=42933) 593 | * [Scrollbars part 8 - Integral interactive resizing](https://devblogs.microsoft.com/oldnewthing/20030813-00/?p=42913) 594 | * [Scrollbars part 9 - Maintaining the metaphor](https://devblogs.microsoft.com/oldnewthing/20030909-00/?p=42603) 595 | * [Scrollbars part 10 - Towards a deeper understanding of the `WM_NCCALCSIZE` message](https://devblogs.microsoft.com/oldnewthing/20030911-00/?p=42553) 596 | * [Scrollbars part 11: Towards an even deeper understanding of the `WM_NCCALCSIZE` message](https://devblogs.microsoft.com/oldnewthing/20030915-00/?p=42493) 597 | * [Answers to exercise from Scrollbars Part 11](https://devblogs.microsoft.com/oldnewthing/20030917-00/?p=42453) 598 | * [Scrollbars part 12: Applying `WM_NCCALCSIZE` to our scrollbar sample](https://devblogs.microsoft.com/oldnewthing/20030917-00/?p=42463) 599 | * [Scrollbars redux: Part 12](https://devblogs.microsoft.com/oldnewthing/20031016-00/?p=42133) 600 | * [There are two types of scrollbars](https://devblogs.microsoft.com/oldnewthing/20040510-00/?p=39413) 601 | * [Why was `WHEEL_DELTA` chosen to be 120 instead of a much more convenient value like 100 or even 10?](https://devblogs.microsoft.com/oldnewthing/20130123-00/?p=5473) 602 | * [Why does setting the horizontal scroll bar range for the first time also set the vertical range, and vice versa?](https://devblogs.microsoft.com/oldnewthing/20160727-00/?p=93965) 603 | * [Autoscrolling on drag, part 1: Basic implementation](https://devblogs.microsoft.com/oldnewthing/20210125-00/?p=104757) 604 | * [Autoscrolling on drag, part 2: Why does scrolling go faster if I wiggle the mouse?](https://devblogs.microsoft.com/oldnewthing/20210126-00/?p=104759) 605 | * [Autoscrolling on drag, part 3: Dynamic autoscroll based on mouse position](https://devblogs.microsoft.com/oldnewthing/20210127-00/?p=104764) 606 | * [Autoscrolling on drag, part 4: Dynamic autoscroll based on escape velocity](https://devblogs.microsoft.com/oldnewthing/20210128-00/?p=104768) 607 | * [Autoscrolling on drag, part 5: Adding wiggle-to-scroll to escape velocity](https://devblogs.microsoft.com/oldnewthing/20210129-00/?p=104773) 608 | 609 | ### Static Controls 610 | * [When will the static control automatically delete the image loaded into it, and when is it the responsibility of the application?](https://devblogs.microsoft.com/oldnewthing/20140219-00/?p=1713) 611 | 612 | ### Tab Controls 613 | * [How should I create controls on my dialog box that has a tab control?](https://devblogs.microsoft.com/oldnewthing/20191015-00/?p=102996) 614 | * [How am I supposed to create children of the Win32 tab control?](https://devblogs.microsoft.com/oldnewthing/20211110-00/?p=105889) 615 | 616 | ### Toolbars 617 | * [Why are there both `TBSTYLE_EX_VERTICAL` and `CCS_VERT`?](https://devblogs.microsoft.com/oldnewthing/20070328-00/?p=27473) 618 | * [How do I create a toolbar that sits in the taskbar?](https://devblogs.microsoft.com/oldnewthing/20091109-00/?p=16113) 619 | * [How do I create a right-aligned toolbar button?](https://devblogs.microsoft.com/oldnewthing/20110616-00/?p=10413) 620 | * [Creating custom tasks on a jump list](https://devblogs.microsoft.com/oldnewthing/20131223-00/?p=2303) 621 | 622 | ### Tooltips 623 | * [Coding in-place tooltips](https://devblogs.microsoft.com/oldnewthing/20060626-11/?p=30743) 624 | * [Using custom-draw in tooltips to adjust the font](https://devblogs.microsoft.com/oldnewthing/20060627-22/?p=30723) 625 | * [Multiplexing multiple tools into one in a tooltip](https://devblogs.microsoft.com/oldnewthing/20060628-05/?p=30703) 626 | * [Generating tooltip text dynamically](https://devblogs.microsoft.com/oldnewthing/20060629-00/?p=30693) 627 | * [Why can't I display a tooltip for a disabled window?](https://devblogs.microsoft.com/oldnewthing/20070405-00/?p=27363) 628 | * [Over-documenting `TTM_RELAYEVENT` and why it results in a one-second periodic timer running as long as the tooltip is visible](https://devblogs.microsoft.com/oldnewthing/20200110-00/?p=103316) 629 | 630 | ### Trackbars 631 | * [Adding a `Ctrl`+arrow accelerator for moving the trackbar by just one unit, part 1: Initial plunge](https://devblogs.microsoft.com/oldnewthing/20181023-00/?p=100035) 632 | * [Adding a `Ctrl`+arrow accelerator for moving the trackbar by just one unit, part 2: Second try](https://devblogs.microsoft.com/oldnewthing/20181024-00/?p=100045) 633 | * [How do I prevent users from using the mouse to drag the trackbar thumb to positions that aren’t multiples of five? Part 1: Reframe the problem](https://devblogs.microsoft.com/oldnewthing/20181025-00/?p=100055) 634 | * [How do I prevent users from using the mouse to drag the trackbar thumb to positions that aren’t multiples of five? Part 2: Nudging the thumb position](https://devblogs.microsoft.com/oldnewthing/20181026-00/?p=100065) 635 | 636 | ### Tree-List Views 637 | * [The `TVS_CHECKBOXES` style is quirky, which is a polite way of saying that it is crazy](https://devblogs.microsoft.com/oldnewthing/20171127-00/?p=97465) 638 | * [Beware of the leaked image list when using the `TVS_CHECKBOXES` style](https://devblogs.microsoft.com/oldnewthing/20171128-00/?p=97475) 639 | * [Creating tree view check boxes manually: A simple state image list](https://devblogs.microsoft.com/oldnewthing/20171129-00/?p=97485) 640 | * [Creating tree view check boxes manually: Responding to clicks](https://devblogs.microsoft.com/oldnewthing/20171130-00/?p=97495) 641 | * [Creating tree view check boxes manually: Themed check boxes](https://devblogs.microsoft.com/oldnewthing/20171201-00/?p=97505) 642 | * [Tree view check boxes: A sordid history](https://devblogs.microsoft.com/oldnewthing/20171204-00/?p=97515) 643 | * [Tree view check boxes: The extended check box states](https://devblogs.microsoft.com/oldnewthing/20171205-00/?p=97525) 644 | 645 | 646 | ## Processing of Messages 647 | 648 | * [Which message numbers belong to whom?](https://devblogs.microsoft.com/oldnewthing/20031202-00/?p=41653) 649 | * [The various ways of sending a message](https://devblogs.microsoft.com/oldnewthing/20041119-00/?p=37243) 650 | * [Broadcasting user-defined messages](https://devblogs.microsoft.com/oldnewthing/20040505-00/?p=39503) 651 | * [When can a thread receive window messages?](https://devblogs.microsoft.com/oldnewthing/20040608-00/?p=38983) 652 | * [What's the difference between `GetKeyState` and `GetAsyncKeyState`?](https://devblogs.microsoft.com/oldnewthing/20041130-00/?p=37173) 653 | * [Thread messages are eaten by modal loops](https://devblogs.microsoft.com/oldnewthing/20050426-18/?p=35783) 654 | * [Rescuing thread messages from modal loops via message filters](https://devblogs.microsoft.com/oldnewthing/20050428-00/?p=35753) 655 | * [The dangers of filtering window messages](https://devblogs.microsoft.com/oldnewthing/20050209-00/?p=36493) 656 | * [You can't simulate keyboard input with `PostMessage`](https://devblogs.microsoft.com/oldnewthing/20050530-11/?p=35513) 657 | * [Pumping messages while waiting for a period of time](https://devblogs.microsoft.com/oldnewthing/20060126-00/?p=32513) 658 | * [In pursuit of the message queue](https://devblogs.microsoft.com/oldnewthing/20060221-09/?p=32203) 659 | * [No, really, you need to pass all unhandled messages to `DefWindowProc`](https://devblogs.microsoft.com/oldnewthing/20060425-16/?p=31413) 660 | * [Even if you have code to handle a message, you're allowed to call `DefWindowProc`, because you were doing that anyway after all](https://devblogs.microsoft.com/oldnewthing/20090105-00/?p=19603) 661 | * [What were `Get/SetMessageExtraInfo` ever used for?](https://devblogs.microsoft.com/oldnewthing/20101129-00/?p=12173) 662 | * [Why is `GetWindowLongPtr` returning a garbage value on 64-bit Windows?](https://devblogs.microsoft.com/oldnewthing/20131226-00/?p=2263) 663 | * [`TrackMouseEvent` tracks mouse events in your window, but only if the events belong to your window](https://devblogs.microsoft.com/oldnewthing/20101206-00/?p=12113) 664 | * [Don't forget to include the message queue in your lock hierarchy](https://devblogs.microsoft.com/oldnewthing/20110418-00/?p=10913) 665 | * [What happens to a sent message when `SendMessageTimeout` reaches its timeout?](https://devblogs.microsoft.com/oldnewthing/20110915-00/?p=9643) 666 | * [Why can't I `PostMessage` the `WM_COPYDATA` message, but I can `SendMessageTimeout` it with a tiny timeout?](https://devblogs.microsoft.com/oldnewthing/20110916-00/?p=9623) 667 | * [Even though mouse-move, paint, and timer messages are generated on demand, it's still possible for one to end up in your queue](https://devblogs.microsoft.com/oldnewthing/20130523-00/?p=4273) 668 | * [Posted messages are processed ahead of input messages, even if they were posted later](https://devblogs.microsoft.com/oldnewthing/20130531-00/?p=4203) 669 | * [What kind of messages can a message-only window receive?](https://devblogs.microsoft.com/oldnewthing/20171218-00/?p=97595) 670 | * [If the prototypes of `DispatchMessageA` and `DispatchMessageW` are identical, why have both?](https://devblogs.microsoft.com/oldnewthing/20181101-00/?p=100105) 671 | * [Those who do not understand the dialog manager are doomed to reimplement it, badly](https://devblogs.microsoft.com/oldnewthing/20070627-00/?p=26243) 672 | * [How can I trigger a recalc of the mouse cursor after I changed some of my internal application state?](https://devblogs.microsoft.com/oldnewthing/20220921-00/?p=107203) 673 | * [How can I trigger a recalc of the mouse cursor after I changed some of my internal application state?, follow-up](https://devblogs.microsoft.com/oldnewthing/20230525-00/?p=108247) 674 | * [`GetQueueStatus` and the queue state](https://devblogs.microsoft.com/oldnewthing/20230925-00/?p=108820) 675 | 676 | ### Hooking 677 | * [What is the `HINSTANCE` passed to `SetWindowsHookEx` used for?](https://devblogs.microsoft.com/oldnewthing/20050425-41/?p=35803) 678 | * [How can I get notified when the cursor changes?](https://devblogs.microsoft.com/oldnewthing/20151116-00/?p=92091) 679 | * [What does the thread parameter to `Set­Windows­Hook­Ex` actually mean?](https://devblogs.microsoft.com/oldnewthing/20180926-00/?p=99825) 680 | * [Why does `SetFocus` fail without telling me why?](https://devblogs.microsoft.com/oldnewthing/20190614-00/?p=102593) 681 | 682 | 683 | ## Specific Messages 684 | 685 | ### Notifications 686 | * [What's the difference between the `wParam` of the `WM_NOTIFY` message and the `idFrom` in the `NMHDR` structure.](https://devblogs.microsoft.com/oldnewthing/20131204-00/?p=2463) 687 | * [Restating the obvious about the `WM_COMMAND` message](https://devblogs.microsoft.com/oldnewthing/20060302-10/?p=32093) 688 | * [Restating the obvious about the `WM_NOTIFY` message](https://devblogs.microsoft.com/oldnewthing/20090821-00/?p=17033) 689 | 690 | ### Window Construction and Destruction 691 | * [What is the difference between `WM_DESTROY` and `WM_NCDESTROY`?](https://devblogs.microsoft.com/oldnewthing/20050726-00/?p=34803) 692 | * [How can I determine the reason why my window is closing?](https://devblogs.microsoft.com/oldnewthing/20190411-00/?p=102411) (`WM_CLOSE`) 693 | 694 | ### Window Geometry Messages 695 | * [Use `WM_WINDOWPOSCHANGED` to react to window state changes](https://devblogs.microsoft.com/oldnewthing/20080115-00/?p=23813) 696 | * [Use `WM_WINDOWPOSCHANGING` to intercept window state changes](https://devblogs.microsoft.com/oldnewthing/20080116-00/?p=23803) 697 | 698 | ### Window Painting Messages 699 | * [Paint messages will come in as fast as you let them](https://devblogs.microsoft.com/oldnewthing/20111219-00/?p=8863) (`WM_PAINT`) 700 | * [What happens if I don't paint when I get a `WM_PAINT` message?](https://devblogs.microsoft.com/oldnewthing/20141203-00/?p=43483) 701 | * [What is the implementation of `WM_PRINTCLIENT`?](https://devblogs.microsoft.com/oldnewthing/20090330-00/?p=18683) 702 | * [There's a default implementation for `WM_SETREDRAW`, but you might be able to do better](https://devblogs.microsoft.com/oldnewthing/20110124-00/?p=11683) 703 | * [Speeding up adding items to a combobox or listbox](https://devblogs.microsoft.com/oldnewthing/20040610-00/?p=38933) (`WM_SETREDRAW`) 704 | * [Using `WM_SETREDRAW` to speed up adding a lot of elements to a control](https://devblogs.microsoft.com/oldnewthing/20140407-00/?p=1313) 705 | 706 | ### Window Focus Messages 707 | * [`WM_KILLFOCUS` is the wrong time to do field validation](https://devblogs.microsoft.com/oldnewthing/20040419-00/?p=39753) 708 | * [The dangers of playing focus games when handling a `WM_KILLFOCUS` message](https://devblogs.microsoft.com/oldnewthing/20050808-16/?p=34673) 709 | * [Why doesn't the `MoveWindow` function generate the `WM_GETMINMAXINFO` message?](https://devblogs.microsoft.com/oldnewthing/20090309-00/?p=18903) 710 | 711 | ### Keyboard Messages 712 | * [How do I respond to the `WM_MENUCHAR` message?](https://devblogs.microsoft.com/oldnewthing/20171208-00/?p=97545) 713 | 714 | ### Mouse Messages 715 | * [Why is there no `WM_MOUSEENTER` message?](https://devblogs.microsoft.com/oldnewthing/20031013-00/?p=42193) 716 | * [Why do I get spurious `WM_MOUSEMOVE` messages?](https://devblogs.microsoft.com/oldnewthing/20031001-00/?p=42343) 717 | * [Sure, I can get spurious `WM_MOUSEMOVE` messages, but why do they keep streaming in?](https://devblogs.microsoft.com/oldnewthing/20090617-00/?p=17863) 718 | * [How do I get mouse messages faster than `WM_MOUSEMOVE`?](https://devblogs.microsoft.com/oldnewthing/20120314-00/?p=8103) 719 | * [Logical consequences of the way Windows converts single-clicks into double-clicks](https://devblogs.microsoft.com/oldnewthing/20041015-00/?p=37553) 720 | * [Implementing higher-order clicks](https://devblogs.microsoft.com/oldnewthing/20041018-00/?p=37543) 721 | * [How slow do you have to slow-double-click for it to be a rename?](https://devblogs.microsoft.com/oldnewthing/20081110-00/?p=20263) 722 | * [How can I prevent the mouse from moving in response to touch input?](https://devblogs.microsoft.com/oldnewthing/20210728-00/?p=105487) 723 | 724 | ### Dialog Messages 725 | * [Those who do not understand the dialog manager are doomed to reimplement it, badly](https://devblogs.microsoft.com/oldnewthing/20070627-00/?p=26243) 726 | * [Managing the UI state of accelerators and focus rectangles](https://devblogs.microsoft.com/oldnewthing/20050503-00/?p=35723) (`WM_CHANGEUISTATE`, `WM_QUERYUISTATE` and `WM_UPDATEUISTATE`) 727 | * [Untangling the confusingly-named `WM_UPDATEUISTATE` and `WM_CHANGEUISTATE` messages](https://devblogs.microsoft.com/oldnewthing/20130516-00/?p=4343) 728 | * [Who sends the initial `WM_UPDATEUISTATE` message?](https://devblogs.microsoft.com/oldnewthing/20130517-00/?p=4323) 729 | * [How can I prevent the keyboard focus rectangle from appearing on a control I created?](https://devblogs.microsoft.com/oldnewthing/20171206-00/?p=97526) 730 | * [Other tricks with `WM_GETDLGCODE`](https://devblogs.microsoft.com/oldnewthing/20031126-00/?p=41703) 731 | * [How do I prevent multi-line edit controls from eating the Enter key?](https://devblogs.microsoft.com/oldnewthing/20061012-06/?p=29413) 732 | * [Why do `DLGC_WANTALLKEYS` and `DLGC_WANTMESSAGE` have the same value?](https://devblogs.microsoft.com/oldnewthing/20070626-00/?p=26263) 733 | 734 | ### Other Window Messages 735 | * [The dangers of messing with activation when handling a `WM_ACTIVATE` message](https://devblogs.microsoft.com/oldnewthing/20050809-13/?p=34653) 736 | * [Why does my window get a `WM_ACTIVATE` message when it isn't active?](https://devblogs.microsoft.com/oldnewthing/20131016-00/?p=2913) 737 | * [A timed context menu](https://devblogs.microsoft.com/oldnewthing/20050307-00/?p=36263) (`WM_CANCELMODE`) 738 | * [Pitfalls in handling the `WM_CONTEXTMENU` message](https://devblogs.microsoft.com/oldnewthing/20040921-00/?p=37813) (`WM_CONTEXTMENU`) 739 | * [`WM_NCHITTEST` is for hit-testing, and hit-testing can happen for reasons other than the mouse being over your window](https://devblogs.microsoft.com/oldnewthing/20110218-00/?p=11453) 740 | * [How likely is it that a window will receive a `WM_NULL` message out of the blue?](https://devblogs.microsoft.com/oldnewthing/20170602-00/?p=96266) (`WM_NULL`) 741 | * [Why is there a special `PostQuitMessage` function?](https://devblogs.microsoft.com/oldnewthing/20051104-33/?p=33453) (`WM_QUIT`) 742 | * [How does `PostQuitMessage` know which thread to post the quit message to?](https://devblogs.microsoft.com/oldnewthing/20090112-00/?p=19533) (`WM_QUIT`) 743 | * [Who is responsible for destroying the font passed in the `WM_SETFONT` message?](https://devblogs.microsoft.com/oldnewthing/20080912-00/?p=20893) (`WM_SETFONT`) 744 | * [When I send a `WM_GETFONT` message to a window, why don't I get a font?](https://devblogs.microsoft.com/oldnewthing/20140724-00/?p=413) (`WM_GETFONT`) 745 | * [If my `WM_TIMER` handler takes longer than the timer period, will my queue fill up with `WM_TIMER` messages?](https://devblogs.microsoft.com/oldnewthing/20141204-00/?p=43473) 746 | * [Killing a window timer prevents the `WM_TIMER` message from being generated for that timer, but it doesn't retroactively remove ones that were already generated](https://devblogs.microsoft.com/oldnewthing/20141205-00/?p=43463) 747 | 748 | ### System Messages 749 | * [If one program blocks shutdown, then *all* programs block shutdown](https://devblogs.microsoft.com/oldnewthing/20200414-00/?p=103671) (`WM_QUERY­END­SESSION`, `WM_END­SESSION`) 750 | * [Why do I have to return this goofy value for `WM_DEVICECHANGE`?](https://devblogs.microsoft.com/oldnewthing/20031205-00/?p=41613) (`WM_DEVICECHANGE`) 751 | * [Windows doesn't close windows when a user logs off; that's your call](https://devblogs.microsoft.com/oldnewthing/20080421-00/?p=22663) (`WM_ENDSESSION`) 752 | * [Once you return from the `WM_ENDSESSION` message, your process can be terminated at any time](https://devblogs.microsoft.com/oldnewthing/20130627-00/?p=3973) (`WM_ENDSESSION`) 753 | 754 | 755 | ## GDI 756 | 757 | * [Why are `RECT`s endpoint-exclusive?](https://devblogs.microsoft.com/oldnewthing/20040218-00/?p=40563) 758 | * [Can you create an information context for the display?](https://devblogs.microsoft.com/oldnewthing/20090914-00/?p=16733) 759 | * [What does the `CS_OWNDC` class style do?](https://devblogs.microsoft.com/oldnewthing/20060601-06/?p=31003) 760 | * [What does the `CS_CLASSDC` class style do?](https://devblogs.microsoft.com/oldnewthing/20060602-00/?p=30993) 761 | * [How do you detect "Large Fonts"?](https://devblogs.microsoft.com/oldnewthing/20040714-00/?p=38443) (DPI) 762 | * [Drawing a monochrome bitmap with transparency](https://devblogs.microsoft.com/oldnewthing/20050803-16/?p=34733) 763 | * [Let GDI do your RLE compression for you](https://devblogs.microsoft.com/oldnewthing/20090408-00/?p=18603) 764 | * [The mysterious stock bitmap: There's no way to summon it, but it shows up in various places](https://devblogs.microsoft.com/oldnewthing/20100416-00/?p=14313) 765 | * [Why is my icon being drawn at the wrong size when I call `DrawIcon`?](https://devblogs.microsoft.com/oldnewthing/20100729-00/?p=13293) 766 | * [You must flush GDI operations when switching between direct access and GDI access, and direct access includes other parts of GDI](https://devblogs.microsoft.com/oldnewthing/20100923-00/?p=12773) 767 | * [How do I get the dimensions of a cursor or icon?](https://devblogs.microsoft.com/oldnewthing/20101020-00/?p=12493) 768 | * [What are the dire consequences of not selecting objects out of my DC?](https://devblogs.microsoft.com/oldnewthing/20130306-00/?p=5043) 769 | * [Of what use is the `RDW_INTERNALPAINT` flag?](https://devblogs.microsoft.com/oldnewthing/20130621-00/?p=4023) 770 | * [Functions that return GDI regions rarely actually return regions](https://devblogs.microsoft.com/oldnewthing/20140327-00/?p=1383) 771 | * [Color-aware ClearType requires access to fixed background pixels, which is a problem if you don't know what the background pixels are, or if they aren't fixed](https://devblogs.microsoft.com/oldnewthing/20150129-00/?p=44803) 772 | * [What is the correct way of using `SaveDC` and `RestoreDC`?](https://devblogs.microsoft.com/oldnewthing/20170920-00/?p=97055) 773 | * [How are `BitBlt` raster opcodes calculated?](https://devblogs.microsoft.com/oldnewthing/20180528-00/?p=98845) 774 | * [Notes on `DrawText` and tab stops](https://devblogs.microsoft.com/oldnewthing/20181010-00/?p=99935) 775 | * [Why doesn’t `GetTextExtentPoint` return the correct extent for strings containing tabs?](https://devblogs.microsoft.com/oldnewthing/20181012-00/?p=99955) 776 | * [Why are there trivial functions like `Copy­Rect` and `Equal­Rect`?](https://devblogs.microsoft.com/oldnewthing/20200224-00/?p=103472) 777 | * [More on trivial functions like `CopyRect` and `EqualRect`](https://devblogs.microsoft.com/oldnewthing/20200901-00/?p=104147) 778 | * [What are the consequences of increasing the per-process GDI handle limit?](https://devblogs.microsoft.com/oldnewthing/20210831-00/?p=105624) 779 | * [The focus rectangle says, “I’m not orange. I’m just drawn that way.”](https://devblogs.microsoft.com/oldnewthing/20211102-00/?p=105866) 780 | 781 | ### Cursors 782 | * [The effect of `SetCursor` lasts only until the next `SetCursor`](https://devblogs.microsoft.com/oldnewthing/20050525-27/?p=35543) 783 | * [What can or should I do with the cursor handle returned by `SetCursor`?](https://devblogs.microsoft.com/oldnewthing/20221026-00/?p=107325) 784 | * [What is the deal with the `SM_CXCURSOR` system metric?](https://devblogs.microsoft.com/oldnewthing/20210819-00/?p=105572) 785 | * [How do I find out the size of the mouse cursor?](https://devblogs.microsoft.com/oldnewthing/20210820-00/?p=105593) 786 | 787 | ### Brushes 788 | * [The hollow brush](https://devblogs.microsoft.com/oldnewthing/20040126-00/?p=40903) 789 | * [Other uses for bitmap brushes](https://devblogs.microsoft.com/oldnewthing/20031009-00/?p=42213) 790 | * [What is the DC brush good for?](https://devblogs.microsoft.com/oldnewthing/20050420-28/?p=35843) 791 | * [I know I can change the color of the DC pen, but what about the other attributes?](https://devblogs.microsoft.com/oldnewthing/20210721-00/?p=105467) 792 | * [How can I extract the color from a solid color GDI brush?](https://devblogs.microsoft.com/oldnewthing/20190802-00/?p=102747) 793 | 794 | ### Pens 795 | * [Is there a difference between creating a null pen with `Create­Pen` and just using the stock null pen?](https://devblogs.microsoft.com/oldnewthing/20200127-00/?p=103368) 796 | 797 | ### Bitmaps 798 | * [How do I set the alpha channel of a GDI bitmap to 255?](https://devblogs.microsoft.com/oldnewthing/20210915-00/?p=105687) 799 | 800 | ### DIB 801 | * [A survey of the various ways of creating GDI bitmaps with predefined data](https://devblogs.microsoft.com/oldnewthing/20170331-00/?p=95875) 802 | * [Blitting between color and monochrome DCs](https://devblogs.microsoft.com/oldnewthing/20061114-01/?p=29013) 803 | * [Manipulating the DIB color table for fun and profit](https://devblogs.microsoft.com/oldnewthing/20061115-01/?p=28993) 804 | * [Using DIB sections to perform bulk color mapping](https://devblogs.microsoft.com/oldnewthing/?p=28983) 805 | * [The fun and profit of manipulating the DIB color table can be done without having to modify it](https://devblogs.microsoft.com/oldnewthing/20090714-00/?p=17503) 806 | * [Separating the metadata from the DIB pixels: Precalculating the `BITMAPINFO`](https://devblogs.microsoft.com/oldnewthing/20090715-00/?p=17483) 807 | * [Separating the metadata from the DIB pixels: Changing the raster operation](https://devblogs.microsoft.com/oldnewthing/20090716-00/?p=17463) 808 | * [The disembodiment of DIBs from the DIB section](https://devblogs.microsoft.com/oldnewthing/20090717-00/?p=17443) 809 | * [What is the `hSection` parameter to `CreateDIBSection` for?](https://devblogs.microsoft.com/oldnewthing/20100108-00/?p=15343) 810 | 811 | ### `LockWindowUpdate()` 812 | * [What does `LockWindowUpdate` do?](https://devblogs.microsoft.com/oldnewthing/20070219-00/?p=27963) 813 | * [How is `LockWindowUpdate` meant to be used?](https://devblogs.microsoft.com/oldnewthing/20070220-07/?p=27953) 814 | * [With what operations is `LockWindowUpdate` meant to be used?](https://devblogs.microsoft.com/oldnewthing/20070221-11/?p=27933) 815 | * [With what operations is `LockWindowUpdate` not meant to be used?](https://devblogs.microsoft.com/oldnewthing/20070222-01/?p=27913) 816 | * [Final remarks on `LockWindowUpdate`](https://devblogs.microsoft.com/oldnewthing/20070223-00/?p=27893) 817 | 818 | ### Painting Standard Elements 819 | * [Rendering standard Windows elements](https://devblogs.microsoft.com/oldnewthing/20050801-11/?p=34763) 820 | * [Rendering menu glyphs is slightly trickier](https://devblogs.microsoft.com/oldnewthing/20050802-13/?p=34743) 821 | * [What states are possible in a `DRAWITEMSTRUCT` structure?](https://devblogs.microsoft.com/oldnewthing/20141211-00/?p=43423) 822 | 823 | ### `UXTHEME.DLL` 824 | * [`BeginBufferedPaint`: It's not just for buffered painting any more](https://devblogs.microsoft.com/oldnewthing/20110520-00/?p=10613) 825 | * [How do `IsThemeActive`, `IsAppThemed`, and `IsCompositionActive` differ?](https://devblogs.microsoft.com/oldnewthing/20110526-00/?p=10563) 826 | * [How do I get the tabbed dialog effect on my own custom tabbed dialog?](https://devblogs.microsoft.com/oldnewthing/20121105-00/?p=6173) 827 | * [How do I revert a control back to its default theme?](https://devblogs.microsoft.com/oldnewthing/20181115-00/?p=100225) 828 | 829 | ### Multiple Monitors 830 | * [For better performance, set all your monitors to the same color format](https://devblogs.microsoft.com/oldnewthing/20100208-00/?p=15023) 831 | * [How do I get a handle to the primary monitor?](https://devblogs.microsoft.com/oldnewthing/20070809-00/?p=25643) 832 | * [Why does the primary monitor have `(0,0)` as its upper left coordinate?](https://devblogs.microsoft.com/oldnewthing/20100820-00/?p=13093) 833 | * [How do I get the color depth of the screen?](https://devblogs.microsoft.com/oldnewthing/20101013-00/?p=12543) 834 | * [How does the window manager adjust `ptMaxSize` and `ptMaxPosition` for multiple monitors?](https://devblogs.microsoft.com/oldnewthing/20150501-00/?p=44964) 835 | 836 | 837 | ## Accessibility 838 | 839 | * [Accessibility is not just for people with disabilities](https://devblogs.microsoft.com/oldnewthing/?p=30093) 840 | * [How to retrieve text under the cursor (mouse pointer)](https://devblogs.microsoft.com/oldnewthing/20130408-00/?p=4733) 841 | * [How do I set an accessible name on an unlabeled control?](https://devblogs.microsoft.com/oldnewthing/20111013-00/?p=9393) 842 | * [How can I get notified when some other window is destroyed?](https://devblogs.microsoft.com/oldnewthing/20111026-00/?p=9263) 843 | * [Using accessibility to monitor windows as they come and go](https://devblogs.microsoft.com/oldnewthing/20130325-00/?p=4863) 844 | * [How can I write a program that monitors another window for a title change?](https://devblogs.microsoft.com/oldnewthing/20180601-00/?p=98895) 845 | * [How can I write a program that monitors another window for a change in size or position?](https://devblogs.microsoft.com/oldnewthing/20210104-00/?p=104656) 846 | 847 | 848 | ## COM 849 | 850 | ### Declaring COM Interfaces 851 | * [The macros for declaring COM interfaces, revisited: C version](https://devblogs.microsoft.com/oldnewthing/20200909-00/?p=104198) 852 | * [The macros for declaring COM interfaces, revisited: C++ version](https://devblogs.microsoft.com/oldnewthing/20200910-00/?p=104203) 853 | * [The macros for declaring COM interfaces, revisited: C++ implementation](https://devblogs.microsoft.com/oldnewthing/20200911-00/?p=104205) 854 | * [The oracle always tells the truth, even when it is wrong: COM method calls with a user-defined type as a return value](https://devblogs.microsoft.com/oldnewthing/20220113-00/?p=106152) (on problems of COM interfaces called from C code) 855 | * [The COM interface contract rules exist for a reason](https://devblogs.microsoft.com/oldnewthing/20051101-54/?p=33533) 856 | * [Giving a single object multiple COM identities, part 1](https://devblogs.microsoft.com/oldnewthing/20211026-00/?p=105834) 857 | * [Giving a single object multiple COM identities, part 2](https://devblogs.microsoft.com/oldnewthing/20211027-00/?p=105838) 858 | * [Giving a single object multiple COM identities, part 3](https://devblogs.microsoft.com/oldnewthing/20211028-00/?p=105852) 859 | * [Giving a single object multiple COM identities, part 4](https://devblogs.microsoft.com/oldnewthing/20211029-00/?p=105859) 860 | * [How do I consume raw COM interfaces from a Windows Runtime metadata file?](https://devblogs.microsoft.com/oldnewthing/20220908-00/?p=107137) 861 | 862 | 863 | ### COM Apartments 864 | * [The dreaded "main" threading model](https://devblogs.microsoft.com/oldnewthing/20040602-00/?p=39053) 865 | * [A slightly less brief introduction to COM apartments (but it’s still brief)](https://devblogs.microsoft.com/oldnewthing/20191125-00/?p=103135) 866 | * [Yo dawg, I hear you like COM apartments, so I put a COM apartment in your COM apartment so you can COM apartment while you COM apartment](https://devblogs.microsoft.com/oldnewthing/20191126-00/?p=103140) 867 | * [What kind of apartment is the private apartment I created via `CLSID_Context­Switcher`?](https://devblogs.microsoft.com/oldnewthing/20200422-00/?p=103694) 868 | * [Setting up private COM contexts to allow yourself to unload cleanly](https://devblogs.microsoft.com/oldnewthing/20191127-00/?p=103153) 869 | * [How do you get into a context via `IContext­Callback::Context­Callback`?](https://devblogs.microsoft.com/oldnewthing/20191128-00/?p=103157) 870 | * [Using contexts to return to a COM apartment later](https://devblogs.microsoft.com/oldnewthing/20191129-00/?p=103162) 871 | * [What do the output values from `CoGetApartmentType` mean?](https://devblogs.microsoft.com/oldnewthing/20180208-00/?p=97986) 872 | * [User interface code + multi-threaded apartment = death](https://devblogs.microsoft.com/oldnewthing/?p=22603) 873 | * [Other problems traced to violating COM single-threaded apartment rules in the shell](https://devblogs.microsoft.com/oldnewthing/20071019-00/?p=24733) 874 | * [What’s the point of `APTTYPE_CURRENT`? I mean, of course I’m current.](https://devblogs.microsoft.com/oldnewthing/20201105-00/?p=104422) 875 | * [How do I get a foothold in the neutral apartment?](https://devblogs.microsoft.com/oldnewthing/20210205-00/?p=104801) 876 | * [What is so special about the Application STA?](https://devblogs.microsoft.com/oldnewthing/20210224-00/?p=104901) 877 | * [What does it mean when a call fails with `0x8000001F = RO_E_BLOCKED_CROSS_ASTA_CALL`?](https://devblogs.microsoft.com/oldnewthing/20210225-00/?p=104908) 878 | 879 | ### COM Initialization 880 | * [What does the `COINIT_SPEED_OVER_MEMORY` flag to `CoInitializeEx` do?](https://devblogs.microsoft.com/oldnewthing/20121108-00/?p=6143) 881 | * [Crashing in COM after I call `CoUninitialize`, how can COM be running after it is uninitalized?](https://devblogs.microsoft.com/oldnewthing/20200129-00/?p=103380) 882 | 883 | ### COM Static Store 884 | * [The COM static store, part 1: Introduction](https://devblogs.microsoft.com/oldnewthing/20210208-00/?p=104812) 885 | * [The COM static store, part 2: Race conditions in setting a singleton](https://devblogs.microsoft.com/oldnewthing/20210209-00/?p=104835) 886 | * [The COM static store, part 3: Avoiding creation of an expensive temporary when setting a singleton](https://devblogs.microsoft.com/oldnewthing/20210210-06/?p=104839) 887 | * [The COM static store, part 4: Aggregating into a single object](https://devblogs.microsoft.com/oldnewthing/20210211-00/?p=104845) 888 | * [The COM static store, part 5: Using COM weak references](https://devblogs.microsoft.com/oldnewthing/20210212-00/?p=104847) 889 | * [The COM static store, part 6: Using C++ weak references](https://devblogs.microsoft.com/oldnewthing/20210215-00/?p=104865) 890 | 891 | ### COM Marshaling 892 | * [What is COM marshaling and how do I use it?](https://devblogs.microsoft.com/oldnewthing/20151020-00/?p=91321) 893 | * [On proper handling of buffers in COM and RPC methods](https://devblogs.microsoft.com/oldnewthing/20210715-00/?p=105446) 894 | * [What are the rules for `CoMarshalInterThreadInterfaceInStream` and `CoGetInterfaceAndReleaseStream`?](https://devblogs.microsoft.com/oldnewthing/20151021-00/?p=91311) 895 | * [What are the rules for `CoMarshalInterface` and `CoUnmarshalInterface`?](https://devblogs.microsoft.com/oldnewthing/20151022-00/?p=91301) 896 | * [`CoGetInterfaceAndReleaseStream` does not mix with smart pointers](https://devblogs.microsoft.com/oldnewthing/20151023-00/?p=91291) 897 | * [The COM marshaller uses the COM task allocator to allocate and free memory](https://devblogs.microsoft.com/oldnewthing/20090923-00/?p=16613) 898 | * [Why do I get a `QueryInterface(IID_IMarshal)` and then nothing?](https://devblogs.microsoft.com/oldnewthing/20040220-00/?p=40533) 899 | * [We batched up our COM requests and return a single stream of results, but the performance is still slow](https://devblogs.microsoft.com/oldnewthing/20160212-00/?p=93013) 900 | * [What are the various usage patterns for manually-marshaled interfaces?](https://devblogs.microsoft.com/oldnewthing/20220614-00/?p=106750) 901 | * [An initial look at the mechanics of how COM marshaling is performed](https://devblogs.microsoft.com/oldnewthing/20220615-00/?p=106753) 902 | * [https://devblogs.microsoft.com/oldnewthing/20220616-00/?p=106757](https://devblogs.microsoft.com/oldnewthing/20220616-00/?p=106757) 903 | * [Writing a marshal-by-value marshaler, part 1](https://devblogs.microsoft.com/oldnewthing/20220617-41/?p=106760) 904 | * [Writing a marshal-by-value marshaler, part 2](https://devblogs.microsoft.com/oldnewthing/20220623-00/?p=106778) 905 | * [Writing a compound marshaler](https://devblogs.microsoft.com/oldnewthing/20220621-00/?p=106767) 906 | * [Understanding the marshaling flags: The free-threaded marshaler](https://devblogs.microsoft.com/oldnewthing/20220622-00/?p=106774) 907 | 908 | ### COM Error Handling 909 | * [What happens to my COM server-side object when clients die unexpectedly?](https://devblogs.microsoft.com/oldnewthing/20140409-00/?p=1293) 910 | * [Why does COM require output pointers to be initialized even on failure?](https://devblogs.microsoft.com/oldnewthing/20091231-00/?p=15463) 911 | * [How do I convert an `HRESULT` to a Win32 error code?](https://devblogs.microsoft.com/oldnewthing/20061103-07/?p=29133) 912 | * [How can I tell the WIL `RETURN_IF_FAILED` macro that some errors are ignorable?](https://devblogs.microsoft.com/oldnewthing/20220414-00/?p=106483) 913 | * [Do not overload the `E_NOINTERFACE` error](https://devblogs.microsoft.com/oldnewthing/20061208-00/?p=28783) 914 | * [What does it mean when a call fails with `0x8000001F = RO_E_BLOCKED_CROSS_ASTA_CALL`?](https://devblogs.microsoft.com/oldnewthing/20210225-00/?p=104908) 915 | * [What does it mean when my cross-thread COM call fails with `RPC_E_SYS_CALL_FAILED`? 916 | ](https://devblogs.microsoft.com/oldnewthing/20230216-00/?p=107836) 917 | * [Understanding a mysterious `RPC_E_WRONG­THREAD` exception when we’re on the right thread](https://devblogs.microsoft.com/oldnewthing/20230224-37/?p=107870) 918 | 919 | ### COM Asynchronous Interfaces 920 | * [COM asynchronous interfaces, part 1: The basic pattern](https://devblogs.microsoft.com/oldnewthing/20220214-44/?p=106251) 921 | * [COM asynchronous interfaces, part 2: Abandoning the operation](https://devblogs.microsoft.com/oldnewthing/20220215-00/?p=106253) 922 | * [COM asynchronous interfaces, part 3: Abandoning the operation after a timeout](https://devblogs.microsoft.com/oldnewthing/20220216-00/?p=106261) 923 | * [COM asynchronous interfaces, part 4: Doing work while waiting for the asynchronous operation](https://devblogs.microsoft.com/oldnewthing/20220217-00/?p=106263) 924 | * [COM asynchronous interfaces, part 5: The unreliable server](https://devblogs.microsoft.com/oldnewthing/20220218-00/?p=106272) 925 | * [COM asynchronous interfaces, part 6: Learning about completion without polling](https://devblogs.microsoft.com/oldnewthing/20220221-42/?p=106275) 926 | * [COM asynchronous interfaces, part 7: Being called directly when the operation completes](https://devblogs.microsoft.com/oldnewthing/20220222-00/?p=106279) 927 | * [COM asynchronous interfaces, part 8: Asynchronous release, the problems](https://devblogs.microsoft.com/oldnewthing/20220223-00/?p=106282) 928 | * [COM asynchronous interfaces, part 9: Asynchronous release, assembling a solution](https://devblogs.microsoft.com/oldnewthing/20220224-00/?p=106288) 929 | 930 | ### GUIDs 931 | * [What's the difference between `UuidFromString`, `IIDFromString`, `CLSIDFromString`, `GUIDFromString`...](https://devblogs.microsoft.com/oldnewthing/20151015-00/?p=91351) 932 | * [What is the difference between `UuidToString`, `StringFromCLSID`, `StringFromIID`, and `StringFromGUID2`?](https://devblogs.microsoft.com/oldnewthing/20231113-00/?p=109011) 933 | * [Why are there four functions for parsing strings into GUIDs, and why are they in three different DLLs?](https://devblogs.microsoft.com/oldnewthing/20160331-00/?p=93231) 934 | * [Why does COM express GUIDs in a mix of big-endian and little-endian? Why can’t it just pick a side and stick with it?](https://devblogs.microsoft.com/oldnewthing/20220928-00/?p=107221) 935 | 936 | ### COM Strings 937 | * [Why is there a `BSTR` cache anyway?](https://devblogs.microsoft.com/oldnewthing/20150107-00/?p=43203) 938 | * [Raymond’s complete guide to `HSTRING` semantics](https://devblogs.microsoft.com/oldnewthing/20160615-00/?p=93675) 939 | * [What is the correct way of using the string buffer returned by the `WindowsPreallocateStringBuffer` function?](https://devblogs.microsoft.com/oldnewthing/20170913-00/?p=97015) 940 | 941 | ### COM Variants 942 | * [What’s the difference between `VARIANT` and `VARIANTARG`?](https://devblogs.microsoft.com/oldnewthing/20171221-00/?p=97625) 943 | * [Nasty gotcha: `VarCmp` vs `VariantCompare`](https://devblogs.microsoft.com/oldnewthing/20160218-00/?p=93051) 944 | * [Why can’t `VarDateFromStr` parse back a Hungarian date that was generated by `VarBstrFromDate`?](https://devblogs.microsoft.com/oldnewthing/20161219-00/?p=94965) 945 | 946 | ### `IUnknown` 947 | * [The layout of a COM object](https://devblogs.microsoft.com/oldnewthing/20040205-00/?p=40733) 948 | * [Under what conditions will the `IUnknown::AddRef` method return 0?](https://devblogs.microsoft.com/oldnewthing/20150312-00/?p=44483) 949 | * [The ways people mess up `IUnknown::QueryInterface`](https://devblogs.microsoft.com/oldnewthing/20040326-00/?p=40033) 950 | * [The ways people mess up `IUnknown::QueryInterface`, episode 2](https://devblogs.microsoft.com/oldnewthing/20090925-00/?p=16583) 951 | * [The ways people mess up `IUnknown::QueryInterface`, episode 3](https://devblogs.microsoft.com/oldnewthing/20091007-00/?p=16463) 952 | * [The ways people mess up `IUnknown::QueryInterface`, episode 4](https://devblogs.microsoft.com/oldnewthing/20110811-00/?p=9923) 953 | * [COM object destructors are very sensitive functions](https://devblogs.microsoft.com/oldnewthing/20050927-13/?p=34023) 954 | * [Avoiding double-destruction when an object is released](https://devblogs.microsoft.com/oldnewthing/20050928-10/?p=34013) 955 | * [I’d like an `IUnknown`, I know you have many, I’ll take any of them](https://devblogs.microsoft.com/oldnewthing/20210101-00/?p=104639) 956 | * [A very brief introduction to patterns for implementing a COM object that hands out references to itself](https://devblogs.microsoft.com/oldnewthing/20211025-00/?p=105828) 957 | * [Giving a single object multiple COM identities, part 1](https://devblogs.microsoft.com/oldnewthing/20211026-00/?p=105834) 958 | * [Giving a single object multiple COM identities, part 2](https://devblogs.microsoft.com/oldnewthing/20211027-00/?p=105838) 959 | * [Giving a single object multiple COM identities, part 3](https://devblogs.microsoft.com/oldnewthing/20211028-00/?p=105852) 960 | * [Giving a single object multiple COM identities, part 4](https://devblogs.microsoft.com/oldnewthing/20211029-00/?p=105859) 961 | * [Reducing chattiness by querying for multiple interfaces at once, part 1](https://devblogs.microsoft.com/oldnewthing/20220315-00/?p=106350) 962 | * [Reducing chattiness by querying for multiple interfaces at once, part 2](https://devblogs.microsoft.com/oldnewthing/20220316-00/?p=106353) 963 | 964 | 965 | ### `IMoniker` 966 | * [Pidls and monikers do roughly the same thing, just backwards](https://devblogs.microsoft.com/oldnewthing/20060712-17/?p=30543) 967 | 968 | ### `ICallback` 969 | * [A very brief introduction to patterns for implementing a COM object that hands out references to itself](https://devblogs.microsoft.com/oldnewthing/20211025-00/?p=105828) 970 | 971 | ### `IContextMenu` 972 | * [Why an object cannot be its own enumerator](https://devblogs.microsoft.com/oldnewthing/20040322-00/?p=40143) 973 | * [How to host an `IContextMenu`, part 1 - Initial foray](https://devblogs.microsoft.com/oldnewthing/20040920-00/?p=37823) 974 | * [How to host an `IContextMenu`, part 2 - Displaying the context menu](https://devblogs.microsoft.com/oldnewthing/20040922-00/?p=37793) 975 | * [How to host an `IContextMenu`, part 3 - Invocation location](https://devblogs.microsoft.com/oldnewthing/20040923-00/?p=37773) 976 | * [How to host an `IContextMenu`, part 4 - Key context](https://devblogs.microsoft.com/oldnewthing/20040924-00/?p=37753) 977 | * [How to host an `IContextMenu`, part 5 - Handling menu messages](https://devblogs.microsoft.com/oldnewthing/20040927-00/?p=37733) 978 | * [How to host an `IContextMenu`, part 6 - Displaying menu help](https://devblogs.microsoft.com/oldnewthing/20040928-00/?p=37723) 979 | * [How to host an `IContextMenu`, part 7 - Invoking the default verb](https://devblogs.microsoft.com/oldnewthing/20040930-00/?p=37693) 980 | * [How to host an `IContextMenu`, part 8 - Optimizing for the default command](https://devblogs.microsoft.com/oldnewthing/20041001-00/?p=37683) 981 | * [How to host an `IContextMenu`, part 9 - Adding custom commands](https://devblogs.microsoft.com/oldnewthing/20041004-00/?p=37673) 982 | * [How to host an `IContextMenu`, part 10 - Composite extensions - groundwork](https://devblogs.microsoft.com/oldnewthing/20041006-00/?p=37643) 983 | * [How to host an `IContextMenu`, part 11 - Composite extensions - composition](https://devblogs.microsoft.com/oldnewthing/20041007-00/?p=37633) 984 | * [Simplifying context menu extensions with `IExecuteCommand`](https://devblogs.microsoft.com/oldnewthing/20100312-01/?p=14623) 985 | * [How do I launch a file as if it were a text file, even though its extension is not `.txt`?](https://devblogs.microsoft.com/oldnewthing/20130213-00/?p=5253) 986 | * [Do not access the disk in your `IContextMenu` handler, no really, don't do it](https://devblogs.microsoft.com/oldnewthing/20111003-00/?p=9493) 987 | * [Sure, we do that: Context menu edition](https://devblogs.microsoft.com/oldnewthing/20120516-00/?p=7613) 988 | * [Psychic debugging: Why your `IContextMenu::InvokeCommand` doesn't get called even though you returned success from `IContextMenu::QueryContextMenu`](https://devblogs.microsoft.com/oldnewthing/20130201-00/?p=5383) 989 | * [Don’t forget to implement canonical names for verbs in your shell context menu extension](https://devblogs.microsoft.com/oldnewthing/20170302-00/?p=95635) 990 | 991 | ### `IFileDialog` 992 | * [The `SetClientGuid` method of the common file and folder dialogs lets you give names to those dialogs, too](https://devblogs.microsoft.com/oldnewthing/20200527-00/?p=103801) (multiple contexts for open/save dialogs) 993 | * [How can I get my `FileSavePicker` to open in the same folder that was picked by the `FileOpenPicker` or `FolderPicker`?](https://devblogs.microsoft.com/oldnewthing/20220525-00/?p=106685) (win32/COM equivalent mentioned at the end of the post) 994 | * [Why does IFileDialog still show non-filesystem folders when I pass `FOS_FORCE­FILE­SYSTEM`?](https://devblogs.microsoft.com/oldnewthing/20231011-00/?p=108884) 995 | 996 | 997 | ### `IMultiLanguage` 998 | * [Converting between `LCID`s and RFC 1766 language codes](https://devblogs.microsoft.com/oldnewthing/20060105-00/?p=32753) 999 | * [Feel free to stop using `IMultiLanguage2::DetectInputCodepage`](https://devblogs.microsoft.com/oldnewthing/20221003-00/?p=107241) 1000 | 1001 | 1002 | ### `INamespaceWalk` 1003 | * [How can I control which parts of the shell namespace the `INamespaceWalk::Walk` operation will walk into?](https://devblogs.microsoft.com/oldnewthing/20171108-00/?p=97365) 1004 | * [How can I cancel the `INamespace­Walk::Walk` operation?](https://devblogs.microsoft.com/oldnewthing/20171109-00/?p=97375) 1005 | * [Cancelling the `INamespace­Walk::Walk` operation a little faster](https://devblogs.microsoft.com/oldnewthing/20171110-00/?p=97385) 1006 | 1007 | ### `IStream` 1008 | * [The subtleties of `Create­Stream­On­HGlobal`, part 1: Introduction and basic usage](https://devblogs.microsoft.com/oldnewthing/20210928-00/?p=105737) 1009 | * [The subtleties of `Create­Stream­On­HGlobal`, part 2: Suppressing the deletion of an unknown `HGLOBAL`](https://devblogs.microsoft.com/oldnewthing/20210929-00/?p=105742) 1010 | * [The subtleties of `Create­Stream­On­HGlobal`, part 3: Suppressing the deletion of a shared `HGLOBAL`](https://devblogs.microsoft.com/oldnewthing/20210930-00/?p=105745) 1011 | * [The subtleties of `Create­Stream­On­HGlobal`, part 4: Non-movable memory](https://devblogs.microsoft.com/oldnewthing/20211001-00/?p=105748) 1012 | * [A practical use for `GetHGlobal­FromStream` when sharing was never your intention](https://devblogs.microsoft.com/oldnewthing/20211115-00/?p=105922) 1013 | 1014 | ### `IVirtual­Desktop­Manager` 1015 | * [Virtual desktops are an end-user window management feature, not a programmatic one](https://devblogs.microsoft.com/oldnewthing/20201123-00/?p=104476) 1016 | 1017 | ### Clipboard 1018 | * [How ownership of the Windows clipboard is tracked in Win32](https://devblogs.microsoft.com/oldnewthing/20210526-00/?p=105252) 1019 | * [What happens when applications try to copy text by sending `Ctrl+C`](https://devblogs.microsoft.com/oldnewthing/20110623-00/?p=10353) 1020 | * [How do I make it so that users can copy static text on a dialog box to the clipboard easily?](https://devblogs.microsoft.com/oldnewthing/20120301-00/?p=8193) 1021 | * [What is the proper handling of `WM_RENDERFORMAT` and `WM_RENDERALLFORMATS`?](https://devblogs.microsoft.com/oldnewthing/20121224-00/?p=5763) 1022 | * [Copying a file to the clipboard so you can paste it into Explorer or an email message or whatever](https://devblogs.microsoft.com/oldnewthing/20130520-00/?p=4313) 1023 | * [Printing the contents of the clipboard as text to `stdout`](https://devblogs.microsoft.com/oldnewthing/20131007-00/?p=3023) 1024 | * [Improving the performance of `CF_HDROP` by providing file attribute information](https://devblogs.microsoft.com/oldnewthing/20140609-00/?p=783) 1025 | * [What’s up with the `CF_SYLK` and `CF_DIF` clipboard formats?](https://devblogs.microsoft.com/oldnewthing/20200226-00/?p=103489) 1026 | * [How can I wait more than 30 seconds for a delay-rendered clipboard format to become rendered?](https://devblogs.microsoft.com/oldnewthing/20220609-00/?p=106731) 1027 | 1028 | ### Drag and Drop 1029 | * [What a drag: Dragging text](https://devblogs.microsoft.com/oldnewthing/20080311-00/?p=23153) 1030 | * [What a drag: Dragging a Uniform Resource Locator (URL)](https://devblogs.microsoft.com/oldnewthing/?p=23133) 1031 | * [What a drag: Dragging a Uniform Resource Locator (URL) and text](https://devblogs.microsoft.com/oldnewthing/20080313-00/?p=23123) 1032 | * [What a drag: Dragging a virtual file (`HGLOBAL` edition)](https://devblogs.microsoft.com/oldnewthing/?p=23083) 1033 | * [What a drag: Dragging a virtual file (`IStream` edition)](https://devblogs.microsoft.com/oldnewthing/20080319-00/?p=23073) 1034 | * [What a drag: Dragging a virtual file (`IStorage` edition)](https://devblogs.microsoft.com/oldnewthing/20080320-00/?p=23063) 1035 | * [You can drag multiple virtual objects, you know](https://devblogs.microsoft.com/oldnewthing/20080331-00/?p=22933) 1036 | * [Reading a contract from the other side: Simulating a drop](https://devblogs.microsoft.com/oldnewthing/20080724-00/?p=21483) 1037 | * [Simulating a drop, part two](https://devblogs.microsoft.com/oldnewthing/20080725-00/?p=21473) 1038 | * [What happens if I drag the mouse by exactly the amount specified by `SM_CXDRAG`?](https://devblogs.microsoft.com/oldnewthing/20100304-00/?p=14733) 1039 | * [How do I accept files to be opened via `IDropTarget` instead of on the command line?](https://devblogs.microsoft.com/oldnewthing/20100503-00/?p=14183) 1040 | * [How do I accept files to be opened via `IDropTarget` instead of on the command line? - bonus content](https://devblogs.microsoft.com/oldnewthing/20100528-01/?p=13883) 1041 | * [Using Explorer’s fancy drag/drop effects in your own programs](https://devblogs.microsoft.com/oldnewthing/20210512-00/?p=105208) 1042 | * [Drag/drop effects: The little drop information box](https://devblogs.microsoft.com/oldnewthing/20210513-00/?p=105212) 1043 | * [Why isn’t my shell namespace extension getting every single `DragOver` mouse message?](https://devblogs.microsoft.com/oldnewthing/20210514-00/?p=105214) 1044 | * [Why doesn’t my program get fancy drag/drop effects in high contrast mode with `CLSID_Drag­Drop­Helper`?](https://devblogs.microsoft.com/oldnewthing/20240207-00/?p=109372) 1045 | 1046 | ### Enumeration 1047 | * [Using fibers to simplify enumerators, part 1: When life is easier for the enumerator](https://devblogs.microsoft.com/oldnewthing/20041229-00/?p=36853) 1048 | * [Using fibers to simplify enumerators, part 2: When life is easier for the caller](https://devblogs.microsoft.com/oldnewthing/20041230-00/?p=36843) 1049 | * [Using fibers to simplify enumerators, part 3: Having it both ways](https://devblogs.microsoft.com/oldnewthing/20041231-00/?p=36833) 1050 | * [Using fibers to simplify enumerators, part 4: Filtering](https://devblogs.microsoft.com/oldnewthing/20050103-00/?p=36823) 1051 | * [Using fibers to simplify enumerators, part 5: Composition](https://devblogs.microsoft.com/oldnewthing/20050104-00/?p=36813) 1052 | 1053 | ### Shell 1054 | * [When does `SHLoadInProc` unload a DLL?](https://devblogs.microsoft.com/oldnewthing/20040628-00/?p=38663) 1055 | * [What does `SHGFI_USEFILEATTRIBUTES` mean?](https://devblogs.microsoft.com/oldnewthing/20040601-00/?p=39073) 1056 | * [What's the difference between `SHGetMalloc`, `SHAlloc`, `CoGetMalloc`, and `CoTaskMemAlloc`](https://devblogs.microsoft.com/oldnewthing/20040705-00/?p=38573) 1057 | * [Querying information from an Explorer window](https://devblogs.microsoft.com/oldnewthing/20040720-00/?p=38393) 1058 | * [Execute a file as if it were a program, even though its extension is not `EXE`](https://devblogs.microsoft.com/oldnewthing/20140210-00/?p=1823) 1059 | * [How do I launch a file as if it were a text file, even though its extension is not `.txt`?](https://devblogs.microsoft.com/oldnewthing/20130213-00/?p=5253) 1060 | * [What does the `SEE_MASK_UNICODE` flag in `ShellExecuteEx` actually do?](https://devblogs.microsoft.com/oldnewthing/20140227-00/?p=1643) 1061 | * [Simple things you can do with the `ShellExecuteEx` function](https://devblogs.microsoft.com/oldnewthing/20041126-00/?p=37193) 1062 | * [What were `ShellExecute` hooks designed for?](https://devblogs.microsoft.com/oldnewthing/20080910-00/?p=20933) 1063 | * [Why does `ShellExecute` return `SE_ERR_ACCESSDENIED` for nearly everything?](https://devblogs.microsoft.com/oldnewthing/20121018-00/?p=6303) 1064 | * [How do I `ShellExecute` a file, but with a specific program instead of the default program?](https://devblogs.microsoft.com/oldnewthing/20171220-00/?p=97615) 1065 | * [What is the difference between `CSIDL_DESKTOP` and `CSIDL_DESKTOPDIRECTORY`?](https://devblogs.microsoft.com/oldnewthing/20090730-00/?p=17293) 1066 | * [`SHCIDS_CANONICALONLY` is the moral equivalent in the shell namespace of the Unicode ordinal comparison](https://devblogs.microsoft.com/oldnewthing/20090807-00/?p=17193) 1067 | * [Don't forget to double-null-terminate those strings you pass to `SHFileOperation`](https://devblogs.microsoft.com/oldnewthing/20100218-00/?p=14893) 1068 | * [Why does `SHFileOperation` have internal error codes for DVD?](https://devblogs.microsoft.com/oldnewthing/20100322-00/?p=14533) 1069 | * [Why do non-folders in my shell namespace extension show up in the folder tree view?](https://devblogs.microsoft.com/oldnewthing/20100402-00/?p=14413) 1070 | * [`SHAutoComplete` giveth, and `SHAutoComplete` taketh away](https://devblogs.microsoft.com/oldnewthing/20100521-00/?p=13963) 1071 | * [What is the `lpClass` member of `SHELLEXECUTEINFO` used for?](https://devblogs.microsoft.com/oldnewthing/20100701-00/?p=13543) 1072 | * [Some known folders cannot be moved, but others can, and you'll just have to accept that](https://devblogs.microsoft.com/oldnewthing/20100806-00/?p=13213) 1073 | * [One possible reason why `ShellExecute` returns `SE_ERR_ACCESSDENIED` and `ShellExecuteEx` returns `ERROR_ACCESS_DENIED`](https://devblogs.microsoft.com/oldnewthing/20101118-00/?p=12253) 1074 | * [Why does `SHGetSpecialFolderPath` take such a long time before returning a network error?](https://devblogs.microsoft.com/oldnewthing/20110105-00/?p=11823) 1075 | * [How do you obtain the icon for a shortcut without the shortcut overlay?](https://devblogs.microsoft.com/oldnewthing/20110127-00/?p=11653) (`SHGetFileInfo()`) 1076 | * [How can I get information about the items in the Recycle Bin?](https://devblogs.microsoft.com/oldnewthing/20110830-00/?p=9773) 1077 | * [Modernizing our simple program that retrieves information about the items in the Recycle Bin](https://devblogs.microsoft.com/oldnewthing/20110831-00/?p=9763) 1078 | * [Invoking commands on items in the Recycle Bin](https://devblogs.microsoft.com/oldnewthing/20110901-00/?p=9753) 1079 | * [How do I perform shell file operations while avoiding shell copy hooks?](https://devblogs.microsoft.com/oldnewthing/20120330-00/?p=7963) 1080 | * [Command line tool to manage Windows 7 Libraries, with source code](https://devblogs.microsoft.com/oldnewthing/20120828-01/?p=6743) (`IShellLibrary`) 1081 | * [`IShellFolder::BindToObject` is a high-traffic method; don't do any heavy lifting](https://devblogs.microsoft.com/oldnewthing/20120914-00/?p=6603) 1082 | * [Obtaining the parsing name (and pidl) for a random shell object](https://devblogs.microsoft.com/oldnewthing/20130204-00/?p=5363) 1083 | * [Creating a simple pidl: For the times you care enough to send the very fake](https://devblogs.microsoft.com/oldnewthing/20130503-00/?p=4463) 1084 | * [Creating a simple shell item, just as fake as a simple pidl](https://devblogs.microsoft.com/oldnewthing/20140519-00/?p=963) 1085 | * [Displaying a property sheet for multiple files](https://devblogs.microsoft.com/oldnewthing/20130617-00/?p=4073) 1086 | * [How do I get a high resolution icon for a file?](https://devblogs.microsoft.com/oldnewthing/20140120-00/?p=2043) 1087 | * [How do I extract an icon at a nonstandard size if `IExtractIcon::Extract` tells me to go jump in a lake?](https://devblogs.microsoft.com/oldnewthing/20140501-00?p=1103) 1088 | * [How do I read the "Double-click to open an item (single-click to select)" setting in Folder Options?](https://devblogs.microsoft.com/oldnewthing/20140825-00/?p=153) 1089 | * [The wonderful world of shell bind context strings](https://devblogs.microsoft.com/oldnewthing/20150122-00/?p=44853) 1090 | * [Helper functions to make shell bind contexts slightly more manageable](https://devblogs.microsoft.com/oldnewthing/20150123-00/?p=44843) 1091 | * [Customizing item enumeration with `IShellItem`](https://devblogs.microsoft.com/oldnewthing/20150126-00/?p=44833) 1092 | * [Customizing item enumeration with `IShellItem`, the old-fashioned way](https://devblogs.microsoft.com/oldnewthing/20150202-00/?p=44773) 1093 | * [How do I create an `IShellItemArray` from a bunch of file paths?](https://devblogs.microsoft.com/oldnewthing/20140314-00/?p=1503) 1094 | * [How do I invoke a verb on an `IShellItemArray`?](https://devblogs.microsoft.com/oldnewthing/20120920-00/?p=6553) 1095 | * [How does a shell namespace extension provide icons for virtual items that track the standard icons set by the user's file associations?](https://devblogs.microsoft.com/oldnewthing/20151009-00/?p=91401) 1096 | * [How do I get the user-customed name of My Computer or Recycle Bin?](https://devblogs.microsoft.com/oldnewthing/20151012-00/?p=91381) 1097 | * [How do I get the user-customized name of a mapped network drive?](https://devblogs.microsoft.com/oldnewthing/20151019-00/?p=91331) 1098 | * [Enumerating all the programs that can open a particular file extension](https://devblogs.microsoft.com/oldnewthing/20151130-00/?p=92191) 1099 | * [Enumerating all the programs that can launch a particular protocol](https://devblogs.microsoft.com/oldnewthing/20151207-00/?p=92341) 1100 | * [How do I register a command on the desktop background context menu? (And how do I remove one I don’t like?)](https://devblogs.microsoft.com/oldnewthing/20151208-00/?p=92342) 1101 | * [How can I get the canonical name for a known folder?](https://devblogs.microsoft.com/oldnewthing/20160208-00/?p=93001) 1102 | * [Peeking inside an `IShellItem` to see what it’s made of](https://devblogs.microsoft.com/oldnewthing/20160620-00/?p=93705) 1103 | * [Why does `SHGetKnownFolderPath` return `E_FAIL` for a known folder?](https://devblogs.microsoft.com/oldnewthing/20110209-00/?p=11543) 1104 | * [Why does `SHGetKnownFolderPath` fail when impersonating?](https://devblogs.microsoft.com/oldnewthing/20160601-00/?p=93555) 1105 | * [Why can’t I use `SHSetKnownFolderPath` to change the location of `FOLDERID_LocalAppData`?](https://devblogs.microsoft.com/oldnewthing/20200115-00/?p=103329) 1106 | * [How do I programmatically add a folder to my Documents library?](https://devblogs.microsoft.com/oldnewthing/20161107-00/?p=94655) 1107 | * [Why doesn’t `SHGetFileInfo` give me customized folder icons?](https://devblogs.microsoft.com/oldnewthing/20170501-00/?p=96075) 1108 | * [How can I detect that a shell item refers to a virtual folder, or to a file system inside a file?](https://devblogs.microsoft.com/oldnewthing/20171101-00/?p=97325) 1109 | * [Why is there a limit of 15 shell icon overlays?](https://devblogs.microsoft.com/oldnewthing/20190313-00/?p=101094) 1110 | * [The case of the `SHGet­Folder­Path(CSIDL_COMMON_DOCUMENTS)` that returned `ERROR_PATH_NOT_FOUND`](https://devblogs.microsoft.com/oldnewthing/20200520-00/?p=103775) 1111 | * [Why is the `HSHELL_WINDOWDESTROYED` notification raised when a window is hidden, even if it hasn’t been destroyed?](https://devblogs.microsoft.com/oldnewthing/20201228-00/?p=104610) 1112 | * [Why am I receiving `HCNE_UPDATEDIR` notifications that my code never generates?](https://devblogs.microsoft.com/oldnewthing/20210112-00/?p=104707) 1113 | * [Why am I receiving `SHCNE_UPDATE­DIR` notifications that my code never generates?](https://devblogs.microsoft.com/oldnewthing/20220923-00/?p=107209) 1114 | * [How can I get the original target of a shortcut without applying any 32-bit adjustments?](https://devblogs.microsoft.com/oldnewthing/20230208-00/?p=107807) 1115 | * [How does Explorer calculate the “Date” of a file?](https://devblogs.microsoft.com/oldnewthing/20230921-00/?p=108808) 1116 | 1117 | ### Uncategorized COM Stuff 1118 | * [The macros for declaring and implementing COM interfaces](https://devblogs.microsoft.com/oldnewthing/20041005-00/?p=37653) 1119 | * [An introduction to COM connection points](https://devblogs.microsoft.com/oldnewthing/20130611-00/?p=4113) 1120 | * [Dispatch interfaces as connection point interfaces](https://devblogs.microsoft.com/oldnewthing/20130612-00/?p=4103) 1121 | * [Adjustor thunks](https://devblogs.microsoft.com/oldnewthing/20040206-00/?p=40723) 1122 | * [What is the underlying object behind a COM interface pointer?](https://devblogs.microsoft.com/oldnewthing/20070424-00/?p=27143) 1123 | * [How to turn off the exception handler that COM "helpfully" wraps around your server](https://devblogs.microsoft.com/oldnewthing/20110120-00/?p=11713) 1124 | * [Shortcuts are serializable objects, which means that they can be stored in places other than just a file](https://devblogs.microsoft.com/oldnewthing/20110224-00/?p=11403) 1125 | * [Why does `IFileOperation` skip junctions even though I passed `FOFX_NOSKIPJUNCTIONS`?](https://devblogs.microsoft.com/oldnewthing/20110818-00/?p=9873) 1126 | * [Nasty gotcha: `STGM_READ | STGM_WRITE` does not grant read/write access](https://devblogs.microsoft.com/oldnewthing/20130719-00/?p=3763) 1127 | * [How can I get the list of programs the same way that Programs and Features gets it?](https://devblogs.microsoft.com/oldnewthing/20131230-00/?p=2233) 1128 | * [How do I obtain the computer manufacturer's name via C++?](https://devblogs.microsoft.com/oldnewthing/20140106-00/?p=2163) (`IWbemClassObject`) 1129 | * [The stream pointer position in `IDataObject::GetData` and `IDataObject::GetDataHere` is significant](https://devblogs.microsoft.com/oldnewthing/20140918-00/?p=44033) 1130 | * [The sad implementation history of COM component categories and why it means you have to click twice to see your newly-installed taskbar toolbar](https://devblogs.microsoft.com/oldnewthing/20171121-00/?p=97435) 1131 | * [How do I request that my out-of-process COM server run unelevated?](https://devblogs.microsoft.com/oldnewthing/20180905-00/?p=99655) 1132 | * [How can a desktop app use a Windows Runtime object that infers UI context from its thread? The `IInitializeWithWindow` pattern](https://devblogs.microsoft.com/oldnewthing/20190412-00/?p=102413) (`IInitialize­With­Window`) 1133 | * [How do I protect myself against a COM call that can hang? I’m already running the server out-of-process.](https://devblogs.microsoft.com/oldnewthing/20210122-00/?p=104750) 1134 | * [What can I do about timer build-up when waiting for COM outbound calls to complete?](https://devblogs.microsoft.com/oldnewthing/20211008-50/?p=105780) 1135 | * [Manipulating the positions of desktop icons](https://devblogs.microsoft.com/oldnewthing/20130318-00/?p=4933) 1136 | * [A reminder about the correct way of accessing and manipulating the position of icons on the desktop](https://devblogs.microsoft.com/oldnewthing/20211122-00/?p=105948) 1137 | * [The oracle always tells the truth, even when it is wrong: COM method calls with a user-defined type as a return value](https://devblogs.microsoft.com/oldnewthing/20220113-00/?p=106152) (on problems of COM interfaces called from C code) 1138 | * [Notes on COM aggregation: Obtaining a pointer to your aggregated partner without introducing a reference cycle](https://devblogs.microsoft.com/oldnewthing/20220210-00/?p=106243) 1139 | * [Notes on COM aggregation: How do you implement tear-offs in an aggregated object?](https://devblogs.microsoft.com/oldnewthing/20220211-00/?p=106246) 1140 | * [The theory behind the `IHttpFilter` interface](https://devblogs.microsoft.com/oldnewthing/20231117-00/?p=109028) 1141 | 1142 | 1143 | ## Memory 1144 | 1145 | * [Stupid memory-mapping tricks](https://devblogs.microsoft.com/oldnewthing/20031007-00/?p=42263) 1146 | * [Creating a shared memory block that can grow in size](https://devblogs.microsoft.com/oldnewthing/20150130-00/?p=44793) 1147 | * [Why do I have to pass a valid page protection value to `VirtualAlloc` even if it ignores it?](https://devblogs.microsoft.com/oldnewthing/20171227-00/?p=97656) 1148 | * [How can I include/exclude specific memory blocks in user-mode crash dumps?](https://devblogs.microsoft.com/oldnewthing/20181011-00/?p=99945) 1149 | * [`IsBadXxxPtr` should really be called CrashProgramRandomly](https://devblogs.microsoft.com/oldnewthing/20060927-07/?p=29563) (`IsBadWritePtr()` et al.) 1150 | * [A closer look at the stack guard page](https://devblogs.microsoft.com/oldnewthing/20220203-00/?p=106215) 1151 | * [The case of the stack overflow exception when the stack is nowhere near overflowing](https://devblogs.microsoft.com/oldnewthing/20220204-00/?p=106219) 1152 | * [How to allocate address space with a custom alignment or in a custom address region](https://devblogs.microsoft.com/oldnewthing/20231229-00/?p=109204) 1153 | 1154 | 1155 | ## Input and Output 1156 | 1157 | * [Mount points, volumes, and physical drives, oh my!](https://devblogs.microsoft.com/oldnewthing/20201019-00/?p=104380) 1158 | * [What's the difference between an asynchronous `PIPE_WAIT` pipe and a `PIPE_NOWAIT` pipe?](https://devblogs.microsoft.com/oldnewthing/20110114-00/?p=11753) 1159 | * [Be careful when redirecting both a process's `stdin` and `stdout` to pipes, for you can easily deadlock](https://devblogs.microsoft.com/oldnewthing/20110707-00/?p=10223) 1160 | * [Looking at the problem at the wrong level: Closing a process's `stdin`](https://devblogs.microsoft.com/oldnewthing/20110706-00/?p=10243) 1161 | * [`ReadDirectoryChangesW` reads directory changes, but what if the directory doesn't change?](https://devblogs.microsoft.com/oldnewthing/20110812-00/?p=9913) 1162 | * [How do `FILE_FLAG_SEQUENTIAL_SCAN` and `FILE_FLAG_RANDOM_ACCESS` affect how the operating system treats my file?](https://devblogs.microsoft.com/oldnewthing/20120120-00/?p=8493) 1163 | * [I used `FILE_FLAG_SEQUENTIAL_SCAN` but it didn’t seem to speed up my sequential scanning](https://devblogs.microsoft.com/oldnewthing/20221130-00/?p=107505) 1164 | * [You can use an `OVERLAPPED` structure with synchronous I/O, too](https://devblogs.microsoft.com/oldnewthing/20120405-00/?p=7923) 1165 | * [We're currently using `FILE_FLAG_NO_BUFFERING` and `FILE_FLAG_WRITE_THROUGH`, but we would like our `WriteFile` to go even faster](https://devblogs.microsoft.com/oldnewthing/20140306-00/?p=1583) 1166 | * [On using `ILE_FLAG_WRITE_THROUGH` and `FILE_FLAG_NO_BUFFERING` for memory-mapped files](https://devblogs.microsoft.com/oldnewthing/20200819-00/?p=104093) 1167 | * [On the interaction between the `FILE_FLAG_NO_BUFFERING` and `FILE_FLAG_WRITE_THROUGH` flags](https://devblogs.microsoft.com/oldnewthing/20210729-00/?p=105494) 1168 | * [Why does my synchronous overlapped `ReadFile` return `FALSE` when the end of the file is reached?](https://devblogs.microsoft.com/oldnewthing/20150121-00/?p=44863) 1169 | * [Why does `SetFileValidData` fail even though I enabled the `SE_MANAGE_VOLUME_NAME` privilege?](https://devblogs.microsoft.com/oldnewthing/20160603-00/?p=93565) 1170 | * [Is `GENERIC_ALL` equivalent to `GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE`?](https://devblogs.microsoft.com/oldnewthing/20170310-00/?p=95705) 1171 | * [`CancelIoEx` can cancel I/O on console input, which is kind of nice](https://devblogs.microsoft.com/oldnewthing/20150323-00/?p=44413) 1172 | * [`CancelIoEx` can cancel synchronous I/O, which is kind of nice](https://devblogs.microsoft.com/oldnewthing/20170928-00/?p=97105) 1173 | * [Why does `IsPathRelative` return `FALSE` for paths that are drive-relative?](https://devblogs.microsoft.com/oldnewthing/20180222-00/?p=98075) 1174 | * [The security check happens at the acquisition of the handle](https://devblogs.microsoft.com/oldnewthing/20200320-00/?p=103579) 1175 | * [Taking a shortcut: You can query properties from a volume, and it will forward to the physical drive](https://devblogs.microsoft.com/oldnewthing/20201022-00/?p=104391) 1176 | * [https://devblogs.microsoft.com/oldnewthing/20201023-00/?p=104395](https://devblogs.microsoft.com/oldnewthing/20201023-00/?p=104395) 1177 | * [How do I disassociate a thread from an I/O completion port?](https://devblogs.microsoft.com/oldnewthing/20210120-00/?p=104740) 1178 | * [Is it okay to call `Map­View­Of­File` on the same mapping handle simultaneously from different threads?](https://devblogs.microsoft.com/oldnewthing/20210702-00/?p=105392) 1179 | * [What are these dire multithreading consequences that the `GetFullPathName` documentation is trying to warn me about?](https://devblogs.microsoft.com/oldnewthing/20210816-00/?p=105562) 1180 | * [How can I force a `WriteFile` or `ReadFile` to complete synchronously or hang, in order to test something?](https://devblogs.microsoft.com/oldnewthing/20220425-00/?p=106526) 1181 | * [How can I perform a `CopyFile`, but also flush the file buffers before the destination handle is closed?](https://devblogs.microsoft.com/oldnewthing/20221007-00/?p=107261) 1182 | 1183 | ### Asynchronous Input and Output 1184 | * [Developing the method for taking advantage of the fact that the `OVERLAPPED` associated with asynchronous I/O is passed by address](https://devblogs.microsoft.com/oldnewthing/20101220-01/?p=11963) 1185 | * [Ready... cancel... wait for it! (part 1)](https://devblogs.microsoft.com/oldnewthing/20110202-00/?p=11613) 1186 | * [Ready... cancel... wait for it! (part 2)](https://devblogs.microsoft.com/oldnewthing/20110203-00/?p=11603) 1187 | * [Ready... cancel... wait for it! (part 3)](https://devblogs.microsoft.com/oldnewthing/20110204-00/?p=11583) 1188 | * [If you're waiting for I/O to complete, it helps if you actually have an I/O to begin with](https://devblogs.microsoft.com/oldnewthing/20110303-00/?p=11313) 1189 | * [Why does my asynchronous I/O complete synchronously?](https://devblogs.microsoft.com/oldnewthing/20110923-00/?p=9563) 1190 | * [If an asynchronous I/O completes synchronously, is the `hEvent` in the `OVERLAPPED` structure signaled anyway?](https://devblogs.microsoft.com/oldnewthing/20140206-00/?p=1853) 1191 | * [You can use an `OVERLAPPED` structure with synchronous I/O, too](https://devblogs.microsoft.com/oldnewthing/20120405-00/?p=7923) 1192 | * [Why does my synchronous overlapped `ReadFile` return `FALSE` when the end of the file is reached?](https://devblogs.microsoft.com/oldnewthing/20150121-00/?p=44863) 1193 | * [If I issue a second overlapped I/O operation without waiting for the first one to complete, are they still guaranteed to complete in order?](https://devblogs.microsoft.com/oldnewthing/20160205-00/?p=92981) 1194 | * [Why are my file write operations synchronous, even though I opened the file as `FILE_FLAG_OVERLAPPED`?](https://devblogs.microsoft.com/oldnewthing/20180725-00/?p=99335) 1195 | * [File-extending writes are not always synchronous, which is entirely within the contract](https://devblogs.microsoft.com/oldnewthing/20181019-00/?p=100015) 1196 | * [Why you might need additional control over the secret event hiding inside the file object](https://devblogs.microsoft.com/oldnewthing/20200221-00/?p=103466) 1197 | * [Why doesn’t my asynchronous read operation complete when I close the handle?](https://devblogs.microsoft.com/oldnewthing/20210730-00/?p=105501) 1198 | * [The mental model for `StartThreadpoolIo`](https://devblogs.microsoft.com/oldnewthing/20211117-00/?p=105933) 1199 | * [How can I force a `WriteFile` or `ReadFile` to complete synchronously or hang, in order to test something?](https://devblogs.microsoft.com/oldnewthing/20220425-00/?p=106526) 1200 | * [If I issue multiple overlapped I/O requests against the same region of a file, will they execute in the order I issued them?](https://devblogs.microsoft.com/oldnewthing/20221111-00/?p=107385) 1201 | * [What are the potentially-erroneous results if you don’t pass `NULL` as the `lpNumberOfBytesRead` when issuing overlapped I/O?](https://devblogs.microsoft.com/oldnewthing/20230215-00/?p=107832) 1202 | 1203 | ### Files and Directories 1204 | * [The Definitive Guide on Win32 to NT Path Conversion](http://googleprojectzero.blogspot.cz/2016/02/the-definitive-guide-on-win32-to-nt.html) 1205 | * [How can I tell that a directory is really a recycle bin?](https://devblogs.microsoft.com/oldnewthing/20080918-00/?p=20843) 1206 | * [How can I tell that a directory is weird and should be excluded from the user interface?](https://devblogs.microsoft.com/oldnewthing/20080919-00/?p=20833) 1207 | * [How do I get information about the target of a symbolic link?](https://devblogs.microsoft.com/oldnewthing/20100212-00/?p=14963) 1208 | * [How do I access a file without updating its last-access time?](https://devblogs.microsoft.com/oldnewthing/20111010-00/?p=9433) 1209 | * [How do I show the contents of a directory while respecting the user's preferences for hidden and super-hidden files as well as the user's language preferences?](https://devblogs.microsoft.com/oldnewthing/20140317-00/?p=1493) 1210 | * [You can use a file as a synchronization object, too](https://devblogs.microsoft.com/oldnewthing/20140905-00/?p=63) 1211 | * [How can I append to a file and know where it got written, even if the file is being updated by multiple processes?](https://devblogs.microsoft.com/oldnewthing/20151127-00/?p=92211) 1212 | * [The `FILE_FLAG_DELETE_ON_CLOSE` flag applies to the handle, also known as the file object, which is not the same as the file](https://devblogs.microsoft.com/oldnewthing/20160108-00/?p=92821) 1213 | * [How long do I have to keep the `SECURITY_ATTRIBUTES` and `SECURITY_DESCRIPTOR` structures valid after using them to create a file?](https://devblogs.microsoft.com/oldnewthing/20160520-00/?p=93497) 1214 | * [How do I create a directory where people can create subdirectories but cannot mess with those created by other users?](https://devblogs.microsoft.com/oldnewthing/20160524-00/?p=93515) 1215 | * [How can I tell whether a file is on a removable drive, a fixed drive, or a remote drive?](https://devblogs.microsoft.com/oldnewthing/20160602-00/?p=93556) 1216 | * [How can I tell whether a file is on an SSD?](https://devblogs.microsoft.com/oldnewthing/20201023-00/?p=104395) 1217 | * [Why does a non-recursive `Read­Directory­ChangesW` still report files created inside subdirectories?](https://devblogs.microsoft.com/oldnewthing/20180712-00/?p=99225) 1218 | * [The early history of Windows file attributes, and why there is a gap between System and Directory](https://devblogs.microsoft.com/oldnewthing/20180830-00/?p=99615) 1219 | * [Even if you open a file with GUID, you can still get its name, or at least one of its names](https://devblogs.microsoft.com/oldnewthing/20190410-00/?p=102408) (`GetFinalPathNameByHandle()`) 1220 | * [How do I get from a file path to the volume that holds it?](https://devblogs.microsoft.com/oldnewthing/20201020-00/?p=104385) 1221 | * [How do I get from a volume to the physical disk that holds it?](https://devblogs.microsoft.com/oldnewthing/20201021-00/?p=104387) 1222 | * [Renaming a file is a multi-step process, only one of which is changing the name of the file 1223 | ](https://devblogs.microsoft.com/oldnewthing/20211022-00/?p=105822) 1224 | * [How can I recognize file systems that don’t support 64-bit unique file identifiers?](https://devblogs.microsoft.com/oldnewthing/20220127-00/?p=106199) 1225 | * [How can I recognize whether two handles refer to the same underlying file?](https://devblogs.microsoft.com/oldnewthing/20220128-00/?p=106201) 1226 | 1227 | ### ACL 1228 | * [The `MoveSecurityAttributes` policy affects only how Explorer recalculates ACLs when a file is moved; everybody else is on their own](https://devblogs.microsoft.com/oldnewthing/20151014-00/?p=91361) 1229 | * [How to create a folder that inherits its parent’s ACL, and then overrides part of it](https://devblogs.microsoft.com/oldnewthing/20170223-00/?p=95545) 1230 | 1231 | 1232 | ## Security Permissions, Attributes and Identifiers 1233 | 1234 | * [The security check happens at the acquisition of the handle](https://devblogs.microsoft.com/oldnewthing/20200320-00/?p=103579) 1235 | * [What is the default security descriptor?](https://devblogs.microsoft.com/oldnewthing/20040312-00/?p=40273) 1236 | * [How do I convert a SID between binary and string forms?](https://devblogs.microsoft.com/oldnewthing/20150501-00/?p=40253) 1237 | * [What are these SIDs of the form `S-1-15-2-xxx`?](https://devblogs.microsoft.com/oldnewthing/20220502-00/?p=106550) 1238 | * [What are these SIDs of the form `S-1-15-3-xxx`?](https://devblogs.microsoft.com/oldnewthing/20220503-00/?p=106557) 1239 | * [An easy way to determine whether you have a particular file permission](https://devblogs.microsoft.com/oldnewthing/20040604-00/?p=39023) 1240 | * [What are the access rights and privileges that control changing ownership of an object?](https://devblogs.microsoft.com/oldnewthing/20050818-09/?p=34533) 1241 | * [How do the names in the file security dialog map to access control masks?](https://devblogs.microsoft.com/oldnewthing/20070726-00/?p=25833) 1242 | * [If you ask for `STANDARD_RIGHTS_REQUIRED`, you may as well ask for the moon](https://devblogs.microsoft.com/oldnewthing/20080227-00/?p=23303) 1243 | * [A user's SID can change, so make sure to check the SID history](https://devblogs.microsoft.com/oldnewthing/20141128-00/?p=43513) 1244 | * [Detecting whether a SID is well-known SID](https://devblogs.microsoft.com/oldnewthing/20141212-00/?p=43413) 1245 | * [SIDs are really just another a fancy way of creating unique IDs in a decentralized way](https://devblogs.microsoft.com/oldnewthing/20230613-00/?p=108335) 1246 | * [What's the point of giving my unnamed object proper security attributes since unnamed objects aren't accessible outside the process anyway (or are they?)](https://devblogs.microsoft.com/oldnewthing/20150604-00/?p=45451) 1247 | * [Is a SID with zero subauthorities a valid SID? It depends whom you ask](https://devblogs.microsoft.com/oldnewthing/?p=45231) 1248 | * [What’s the difference between duplicating the handle to a token and duplicating a token?](https://devblogs.microsoft.com/oldnewthing/20160511-00/?p=93446) 1249 | * [I called `AdjustTokenPrivileges`, but I was still told that a necessary privilege was not held](https://devblogs.microsoft.com/oldnewthing/20190531-00/?p=102532) 1250 | * [I called `AdjustTokenPrivileges`, but I was still told that a necessary privilege was not held, redux](https://devblogs.microsoft.com/oldnewthing/20211126-00/?p=105973) 1251 | * [The history of the `EncodePointer` function for obfuscating pointers](https://devblogs.microsoft.com/oldnewthing/20201113-00/?p=104447) 1252 | * [Additional helpful pseudo-handles: The process token, the thread token, and the effective token](https://devblogs.microsoft.com/oldnewthing/20210105-00/?p=104667) 1253 | * [How can I tell whether my process is running as SYSTEM?](https://devblogs.microsoft.com/oldnewthing/20210106-00/?p=104669) 1254 | * [A brief summary of the various versions of the Security Descriptor Definition Language (SDDL)](https://devblogs.microsoft.com/oldnewthing/20220510-00/?p=106640) 1255 | * [How do I free the pointers returned by functions like `Get­Token­Information`?](https://devblogs.microsoft.com/oldnewthing/20230517-00/?p=108207) 1256 | * [A clarification on the multithreading constraints of the `Encrypt­Message` function](https://devblogs.microsoft.com/oldnewthing/20231109-00/?p=108988) 1257 | 1258 | 1259 | ## Registry 1260 | 1261 | * [Beware of non-null-terminated registry strings](https://devblogs.microsoft.com/oldnewthing/20040824-00/?p=38063) 1262 | * [The performance cost of reading a registry key](https://devblogs.microsoft.com/oldnewthing/20060222-11/?p=32193) 1263 | * [So how bad is it that I’m calling `RegOpenKey` instead of `RegOpenKeyEx`?](https://devblogs.microsoft.com/oldnewthing/20160120-00/?p=92892) 1264 | * [If I simply want to create a registry key but don’t intend to do anything else with it, what security access mask should I ask for?](https://devblogs.microsoft.com/oldnewthing/20161128-00/?p=94815) 1265 | * [How can I programmatically inspect and manipulate a registry hive file without mounting it?](https://devblogs.microsoft.com/oldnewthing/20181015-00/?p=99975) 1266 | * [Why doesn’t `RegSetKeySecurity` propagate inheritable ACEs, but `SetSecurityInfo` does?](https://devblogs.microsoft.com/oldnewthing/20200102-00/?p=103287) 1267 | * [Why does `Reg­Notify­Change­Key­Value` stop notifying once the key is deleted?](https://devblogs.microsoft.com/oldnewthing/20200507-00/?p=103733) 1268 | * [How can I emulate the `REG_NOTIFY_THREAD_AGNOSTIC` flag on systems that don’t support it? part 1](https://devblogs.microsoft.com/oldnewthing/20201221-00/?p=104574) 1269 | * [How can I emulate the `REG_NOTIFY_THREAD_AGNOSTIC` flag on systems that don’t support it? part 2](https://devblogs.microsoft.com/oldnewthing/20201222-00/?p=104582) 1270 | * [How can I emulate the `REG_NOTIFY_THREAD_AGNOSTIC` flag on systems that don’t support it? part 3](https://devblogs.microsoft.com/oldnewthing/20201223-00/?p=104584) 1271 | * [How can I emulate the `REG_NOTIFY_THREAD_AGNOSTIC` flag on systems that don’t support it? part 4](https://devblogs.microsoft.com/oldnewthing/20201224-00/?p=104599) 1272 | * [How can I emulate the `REG_NOTIFY_THREAD_AGNOSTIC` flag on systems that don’t support it? part 5](https://devblogs.microsoft.com/oldnewthing/20201225-00/?p=104602) 1273 | * [The history of passing a null pointer as the key name to `Reg­Open­Key­Ex`](https://devblogs.microsoft.com/oldnewthing/20210723-00/?p=105479) 1274 | * [On the failed unrealized promise of `Reg­Override­Predef­Key`](https://devblogs.microsoft.com/oldnewthing/20231020-00/?p=108911) (i.e. don't use it.) 1275 | 1276 | 1277 | ## Strings and Locales 1278 | 1279 | * [`TEXT` vs. `_TEXT` vs. `_T`, and `UNICODE` vs. `_UNICODE`](https://devblogs.microsoft.com/oldnewthing/20040212-00/?p=40643) 1280 | * [The sad history of Unicode `printf`-style format specifiers in Visual C++](https://devblogs.microsoft.com/oldnewthing/20190830-00/?p=102823) 1281 | * [Nasty gotcha: `SetThreadUILanguage` cannot be used to restore the thread UI language](https://devblogs.microsoft.com/oldnewthing/20170908-00/?p=96965) 1282 | * [How can `CharUpper` and `CharLower` guarantee that the uppercase version of a string is the same length as the lowercase version?](https://devblogs.microsoft.com/oldnewthing/20200804-00/?p=104040) (use `LCMapStringEx()` in any new code) 1283 | * [Is there a code page that matches ASCII and can round trip arbitrary bytes through Unicode?](https://devblogs.microsoft.com/oldnewthing/20200831-00/?p=104142) 1284 | * [A consequence of being the first to adopt a standard is that you may end up being the only one to adopt it: The sad story of Korean jamo](https://devblogs.microsoft.com/oldnewthing/20201009-00/?p=104351) 1285 | * [The `activeCodePage` manifest element can be used for more than just setting UTF-8 as the active code page](https://devblogs.microsoft.com/oldnewthing/20220531-00/?p=106697) 1286 | * [Feel free to stop using `IMultiLanguage2::DetectInputCodepage`](https://devblogs.microsoft.com/oldnewthing/20221003-00/?p=107241) 1287 | * [On the proper care and feeding of the enigmatic `Get­Distance­Of­Closest­Language­In­List` function](https://devblogs.microsoft.com/oldnewthing/20230320-00/?p=107949) 1288 | * [How can I get `WideCharToMultiByte` to convert strings encoded in UTF-16BE?](https://devblogs.microsoft.com/oldnewthing/20231005-00/?p=108854) 1289 | 1290 | 1291 | ## NT Services 1292 | 1293 | * [Calling `ShutdownBlockReasonCreate` from my service doesn't stop the user from shutting down](https://devblogs.microsoft.com/oldnewthing/20151002-00/?p=91461) 1294 | * [What does it mean when my attempt to stop a Windows NT service fails with `ERROR_BROKEN_PIPE`?](https://devblogs.microsoft.com/oldnewthing/20190405-00/?p=102389) 1295 | * [How can I configure my Windows NT service to autostart when the system gains Internet access?](https://devblogs.microsoft.com/oldnewthing/20200227-00/?p=103494) 1296 | * [On the confusing names for the Windows service SID types](https://devblogs.microsoft.com/oldnewthing/20231004-00/?p=108849) 1297 | 1298 | 1299 | ## Uncategorized 1300 | 1301 | * [How do I determine the processor's cache line size?](https://devblogs.microsoft.com/oldnewthing/20091208-01/?p=15733) (`GetLogicalProcessorInformation()`) 1302 | * [Why are structure sizes checked strictly?](https://devblogs.microsoft.com/oldnewthing/20031212-00/?p=41523) 1303 | * [What's the difference between `CreateMenu` and `CreatePopupMenu`?](https://devblogs.microsoft.com/oldnewthing/20031230-00/?p=41273) 1304 | * [Why are `HANDLE` return values so inconsistent?](https://devblogs.microsoft.com/oldnewthing/20040302-00/?p=40443) 1305 | * [How to retrieve text under the cursor (mouse pointer)](https://devblogs.microsoft.com/oldnewthing/20040423-00/?p=39663) 1306 | * [How to detect programmatically whether you are running on 64-bit Windows](https://devblogs.microsoft.com/oldnewthing/20050201-00/?p=36553) 1307 | * [A timed context menu](https://devblogs.microsoft.com/oldnewthing/20050307-00/?p=36263) 1308 | * [The importance of passing the `WT_EXECUTELONGFUNCTION` flag to `QueueUserWorkItem`](https://devblogs.microsoft.com/oldnewthing/20050722-15/?p=34843) 1309 | * [If your callback fails, it's your responsibility to set the error code](https://devblogs.microsoft.com/oldnewthing/20060123-12/?p=32573) 1310 | * [The double-click time tells the window manager how good your reflexes are](https://devblogs.microsoft.com/oldnewthing/20080423-00/?p=22623) 1311 | * [The cursor isn't associated with a window or a window class; it's associated with a thread group](https://devblogs.microsoft.com/oldnewthing/20110207-00/?p=11563) 1312 | * [Menu item states are not reliable until they are shown because they aren't needed until then](https://devblogs.microsoft.com/oldnewthing/20110805-00/?p=9963) 1313 | * [How can I display a live screenshot of a piece of another application?](https://devblogs.microsoft.com/oldnewthing/20130513-00/?p=4393) 1314 | * [Converting from a UTC-based `SYSTEMTIME` directly to a local-time-based `SYSTEMTIME`](https://devblogs.microsoft.com/oldnewthing/20140307-00/?p=1573) 1315 | * [Programmatically uploading a file to an FTP site](https://devblogs.microsoft.com/oldnewthing/20140310-00/?p=1563) 1316 | * [How can you use both versions 5 and 6 of the common controls within the same module?](https://devblogs.microsoft.com/oldnewthing/20140508-00/?p=1043) 1317 | * [How can I tell if Windows Update is waiting for the system to reboot?](https://devblogs.microsoft.com/oldnewthing/20150921-00/?p=91551) 1318 | * [How do I call `SetTimer` with a timer ID that is guaranteed not to conflict with any other timer ID?](https://devblogs.microsoft.com/oldnewthing/20150924-00/?p=91521) 1319 | * [A window can’t have two timers with the same ID, so how do I assign an ID that nobody else is using?](https://devblogs.microsoft.com/oldnewthing/20191009-00/?p=102974) 1320 | * [What does it mean when a display change is temporary?](https://devblogs.microsoft.com/oldnewthing/20080104-00/?p=23923) 1321 | * [How do I obtain the comment for a share?](https://devblogs.microsoft.com/oldnewthing/20151005-00/?p=91441) 1322 | * [How accurate are the various Windows time-querying functions?](https://devblogs.microsoft.com/oldnewthing/20170921-00/?p=97057) 1323 | * [How can I detect whether the user is logging off?](https://devblogs.microsoft.com/oldnewthing/20180705-00/?p=99175) 1324 | * [Why are timer IDs and dialog control IDs 64-bit values on 64-bit Windows? Did you really expect people to create more than 4 billion timers or dialog controls?](https://devblogs.microsoft.com/oldnewthing/20191010-00/?p=102978) 1325 | * [If you suppress GDI+ background thread, then you are expected to pump messages yourself](https://devblogs.microsoft.com/oldnewthing/20191029-00/?p=103033) 1326 | * [If one program blocks shutdown, then *all* programs block shutdown](https://devblogs.microsoft.com/oldnewthing/20200414-00/?p=103671) (`WM_QUERY­END­SESSION`, `WM_END­SESSION`) 1327 | * [When I ask the `GetIpAddrTable` function to sort the results, how are they sorted?](https://devblogs.microsoft.com/oldnewthing/20200415-00/?p=103673) 1328 | * [How can I detect that the system is no longer showing a UAC prompt?](https://devblogs.microsoft.com/oldnewthing/20200429-00/?p=103715) (`EVENT_SYSTEM_DESKTOP­SWITCH`) 1329 | * [How can I get the number of processors in the system, when there are more than 64?](https://devblogs.microsoft.com/oldnewthing/20200824-00/?p=104116) 1330 | * [Why are some system functions exported as stubs instead as forwarders?](https://devblogs.microsoft.com/oldnewthing/20200826-00/?p=104125) 1331 | * [How can I check whether the user has disconnected from the session?](https://devblogs.microsoft.com/oldnewthing/20201202-00/?p=104504) 1332 | * [Why does `PF_VIRT_FIRMWARE_ENABLED` return false even when virtualization is enabled in the firmware?](https://devblogs.microsoft.com/oldnewthing/20201216-00/?p=104550) 1333 | * [How can I convert between IANA time zones and Windows registry-based time zones?](https://devblogs.microsoft.com/oldnewthing/20210527-00/?p=105255) 1334 | * [The focus rectangle says, “I’m not orange. I’m just drawn that way.”](https://devblogs.microsoft.com/oldnewthing/20211102-00/?p=105866) 1335 | * [Why does the precise point at which I get a stack overflow exception change from run to run?](https://devblogs.microsoft.com/oldnewthing/20211216-00/?p=106038) (structured exception handling aka SEH) 1336 | * [How do I programmatically reposition monitors in a multiple-monitor system?](https://devblogs.microsoft.com/oldnewthing/20211222-00/?p=106048) (`ChangeDisplaySettingsEx()`) 1337 | * [How do I upgrade a 32-bit tick count to a 64-bit one?](https://devblogs.microsoft.com/oldnewthing/20220107-00/?p=106130) 1338 | * [The error code you get might not be the one you want](https://devblogs.microsoft.com/oldnewthing/20220119-00/?p=106176) 1339 | * [How can I find out which processor architectures are supported via emulation by the current system?](https://devblogs.microsoft.com/oldnewthing/20220209-00/?p=106239) 1340 | * [How can I detect whether the system has a keyboard attached? On the `GetRawInputDeviceList` function](https://devblogs.microsoft.com/oldnewthing/20220302-00/?p=106303) 1341 | * [Filtering out fake keyboards from the `GetRawInputDeviceList` function](https://devblogs.microsoft.com/oldnewthing/20220303-00/?p=106306) 1342 | * [How expensive is `PssCaptureSnapshot`? How fast is it? How much memory does it consume?](https://devblogs.microsoft.com/oldnewthing/20220314-00/?p=106346) 1343 | * [What is the `CreateExplorerShellUnelevatedTask` scheduled task?](https://devblogs.microsoft.com/oldnewthing/20220524-00/?p=106682) 1344 | * [Under what conditions can I modify the memory that I received in the form a `STGMEDIUM`?](https://devblogs.microsoft.com/oldnewthing/20220701-00/?p=106817) 1345 | * [Is it true that raising a structured exception from a structured exception handler terminates the process?](https://devblogs.microsoft.com/oldnewthing/20221020-00/?p=107303) 1346 | * [Why are many Windows user interface elements positioned at multiples of 4 or 8 pixels?](https://devblogs.microsoft.com/oldnewthing/20221025-00/?p=107318) (DPI, `DEVICE_SCALE_FACTOR`) 1347 | * [A history of the `fd_set`, `FD_SETSIZE`, and how it relates to WinSock](https://devblogs.microsoft.com/oldnewthing/20221102-00/?p=107343) 1348 | * [How can I detect programmatically whether Windows is an N or KN version?](https://devblogs.microsoft.com/oldnewthing/20221229-00/?p=107623) 1349 | * [How should I interpret the various values of `NLM_CONNECTIVITY`?](https://devblogs.microsoft.com/oldnewthing/20230112-00/?p=107700) 1350 | * [How can I find out the last time a user logged on from C++?](https://devblogs.microsoft.com/oldnewthing/20230622-00/?p=108369) 1351 | * [How can I specify icons for my app to use on the Start menu in high contrast mode?](https://devblogs.microsoft.com/oldnewthing/20240104-00/?p=109239) 1352 | * [How can I add an environment variable to a process launched via `Shell­Execute­Ex` or `IContext­Menu`?](https://devblogs.microsoft.com/oldnewthing/20240131-00/?p=109342) 1353 | * [Functions that return the size of a required buffer generally return upper bounds, not tight bounds](https://devblogs.microsoft.com/oldnewthing/20240214-00/?p=109400) 1354 | --------------------------------------------------------------------------------