The Old New Thing

Creating a listview with checkboxes on some items but not others

Today's Little Program creates a listview with checkboxeson some items but not other.TheLVS_EX_CHECK­BOXESextended style is really just a convenience style.Everything it does you could have done yourself,with a bit more typing.It creates a state image list consisting of an unchecked box (state 1) and a checked box (state 2...
Comments are closed.0 0
Code

How do I manually recalculate ACLs on a file based on the containing directory?

A customer wanted to move a file and have it forget all its old ACLs and instead inherit its ACLs from its new location. They found an old article of mine that said If you use SH­File­Operation to move a file and pass the FOF_NO­COPY­SECURITY­ATTRIBUTES flag, then it will not preserve the original ACLs on the moved files...
Comments are closed.0 0
Code

The case of the missing context menu verbs

A customer reported that when they right-clicked a batch file, a bunch of commands were missing. For example, Open was gone! Okay, there really isn't much of a story here, because some direct debugging quickly identified the culprit. The customer had installed a third party shell extension which returned a huge value from its IContext­...
Comments are closed.0 0
Code

The case of the mysterious Alternate Data Stream query

A customer was running Windows Server 2003 ("Still in support until 2015!") and they have some custom application that monitors all disk accesses. They noticed that there were a lot of failed Alternate Data Stream queries coming from Explorer, and that was causing the custom application's logs to fill with largely useless information. These ...

Excuses college students use for missing assignments

My father recently retired after over 40 years as a college professor. During that time, he has seen all sorts of lame excuses students offer for missing homework assignments. Eventually, he got tired of dealing with them, so he instituted the following homework policy: There are nine homework assignments in this class, broken into three ...

How do I obtain the computer manufacturer's name via C++?

The way to get the computer manufacturer and other informationis toask WMI.WMI is much easier to use via scripting, but maybe you want to do itfrom C++.Fortunately,MSDN takes you through it step by stepand even puts it together intoa sample program.But I'm going to write the code myself anyway.Today's Little Program extracts ...
Comments are closed.0 0
Code

What happened in real-mode Windows when somebody did a longjmp into a discardable segment?

During the discussion of how real-mode Windows handled return addresses into discarded segments, Gabe wondered, "What happens when somebody does a long­jmp into a discardable segment?" I'm going to assume that everybody knows how long­jmp traditionally works so I can go straight to the analysis. The reason long­jmp is tricky ...

If the cursor clip rectangle is a global resource, how come I can't change it with ClipCursor?

A customer reported that the Clip­Cursor function was not working. "The cursor clip rectangle is a shared global resource, so I should be able to change it any time I like. My app installs a global mouse hook and sets the clip cursor inside the hook function, but the change doesn't have any effect. Why can't I change the clip cursor inside...
Comments are closed.0 0
Code

We know your job is hard, you don't have to show us

Some years ago, I attended a internal presentation where one group was teaching another group how to use their new feature. This particular feature was a "Just plug in the things you want, click the Apply button, and sit back and relax while we figure out how to do what you asked" type of feature. The presentation leader showed some examples ...