Showing results for April 2010 - Page 2 of 3 - The Old New Thing

Apr 20, 2010
0
0

The difference between your job and your hobby

Raymond Chen
Raymond Chen

There was an internal discussion about what Microsoft employees should be doing that do not directly relate to their job responsibilities, such as what text editor programmers should be using to write and edit code. Should anybody who uses a programming editor other than Visual Studio be branded a traitor? How about somebody who prefers a smartph...

Other
Apr 19, 2010
0
0

Why does the wireless connection dialog ask for your password twice?

Raymond Chen
Raymond Chen

Martin wonders why the wireless networking dialog asks you to type your password twice when connecting to an existing network. Yeah, that bothers me too, and I don't know why either. But while we're on the topic of wireless networking, I thought I'd share a little program that is just as useless as my answer above. (If other people get to hij...

Other
Apr 16, 2010
0
0

The mysterious stock bitmap: There's no way to summon it, but it shows up in various places

Raymond Chen
Raymond Chen

A number of stock GDI objects are made available by the function, but one stock GDI object that is mysteriously missing is the stock bitmap. You can't summon the stock bitmap, but it manages to show up in various places, some of them perhaps unexpected. The stock bitmap is a monochrome 1×1 bitmap which GDI uses in various places where it ...

Code
Apr 15, 2010
0
0

Why are there two values for NoDriveTypeAutoRun which disable Autoplay on drives of unknown type?

Raymond Chen
Raymond Chen

The Windows 2000 Resource Kit described the policy as consisting of a bitfield whose values are as follows: Hey, wait, two of the entries are the same. What's the difference between 0x1 (Disables Autoplay on drives of unknown type) and 0x80 (Disables Autoplay on drives of unknown type)? The values in the bitfield correspond to return value...

Tips/Support
Apr 14, 2010
0
0

When you create an object with constraints, you have to make sure everybody who uses the object understands those constraints

Raymond Chen
Raymond Chen

Here's a question that came from a customer. This particular example involves managed code, but don't let that distract you from the point of the exercise. I am trying to create a object using the constructor that takes an as input. In my .cs file, I create the native file handle using , as shown below. Then I create the object as so: ...

Code
Apr 13, 2010
0
0

It's a miracle humanity has survived this far, if reaction to the inability to make or receive a telephone call is to be believed

Raymond Chen
Raymond Chen

In one of the mailing lists devoted to chatting among people who work in a particular cluster of Microsoft office buildings, there was some discussion of the quality of mobile phone coverage in the parking garage. "I can't get a signal in any of the underground levels. This is intolerable!" — Here's an idea: Walk to ground level and make yo...

Non-Computer
Apr 12, 2010
0
0

How do I switch a window between normal and fullscreen?

Raymond Chen
Raymond Chen

Frederic Delhoume wants to know if there is a simple example of code that switches an application from windowed to fullscreen. He then included a code fragment that did some crazy things with parent windows and hiding and showing. You're making it way, way harder than it needs to be. Let's start with our scratch program and make these changes:...

Code
Apr 9, 2010
0
0

Why can't you use WM_CTLCOLORSTATIC to change the color of a SS_BLACKRECT?

Raymond Chen
Raymond Chen

If you specify one of the static control styles which draw a frame or rectangle the control will be drawn with the corresponding color (which, as we saw last time, isn't actually black, gray, or white). If you try to customize the color by handling the message, you'll find that it has no effect. Well, yeah, because you said you wanted a black ...

Code
Apr 8, 2010
0
0

Why doesn't SS_WHITERECT actually draw a white rectangle?

Raymond Chen
Raymond Chen

There are six styles available to the static controls which draw frames and rectangles in one of three fixed colors: But if you actually create a static control with one of these styles, you'll find that the color isn't actually black, gray, or white. So why are they called black, gray, and white? Because they used to be black, gray, and white....

History
Apr 7, 2010
0
0

How to edit the security attributes of more than one file at a time

Raymond Chen
Raymond Chen

In Windows XP, you could select multiple files, right-click them, then select Properties. The resulting property sheet includes a Security page which lets you edit the security attributes of those files. But when you repeat this exercise on Windows Vista or Windows 7, the Security page is missing. Why doesn't Explorer let you edit th...

Tips/Support