The Old New Thing

Why do I sometimes get classic buttons and sometimes themed buttons depending on the host process?

A customer reported that their printer configuration property sheet page looked different depending on the host process. In some processes, the printer configuration dialog had the classic look of Windows 2000, but in other processes it has the themed look of Windows XP and later versions. The printer driver calls the Create­...
Comments are closed.0 0
Code

Why doesn't SHGetKnownFolderPath return the customized path?

A customer reported that the SHGet­Known­Folder­Path function was not working correctly. They moved their Videos folder to a new location, but when they called SHGet­Known­Folder­Path, they got the old path rather than the new one. A quick check of the code they provided showed why: Um, you're passing the ...
Comments are closed.0 0
Code

2012 års Gävlebock gick upp i brand. Igen.

The town of Gävle in Sweden erects a large straw goat every year. The Yule Goat is a Scandinavian tradition, but the Gävle goat (Gävlebocken in Swedish) is by far the most famous, or perhaps the most notorious, because it has been the center of conflict from its very beginning, and over the years since its first appearance in ...

Like the cake, WS_EX_TRANSPARENT is a lie, or at least not the entire truth

There is an extended window style known as WS_EX_TRANSPARENT. Explaining what this style does is kind of difficult, but it's been on the list of future topics since 2003. Better late than never, I guess. First of all, there are two unrelated senses of transparent in play. One is visual transparency: Pixels beneath the window can show ...
Comments are closed.0 0
Code

Why is it possible to create a toolbar with the wrong HINSTANCE? And what's the right HINSTANCE anyway?

A customer observed that all of the following code fragments are successful in creating a toolbar common control: Furthermore, the customer observed that Get­Class­Info(hinst, TOOLBAR­CLASS­NAME, &wc) works regardless of whether you pass the process instance or NULL for the hinst parameter. First of all, what's ...
Comments are closed.0 0
Code

Why is it so hard to write a program that requires UI Access privilege?

If you want your program to have the UI Access privilege, you have to jump through a few hoops. The program needs to be digitally signed, and it needs to go into the system32 directory. Why is it so hard to get UI Access? Because UI Access bypasses User Interface Privilege Isolation (UIPI) security measures. The more valuable the target, the ...

How am I supposed to free the information returned by the GetSecurityInfo function?

The Get­Security­Info function returns a copy of the security descriptor for a kernel object, along with pointers to specific portions you request. More than once, a customer has been confused by the guidelines for how to manage the memory returned by the function. Let's look at what the function says: ppsidOwner [out, optional...
Comments are closed.0 0
Code