Showing tag results for History

Nov 5, 2004
Post comments count0
Post likes count1

A history of GlobalLock, part 2: Selectors

Raymond Chen

With the advent of the 80286, Windows could take advantage of that processor's "protected mode". processor. There was still no virtual memory, but you did have memory protection. Global handles turned into "descriptors", more commonly known as "selectors". Architectural note: The 80286 did have support for both a "local descriptor table" and a ...

History
Nov 4, 2004
Post comments count0
Post likes count1

A history of GlobalLock, part 1: The early years

Raymond Chen

Once upon a time, there was Windows 1.0. This was truly The Before Time. 640K. Segments. Near and far pointers. No virtual memory. Co-operative multitasking. Since there was no virtual memory, swapping had to be done with the co-operation of the application. When there was an attempt to allocate memory (either for code or data) and insuffici...

History
Nov 3, 2004
Post comments count0
Post likes count1

Why do I sometimes see redundant casts before casting to LPARAM?

Raymond Chen

If you read through old code, you will often find casts that seem redundant. SendMessage(hwndListBox, LB_ADDSTRING, 0, (LPARAM)(LPSTR)"string"); Why was "string" cast to LPSTR? It's already an LPSTR! These are leftovers from 16-bit Windows. Recall that in 16-bit Windows, pointers were near by default. Consequently, "string" was a near pointe...

History
Nov 2, 2004
Post comments count0
Post likes count1

What was the point of the GMEM_SHARE flag?

Raymond Chen

The GlobalAlloc function has a GMEM_SHARE flag. What was it for? In 16-bit Windows, the GMEM_SHARE flag controlled whether the memory should outlive the process that allocated it. By default, all memory allocated by a process was automatically freed when that process exited. Passing the GMEM_SHARE flag suppressed this automatic cleanup. That's...

History
Nov 1, 2004
Post comments count0
Post likes count1

What was the difference between LocalAlloc and GlobalAlloc?

Raymond Chen

Back in the days of 16-bit Windows, the difference was significant. In 16-bit Windows, memory was accessed through values called "selectors", each of which could address up to 64K. There was a default selector called the "data selector"; operations on so-called "near pointers" were performed relative to the data selector. For example, if you had ...

History
Oct 29, 2004
Post comments count0
Post likes count0

Why didn’t the desktop window shrink to exclude the taskbar?

Raymond Chen

The taskbar created all sorts of interesting problems, since the work area was not equal to the entire screen dimensions. (Multiple monitors created similar problems.) "Why didn't the gui return the usable workspace as the root window (excluding the taskbar)?" That would have made things even worse. Lots of programs want to cover the entire sc...

History
Oct 28, 2004
Post comments count0
Post likes count2

Where did windows minimize to before the taskbar was invented?

Raymond Chen

Before Explorer was introduced in Windows 95, the Windows desktop was a very different place. The icons on your desktop did not represent files; rather, when you minimized a program, it turned into an icon on the desktop. To open a minimized program, you had to hunt for its icon, possibly minimizing other programs to get them out of the way...

History
Oct 22, 2004
Post comments count0
Post likes count1

Why doesn’t Setup asks you if you want to keep newer versions of OS files?

Raymond Chen

Windows 95 Setup would notice that a file it was installing was older than the file already on the machine and would ask you whether you wanted to keep the existing (newer) file or to overwrite it with the older version. Asking the user this question at all turned out to have been a bad idea. It's one of those dialogs that ask the user a qu...

History
Oct 20, 2004
Post comments count0
Post likes count1

How does Explorer detect whether your program supports long file names?

Raymond Chen

When you register your program with a file association, the shell needs to decide whether your program supports long file names so it can decide whether to pass you the long name (which may contains spaces! so make sure you put quotation marks around the "%1" in your registration) or the short name. The rule is simple: The shell looks at your pr...

History
Oct 19, 2004
Post comments count0
Post likes count1

The compatibility constraints of even your internal bookkeeping

Raymond Chen

The Listview control when placed in report mode has a child header control which it uses to display column header titles. This header control is the property of the listview, but the listview is kind enough to let you retrieve the handle to that header control. And some programs abuse that kindness. It so happens that the original listview...

History