Showing results for October 2014 - Page 2 of 3 - The Old New Thing

Oct 17, 2014
0
0

When are global objects constructed and destructed by Visual C++?

Raymond Chen
Raymond Chen

Today we're going to fill in the following chart: The C++ language specification provides some leeway to implementations on when global static objects are constructed. It can construct the object before begins, or it construct the object on demand according to complicated rules. You can read [basic.start.init] for the gory details. Let's ass...

Code
Oct 16, 2014
0
0

If only DLLs can get DllMain notifications, how can an EXE receive a notification when a thread is created (for example)?

Raymond Chen
Raymond Chen

When a DLL is loaded, it receives a notification, and when it is unloaded (or when the process terminates), it gets a notification. DLLs also receive notifications when a thread is created and notifications when a thread exits. But what if you are an EXE? EXEs don't have a , so there is no way to receive these notifications. The trick here i...

Code
Oct 14, 2014
0
0

Is there a way to disable a specific balloon notification without disabling all of them?

Raymond Chen
Raymond Chen

There is a group policy called Turn off all balloon notifications, but what if you want to turn off only one specific notification? The taskbar does not offer fine-grained policy control over balloon notifications. All you have is the giant sledgehammer that turns off all of them. If there is a specific balloon you want to disable, you have to che...

Tips/Support
Oct 13, 2014
0
0

Enumerating notification icons via UI Automation

Raymond Chen
Raymond Chen

Today's Little Program uses accessibility to enumerate the current notification icons (and possibly click on one of them). This could be done manually via , but the BCL folks conveniently created the namespace which contains classes that take a lot of the grunt work out of walking the accessibility tree. While it's true that the namespace take...

Code
Oct 10, 2014
0
0

Some parts of an interface can change but others can't

Raymond Chen
Raymond Chen

When I wrote about asking the compiler to answer calling convention questions, some people were concerned about whether this was a reliable mechanism or whether it was relying on something that can change in the future. This is a special case of the question, "What parts of an interface can change, and what can't?" And it all boils down to comp...

Code
Oct 9, 2014
0
0

Why is there a 64KB no-man's land near the end of the user-mode address space?

Raymond Chen
Raymond Chen

We learned some time ago that there is a 64KB no-man's land near the 2GB boundary to accommodate a quirk of the Alpha AXP processor architecture. But that's not the only reason why it's there. The no-man's land near the 2GB boundary is useful even on x86 processors because it simplifies parameter validation at the boundary between user mode and k...

History
Oct 8, 2014
0
0

Standard handles are really meant for single-threaded programs

Raymond Chen
Raymond Chen

When I discussed the conventions for managing standard handles, Sven2 noted that I implied that you need to call with a new handle if you close the current handle and asked "Wouldn't it make more sense to call it the other way round? I.e., first set the new handle, then close the old one? It would ensure that any other thread that runs in paralle...

Code
Oct 7, 2014
0
0

Microspeak: All-up

Raymond Chen
Raymond Chen

In other words: All-inclusive.

Non-ComputerMicrospeak
Oct 6, 2014
0
0

Enumerating cyclical decompositions with Stirling numbers

Raymond Chen
Raymond Chen

This whole enumeration nightmare-miniseries started off with Stirling numbers of the second kind. But what about Stirling numbers of the first kind? Those things ain't gonna enumerate themselves! The traditional formulation of the recursion for Stirling numbers of the first kind (unsigned version, since it's hard to enumerate negative numbers)...

Code