Quantcast
Channel: The Old New Thing
Browsing all 3085 articles
Browse latest View live

How do I ShellExecute a file, but with a specific program instead of the...

The usual way to launch a file is to use Shell­Execute, which opens the file in the default program registered to handle that type of file. But what if you want to override the default? We saw some...

View Article


What’s the difference between VARIANT and VARIANTARG?

One of my colleagues asked me, "What's the difference between VARIANT and VARIANTARG?" If you look at the definitions in the oaidl.h header file, you'll see that VARIANTARG is just an alias for...

View Article


Exposing undefined behavior when trying to port code to another platform

A developer was porting some old Visual Studio code to another platform and found that the code was behavior strangely. Here's a simplified version of the code: class refarray { public: refarray(int...

View Article

Time travel is here, at least when it comes to debugging

At CppCon 2017, the Time Travel Debugging team (TTD) came through with a present for all the developers out there: A reverse debugging tool! Time Travel Debugging in WinDbg Preview! Time Travel...

View Article

Microspeak: over-index

Some time ago, I wrote a document that discusses the design of a new component. In the document overview, I summarized how the component interacts with the host. If the host supports widgets, then the...

View Article


Why do I have to pass a valid page protection value to VirtualAlloc even if...

The Virtual­Alloc function accepts a flProtect value, and even though the value is not used by MEM_RESET or MEM_RESET_UNDO, you still have to pass a valid value. (The documentation suggests...

View Article

How does Resource Monitor get information for processes that already terminated?

How does the Resource Monitor program get information for processes that have already terminated? Try it: Run Task Manager, then go to the Performance tab. From there, click Open Resource Monitor. Now...

View Article

2017 year-end link clearance

Iconic 1980s pop music song Take On Me performed on airhorn. Previously: Take On Me: Literal Lyrics. At an exhibition tennis match, Kim Clijsters asks the crowd whether she should serve wide or down...

View Article


How do I know that Resource Monitor isn’t just retaining a handle to the...

A short time ago, I explained that Resource Monitor shows information for terminated processes for a little while, so you can see the results before they go away. it's not that Resource Monitor is...

View Article


What happens when a huge number of people share a single grocery store...

Many years ago, one of my colleagues interviewed a candidate for a position in his group. The candidate worked with the data generated by a grocery store's customer loyalty cards. (Today, we would use...

View Article

Why are the module timestamps in Windows 10 so nonsensical?

One of the fields in the Portable Executable (PE) header is called TimeDateStamp. It's a 32-bit value representing the time the file was created, in the form of seconds since January 1, 1970 UTC. But...

View Article

How do I get the computer’s serial number? Consuming Windows Runtime classes...

Getting the computer's serial number used to be an arduous task of getting the system firmware table, and then manually parsing the SMBIOS information looking for the serial number. Windows 8...

View Article

How do I get the computer’s serial number? Consuming Windows Runtime classes...

Continuing our series on getting the computer's serial number in desktop apps in various languages, next up is C++/CX. From Visual Studio, create a new C++ Console Application that goes like this:...

View Article


How do I get the computer’s serial number? Consuming Windows Runtime classes...

Continuing our series on getting the computer's serial number in desktop apps in various languages, next up is C++/WinRT. From Visual Studio, create a new C++ Console Application that goes like this:...

View Article

How do I get the computer’s serial number? Consuming Windows Runtime classes...

Continuing our series on getting the computer's serial number in desktop apps in various languages, we look at C#. From Visual Studio, create a new C# Console Application that goes like this: class...

View Article


How do I get the computer’s serial number? Consuming Windows Runtime classes...

Continuing our series on getting the computer's serial number in desktop apps in various languages, we look at PowerShell. I warned you that you're going to be underwhelmed, so prepare to be...

View Article

Image may be NSFW.
Clik here to view.

Why is there a semicircular bar at the base of the ORCA card reader?

ORCA is the public transit card system for the Puget Sound area. One of my friends noticed that there is a semicircular bar at the base of ORCA card readers. You can see it in the following picture....

View Article


What does it mean when the documentation says that you must specify the app...

The documentation for the Smbios­Information class says The SerialNumber property securely retrieves the serial number from the SMBIOS for the system. This property is partial trust, so in a UWP app,...

View Article

Why don’t context menus respect the UI state for keyboard accelerators?

The WM_CHANGE­UI­STATE message lets you manipulate the UI state of a window, which controls whether keyboard accelerators and other UI affordances are shown. Let's use it to try to control the...

View Article

How do I know that Resource Monitor isnt just retaining a handle to the...

Not too long ago, I investigated whether the Resource Monitor retains an open handle to the process as its way to continue showing statistics after the process exited. I used Task Manager to termine...

View Article
Browsing all 3085 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>