Showing tag results for Code

Jul 15, 2004
Post comments count0
Post likes count1

Don't forget to #define UNICODE if you want Unicode

Raymond Chen
Raymond Chen

I answered this comment directly, but it deserves reiteration with wider visibility. If you don't #define UNICODE, you get ANSI by default. If you want to see characters beyond the boring 7-bit ASCII, make sure you are using a font that can display those characters. I am assuming a level of competence where issues like this go without s...

Code
Jul 15, 2004
Post comments count0
Post likes count1

Don’t forget to #define UNICODE if you want Unicode

Raymond Chen
Raymond Chen

I answered this comment directly, but it deserves reiteration with wider visibility. If you don't #define UNICODE, you get ANSI by default. If you want to see characters beyond the boring 7-bit ASCII, make sure you are using a font that can display those characters. I am assuming a level of competence where issues like this go without s...

Code
Jul 12, 2004
Post comments count0
Post likes count0

Positioned vs. non-positioned listview views

Raymond Chen
Raymond Chen

Occasionally, I'll see a question that betrays a lack of understanding of difference between the positioned and non-positioned listview views. The question usually goes along the lines of "I inserted an item with LVM_INSERTITEM but it went to the end of the list instead of in the location I inserted it." To understand what is going on, you ne...

Code
Jul 7, 2004
Post comments count0
Post likes count0

Obtaining a window's size and position while it is minimized

Raymond Chen
Raymond Chen

If you have a minimized window and want to know where it will go when you restore it, the GetWindowPlacement function will tell you. In particular, the tells you where the window would go if it were restored (as opposed to minimized or maximized). One perhaps-non-obvious flag is WPF_RESTORETOMAXIMIZED. This flag indicates that the window...

Code
Jul 7, 2004
Post comments count0
Post likes count0

Obtaining a window’s size and position while it is minimized

Raymond Chen
Raymond Chen

If you have a minimized window and want to know where it will go when you restore it, the GetWindowPlacement function will tell you. In particular, the tells you where the window would go if it were restored (as opposed to minimized or maximized). One perhaps-non-obvious flag is WPF_RESTORETOMAXIMIZED. This flag indicates that the window...

Code
Jun 29, 2004
Post comments count0
Post likes count0

The difference between thread-safety and re-entrancy

Raymond Chen
Raymond Chen

An operation is "thread-safe" if it can be performed from multiple threads safely, even if the calls happen simultaneously on multiple threads. An operation is re-entrant if it can be performed while the operation is already in progress (perhaps in another context). This is a stronger concept than thread-safety, because the second attempt to per...

Code
Jun 28, 2004
Post comments count0
Post likes count0

When does SHLoadInProc unload a DLL?

Raymond Chen
Raymond Chen

The SHLoadInProc function instructs Explorer to create an instance of a particular CLSID. This causes the DLL responsible for that CLSID to be loaded. But when is it unloaded? This is one of those puzzles you should be able to figure out by thinking about it. Consider: The object is created by calling CoCreateInstance and then imme...

Code