Showing results for June 2013 - Page 3 of 3 - The Old New Thing

Jun 6, 2013
0
0

A pathological program which ignores the keyboard, and understanding the resulting behavior based on what we know about the synchronous input

Raymond Chen
Raymond Chen

Today, we'll illustrate the consequences of the way the window manager synchronizes input when two or more threads decide to share an input queue. Since I need to keep separate state for the two windows, I'm going to start with the new scratch program and make the following changes: #include <strsafe.h> class RootWindow : public Window...

Code
Jun 5, 2013
0
0

When you share an input queue, you have to wait your turn

Raymond Chen
Raymond Chen

Now that we've had a quick introduction to asynchronous input, let's look at some of the details. Remember, this is a peek under the hood at how the sausage is made. The algorithm described here is not part of the API contract and it can change at any time, as long as it services the overall goal of serializing input. Let's start by looking at ...

Code
Jun 4, 2013
0
0

Asynchronous input vs synchronous input, a quick introduction

Raymond Chen
Raymond Chen

One of the topics I covered at my PDC talk was the asynchronous input model. I don't think I ever discussed it on this Web site, so I guess I'll do it now, so that I can point people at it in the future. In the old days of 16-bit Windows, input was synchronous. All input went into a system-wide input queue, and the intuitive rule for input proce...

Code
Jun 3, 2013
0
0

When a CD gets stuck on infinite repeat during the night

Raymond Chen
Raymond Chen

One night, the CD player got stuck due to a scratched disc and ended up repeating the same track over and over again. I dreamed that the song was O(n²) in length,¹ with each new verse one bar longer than the previous one, but unlike a cumulative song,² the location of the inserted bar varied randomly from verse to verse. Moral of ...

Non-ComputerDream
Jun 3, 2013
0
0

How do I make it more difficult for somebody to take a screenshot of my window?

Raymond Chen
Raymond Chen

Ultimately, you can't stop somebody from ignoring the words Confidential at the top of a document and whipping out a digital camera and taking a picture of the screen. But at least starting in Windows 7 you can make it a little more difficult. Take our scratch program and add this one line: ... SetWindowDisplayAffinity(hwnd, WDA...

Code