Showing tag results for History

Aug 11, 2006
Post comments count0
Post likes count1

Why does SetWindowsHookEx take an HINSTANCE parameter?

Raymond Chen

An anonymous commenter asked why the function takes an parameter if the first thing it's going to do is convert the instance handle into a file name. Because that's not how it worked in 16-bit Windows. In 16-bit Windows there was no such thing as hook injection. All 16-bit Windows applications ran in the same address space, so there was no nee...

History
Aug 10, 2006
Post comments count0
Post likes count0

One way people abused hooks in 16-bit Windows

Raymond Chen

We saw last time how windows hooks were implemented in 16-bit Windows. Even though the was an opaque data type that should have been treated like a handle, many programs "knew enough to be dangerous" and took advantage of the fact that the was just a pointer to the previous hook procedure. The most common way of abusing this knowledge was by ...

History
Aug 9, 2006
Post comments count0
Post likes count0

How were window hooks implemented in 16-bit Windows?

Raymond Chen

The mechanism for keeping track of window hooks was very different in 16-bit Windows. The functions involved were , and . The first two functions still exist today, but the third one has been replaced with a macro: Disclaimer: All code below is "reconstructed from memory". The spirit of the code is intact, but the precise details may be off. ...

History
Jul 14, 2006
Post comments count0
Post likes count1

How were DLL functions exported in 16-bit Windows?

Raymond Chen

The whole point of dynamic link libraries (DLLs) is that the linkage is dynamic. Whereas statically-linked libraries are built into the final product, a module that uses a dynamically-linked library merely says, "I would like function X from Y.DLL, please." This technique has advantages and disadvantages. One advantage is more efficient use of stor...

History
Jul 7, 2006
Post comments count0
Post likes count0

No, really, why is it 160×31?

Raymond Chen

When I discussed some time ago why minimized windows have an apparent size of 160x31, I explained that the minimized icon is a miniature title bar, but I managed not to explain why the values are exactly 160 and 31. The width of the miniature title bar is determined by the member of structure. You can retrieve and change this structure with the...

History
Jun 9, 2006
Post comments count0
Post likes count0

Why did the Add or Remove Programs control panel try to guess all that information?

Raymond Chen

As we saw earlier, the "Add or Remove Programs" control panel used several heuristics to attempt to determine things like program size and frequency of user. Why did it bother doing this at all? At the time the feature was added, disk space was not cheap like it is today. One of the problems users were having was running out of disk space and not...

History
Jun 6, 2006
Post comments count0
Post likes count0

The forgotten common controls: The page scroller

Raymond Chen

The pager control was introduced with the common controls library that came with Internet Explorer 4.0 in order to assist in implementing scrolling menus on the Start menu and Favorites menu. (The Start menu and Favorites menu aren't really menus in the Win32 sense. They are custom controls written to act like menus; the fakemenu sample prov...

History
Jun 2, 2006
Post comments count0
Post likes count0

What does the CS_CLASSDC class style do?

Raymond Chen

Last time, I talked about the historical background for the class style and why it starts out sounding like a good idea but when you think about it some more turns out to be an awful idea. The class style is the same thing, but worse, for it takes all the problems of and magnifies them. Recall that the class style instructs the window manage...

CodeHistory