Showing tag results for Code

Jun 17, 2013
Post comments count0
Post likes count1

Displaying a property sheet for multiple files

Raymond Chen
Raymond Chen

Today's Little Program will show a property sheet that covers multiple files, just like the one you get from Explorer if you multi-select a bunch of files and right-click them all then select Properties. In fact, that description of how you do the operation interactively maps directly to how you do the operation programmatically! #define UNICO...

Code
Jun 14, 2013
Post comments count0
Post likes count1

A big little program: Monitoring Internet Explorer and Explorer windows, part 3: Tracking creation and destruction

Raymond Chen
Raymond Chen

Last time, we listener for window navigations. Today we'll learn about tracking window creation and destruction. The events to listen to are the DShell­Windows­Events. The Window­Registered event fires when a new window is created, and the Window­Revoked event fires when a window is destroyed. The bad news is that the paramet...

Code
Jun 13, 2013
Post comments count0
Post likes count2

A big little program: Monitoring Internet Explorer and Explorer windows, part 2: Tracking navigations

Raymond Chen
Raymond Chen

Okay, it's been a while since we set aside our Little Program to learn a bit about connection points and using dispatch interfaces as connection point interfaces. Now we can put that knowledge to use. Internet Explorer and Explorer windows fire a group of events known as DWeb­Browser­Events, so we just need to listen on those events ...

Code
Jun 12, 2013
Post comments count0
Post likes count1

Dispatch interfaces as connection point interfaces

Raymond Chen
Raymond Chen

Last time, we learned about how connection points work. One special case of this is where the connection interface is a dispatch interface. Dispatch interfaces are, as the name suggests, COM interfaces based on IDispatch. The IDispatch interface is the base interface for OLE automation objects, and if you want your connection point interface to...

Code
Jun 11, 2013
Post comments count0
Post likes count1

An introduction to COM connection points

Raymond Chen
Raymond Chen

Last time, we saw how to enumerate all the Internet Explorer and Explorer Windows and see what they are viewing. But that program printed static information. It didn't track the changes to the windows if the user clicked to another Web page or navigated to a different folder. In order to hook that up, we need to understand the connection point ...

Code
Jun 10, 2013
Post comments count0
Post likes count1

A big little program: Monitoring Internet Explorer and Explorer windows, part 1: Enumeration

Raymond Chen
Raymond Chen

Normally, Monday is the day for Little Programs, but this time I'm going to spend a few days on a single Little Program. Now, this might very well disqualify it from the name Little Program, but the concepts are still little; all I'm doing is snapping blocks together. (Plus, it's my Web site, so you can just suck it.) The goal of our Little Pro...

Code
Jun 7, 2013
Post comments count0
Post likes count2

Sharing an input queue takes what used to be asynchronous and makes it synchronous, like focus changes

Raymond Chen
Raymond Chen

As I noted earlier in the series, attaching input queues puts you back into the world of coöperative multitasking, where the two attached threads need to work together to get anything done. Back in the old 16-bit days, when input was synchronous, there was only one active window, only one focus window, only one window with capture, only one...

Code
Jun 6, 2013
Post comments count0
Post likes count1

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
Post comments count0
Post likes count1

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
Post comments count0
Post likes count1

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