Quantcast
Browsing all 3085 articles
Browse latest View live

How do I prevent my registered hotkey from firing repeatedly due to auto-repeat?

You can register a global hotkey with the Register­Hot­Key function, but one problem many people have is that if the user presses and holds the hotkey sequence, the hotkey will be invoked as fast as...

View Article


How do I preserve the user’s notification icon preferences for my program...

When a program creates a notification icon, the user can set preferences for that icon: Show icon and notifications, Hide icon and notifications, and Only show notifications. When you update the...

View Article


Should I name my file mapping after the file it was created from?

Many times a customer creates a file mapping object and assigns it a name that matches the name of the file it was created from. Mind you, there needs to be some fiddling with the name because...

View Article

Why does upgrading my project to Unicode cause Visual Studio to use a...

A customer was upgrading a program from Visual Studio 2008 to Visual Studio 2017. As part of the upgrade, they also decided to recompile it as a Unicode program rather than an ANSI program. And they...

View Article

How can I detect that a shell item refers to a virtual folder, or to a file...

Shell items have a bunch of attributes. For example, SFGAO_FOLDER means that the item is a folder, and it will show up in the navigation pane as a folder. Since it's a folder, you can bind to it and...

View Article


What are the dire consequences of accessing the fields of __m128i directly?

The MSDN documentation for __m128i says You should not access the __m128i fields directly. What are the dire consequences of accessing the fields directly? The first consequence is portability: The...

View Article

Why are my notification icon customizations lost aftter six months of disuse?

A customer had a notification icon that was used only once every few months. They found that even though the user configured the icon to appear on the taskbar, if six months went by without the icon...

View Article

Why did Windows 95 store image list bitmaps four-across instead of as a...

We learned some time ago that bitmap strips should be stored vertically in order to improve data locality. If you dig back into your dusty archives, you might discover that Windows 95...

View Article


Was there a problem with Windows 95-era programs relying on undocumented...

Tihiy noted that back in the Windows 95 days, there was a lot of undocumented stuff lying around in places that are formally undefined. For example, the return value of Is­Window is formally zero or...

View Article


How can I control which parts of the shell namespace the INamespaceWalk::Walk...

The INamespace­Walk::Walk method initiates a depth-first traversal of the shell namespace, subject to constraints controlled by the various parameters (such as maximum search depth). If you pass an...

View Article

How can I cancel the INamespace­Walk::Walk operation?

We saw that you can stop a INamespace­Walk::Walk operation by returning a COM error code from the Enter­Folder or Found­Item callback. So let's do that in order to add a timeout to the namespace walk...

View Article

Cancelling the INamespace­Walk::Walk operation a little faster

We saw last time that you can stop a INamespace­Walk::Walk operation by returning a COM error code from the Enter­Folder or Found­Item callback. However, that may not be fast enough. I noted some time...

View Article

Image may be NSFW.
Clik here to view.

On memory allocations larger than 64KB on 16-bit Windows

Allocating memory blocks larger than 64KB was tricky in 16-bit Windows because the nature of 16-bit segment:offset addressing meant that you could access the memory only 64KB at a time. Global memory...

View Article


Microspeak: FCIB

FCIB (pronounced either by spelling it out F-C-I-B or as a sort-of acronym eff-sib) stands for "foreign checked-in binary". It refers to content checked into a project as binary output, rather than as...

View Article

What happens if you simply return from the thread callback passed to...

Medinoc asks, "What happens when one simply returns from the thread callback? I'd suspect the code gluing between _beginthread() and its callback calls _endthread() upon return, while the code between...

View Article


Why is there no way to add a permission to a page with VirtualProtect instead...

The Virtual­Protect function lets you change the protection of a page, but all it can do is replace the current protections with the protections you specify, returning the old protections. There is no...

View Article

The wrong way of benchmarking the most efficient integer comparison function

On StackOverflow, there's a question about the most efficient way to compare two integers and produce a result suitable for a comparison function, where a negative value means that the first value is...

View Article


How can I find the installation directory for my UWP application?

After you've installed a UWP application, you may want to know where it got installed to. Maybe there's a deployment bug that you're trying to resolve. Maybe it's just because you're curious....

View Article

The sad implementation history of COM component categories and why it means...

COM component categories let a COM object registration declare what kind of object it implements. Programs that want to offer a list of "all objects which can do X" can ask the COM component category...

View Article

Image may be NSFW.
Clik here to view.

What is the documentation for SetParent trying to tell me about synchronizing...

The documentation for the Set­Parent function says When you change the parent of a window, you should synchronize the UISTATE of both windows. For more information, see WM_CHANGE­UI­STATE and...

View Article
Browsing all 3085 articles
Browse latest View live