Date: | March 1, 2005 / year-entry #51 |
Tags: | pages |
Orig Link: | https://blogs.msdn.microsoft.com/oldnewthing/20050301-00/?p=36323 |
Comments: | 191 |
Summary: | Post suggestions for future topics here instead of posting off-topic comments. Note that the suggestion box is emptied and read periodically so don't be surprised if your suggestion vanishes. (Note also that I am under no obligation to accept any suggestion.) Topics I are more inclined to cover: Windows history (particularly the Windows 95 era).... |
Post suggestions for future topics here instead of posting off-topic comments. Note that the suggestion box is emptied and read periodically so don't be surprised if your suggestion vanishes. (Note also that I am under no obligation to accept any suggestion.) Topics I are more inclined to cover:
Topics I am not inclined to cover:
(Due to the way the blog server is set up, a new suggestion box gets set up every 30 days, assuming I don't forget to create a new one. If I forget, you can send me a reminder via the Contact page. You can also peek at the previous suggestion box.) |
Comments (191)
|
Ah well I’m at the top of the list again.
RecentDocs and Notepad.
Notepad does not call ShAddToRecentDocs (depends and apimon). Commdlg does link to it.
Dbl click a file, no file open dialog , added to menu
In cmd – notepad fname – no file open dialog, added to menu, it’s in command so explorer isn’t doing it.
Drag a file into a notepad window – NOT added to menu.
How and how many ways are documents added to the recent docs menu? What does the EditFlags settings affect (shaddtorecentdocs say exe are not added – is this hard coded or is this just the edit flags – in which case why doesn’t it say other files types aren’t added either due to editflags such as dlls or vbs executed [as opposed to edited]?).
[Migrated from Suggestion Box 2.]
[Migrated from previous Suggestion box.]
Some suggestions for topics to cover:
Some sort of thingo on the "inner workings" of the windows Menu manager. I see several articles online around the place refering to various internal menu manager things like strange messages connected with menus only known by their IDs (e.g. 0x1E5 is one I have seen refered to)
Also, covering some of the less well-known menu related APIs would be nice
Also, I have seen several applications that dont have a "menu bar" but instead have a toolbar made to look like a menu bar. Some kind of example or something showing how to pull that off (and yet still have regular menu resources) would be very cool to see :)
And, I wanna know how they did those cool menus in Visual Studio .NET 2003 :)
Another thing I have always wanted to know is how those codenames (Cairo, Chicago, Daytona, Memphis, Whistler etc) map to actuall windows versions…
[Migrated from Suggestion Box 2.]
[Migrated from previous Suggestion box.]
Hello, I’ve always wondered why the Win32 api handled shortcuts/links so inconvinient for programmers.
[Migrated from Suggestion Box 2.]
[Migrated from previous Suggestion box.]
Hi Raymond. How about covering how to do custom draw in toolbars? My specific problem is that the toolbar provides no metrics for where the icon, text, drop down arrow or separator for drop down arrow should be placed.
This isn’t so much of a problem for drawing the text and icon, because it doesn’t have to be pixel perfect to the existing UI.
The big problem is when trying to custom draw drop down arrows on split buttons. I need pixel perfect positioning to know where to draw the split separator, so that I can draw accurate hit testing feedback. Another problem with this is that during the custom draw cycle, there is no way of telling that the split drop down part has been hit – the notification you are sent is simply CDIS_HOT.
Without this information, custom draw on toolbars is next to useless, unless you just deal with a simple text or image button.
Cheers
Matt
[Migrated from Suggestion Box 2.]
[Migrated from previous Suggestion box.]
I’m interested why filenames are not allowed to contain the question mark, "?". In the shell, this character could easily be escaped (e.g. with C-style backslashes, "?") so not to be confused with the wildcard character. "Normal" users don’t care about wildcards anyway, but some have complete sentences as filenames and complain that they can’t end them with a question mark. I assume it’s a backwards compatibility thing; would you care to explain it?
[Migrated from Suggestion Box 2.]
[Migrated from previous Suggestion box.]
I’ve noticed that most (all?) windows controls immediately repaint themselves after their state has been changed. (For example, if you send the LB_SETTOPINDEX message to a Listbox). Do the controls use UpdateWindow or some other mechanism? What is the reason for this design? You could just wait for the next WM_PAINT message.
Also I’m interested in a DestroyMenu issue: Why is it possible to delete a menu that’s still assigned to a window? And why does GetMenu still return the handle of the deleted menu?
[Migrated from Suggestion Box 2.]
[Migrated from previous Suggestion box.]
I want to know how to get a registration code for my new computer’s Office 2003 WITHOUT having to pay for an upgrade.I JUST BOUGHT Windows Office 2000 from another source!! I cannot access my school’s websight/powerpoint presention without a new registration code for 2003 Office! I DON’T WANT IT! There is NO instruction on how to bypass this, dispite the websight’s claim! HELP!
[Migrated from Suggestion Box 2. Unclear why this person is asking a question on a topic I explicit said that I don’t cover. (Microsoft software that isn’t Windows.)]
[Migrated from previous Suggestion box.]
Do you know how to disable the annoying warning in Windows whenever you try to rename a file extension (i.e. "If you change a file name extension, the file may become unusable…")? A 30 minute web search didn’t provide an answer and yet it’s a question that’s been posted many times on the newsgroups.
[Migrated from previous Suggestion box.]
Curious about IBM’s SAA CUA (Shift + Insert et al) and current conventions in Windows.
I wanted to know if F10 was the CUA menu access key or a MS access key. Do you think the CUA is defined anywhere, (obviously it must be).
I had thought windows was CUA complient. But Alt + Backspace does not undo in the shell (though office uses it).
[Migrated from previous Suggestion box.]
CreateRemoteThread().
Why does it exist? Did the designers of Windows have something specific in mind when they included it, or did they just think it might come in handy?
MSDN mentions some things that you shouldn’t use it for, but nothing that you should!
[Migrated from previous Suggestion box.]
I have shortcuts on my desktop to files and folders that have been assigned shortcut keys. Sometime when you press the shortcut keys the function responds instantly and other times I get a 5 second delay (explorer is locked to the point where animated system tray icons stop). Are you able to explain what the shell does when a shortcut key is detected?
[Migrated from previous Suggestion box.]
Going through Petzold’s book, I’ve come to realize the amount of complexity behind the easy-to-use print subsystem in Windows. Some history / inside info on the print subsystem would be great.
[Migrated from previous Suggestion box.]
Two questions:
At one point you had an internal web page that was dedicated to keeping track of the statistics for re-orgs (IIRC it was called ‘days between re-orgs’. Do you still maintain that page? Regardless, could you share/post it (even/especially if it is very dated and refers to the Win95 days).
Second question;
What percentage of Win95 code would estimate was for backwards compatibility? How would that percentage break down between DOS compatibility and Win3.X compatibility?
(finally: do you still wear a suit to work?)
[Migrated from previous Suggestion box.]
One Topic (two questions): What does Windows Explorer actually do when you select a removable media drive?
I have a 70mb zip file in the root of my USB Jump Drive and it takes a really long time for the file list to appear (for the root of the drive, as see on Windows XP). If I move it to a folder there’s no wait on selecting root or the folder.
Is it really reading in the entire file?
[Migrated from previous Suggestion box.]
A couple of topics (one I’ve brought up before, another that someone else brought up in the NCCALCSIZE discussion in Feb. but you haven’t returned to yet).
1. Window Activation – how it works (and why you need to do the whole message-eating modal loop for FakeMenu).
2. WS_EX_TRANSPARENT – what does this really do? For example, using GroupBoxes on a dialog with WS_CLIPCHILDREN enabled, you need WS_EX_TRANSPARENT on the group box or else its background is painted incorrectly.
Thanks :)
Simon
[Migrated from previous Suggestion box.]
http://support.microsoft.com/default.aspx?scid=kb;en-us;327699 describes how to increase the number of user handles from 10000 to 18000.
I’m very curious about the reason for this limitation? Follow-up question: Limitation also present in 64-bit Windows?
Same question applies to the desktop heap size… (the default 3MB is barely enough to hold 30 instances of IE)
A number of my users have been bitten by these limitations.
Any historic insight on this topic would be great. I naively assumed Windows NT was supposed to get rid of statically allocated buffers and such.
—
Rune
[Migrated from previous Suggestion box.]
Even though these apis are undocumented/unsupported I have found a few applications that depend on them. So far to date google searches only explain how about 2 of the SystemFunction APIs work. If these APIs are frozen could you please provide some documentation or explainations about them.
Thanks
Steven
[Migrated from previous Suggestion box.]
Why is it that after a couple of failed logins in windows 2000 it seems to wait for a long time at the next failed login before coming back with an invalid password message ?
[Migrated from previous Suggestion box.]
Can you please add a search functionality to your web-page that will help in locating older articles? I frequently remember reading something on your page, but then I spend lots more time looking for it because there doesn’t seem to be a way to search.
[Migrated from previous Suggestion box.]
Re Dave’s question: Many servers put in an extra delay after x wrong login attempts. It might even be a prerequisite for C2 security compliance?
[Migrated from previous Suggestion box.]
The last selected file is also the last you clicked on — the current item.
If I’m right, then clicking on item #3 and pressing CTRL+A (usually "Select all") would open item #3 first and then the rest..?
[Migrated from previous Suggestion box.]
Microsoft does not support using MSXML in .NET, for a variety of reasons.
http://support.microsoft.com/default.aspx?scid=kb;en-us;815112
What are the reasons and diffs preventing dotnet interop to be used to migrate old apps on dotnet?
[Migrated from previous Suggestion box.]
For the "MS Software Trivia" section: Can you dig up the origins of the =rand(200,99) trick in Word? Seems to be a leftover debug feature or something like that…
[Migrated from previous Suggestion box.]
For windows with WS_VSCROLL/WS_HSCROLL style, I noticed that the SetScrollInfo() API draws directly into the window’s non-client area to draw the scrollbar. That is, the scrollbar drawing seems to be done somewhere within the SetScrollInfo() call itself instead of sending a WM_NCPAINT to the window specified in the SetScrollInfo call.
This seems incredibly broken from an architectural point of view. Instead of drawing the scrollbar parts directly, shouldn’t SetScrollInfo() send the window a WM_NCPAINT message and have the window itself do the scrollbar drawing (like it normally does)?
Because of this behavior, it’s difficult to do custom scrollbar drawing for windows that use non-client area scrollbars (i.e., those with WS_VSCROLL/WS_HSCROLL styles). The typical approach of using window subclassing to intercept the WM_NCPAINT message handling won’t work because of this, especially for USER-based controls like LISTBOX, where you cannot change the source code.
Is there a reason why SetScrollInfo() draws directly into the window’s non-client area instead of using WM_NCPAINT.
Thanks!
[Migrated from previous Suggestion box.]
Raymond –
I’ve got a question about how best to handle very large files that are going to be read in a mostly sequential fashion.
For some background, I need to read a single, very large (much too large to cache entirely to memory) file in two independent streams. These streams each read a discrete (smallish) block of bytes from the file, starting at roughly (and this is the real devil) the same location on each iteration. Unfortunately, due to the vagaries of what I’m doing, the streams need to access this data in a particular order and I have no way of knowing which has the earlier starting index.
So, my question is – when I ask windows to do an fread or Async read, does it cache to a window with bytes before and after my local read index, or does it only cache in a forward-looking manner? (presumably, there’s some caching of some sort going on) Or, more specifically, am I better off writing a file access layer that does caching explicitly the way I want it to (at the cost of some memcpy’s) or does Windows handle this pretty well?
Tim
[Migrated from previous Suggestion box.]
CarlSo: I checked with the window manager team. They say that the current documentation is correct.
[Migrated from previous Suggestion box.]
Hi Raymond,
Have been trying to find answer for this one from a long time. Why can’t i reuse windows explorer like IE ? What i mean is i could write an Asynchronous Pluggable Protocol for IE and replace the default http:// protocol with my own implementation or i could write a new protocol say newprot:// and plug it in. What i haven’t been able figure out is how to do this in Windows Explorer? I guess it uses file:/// why isn’t there a way to plug in my own protocol?
regards,
sarvesh
[Migrated from previous Suggestion box.]
Hello Raymond, you might find the following link of interest. It scientifically explores different methods of voting, to find out which fulfill various criteria. An example is the Favourite Betrayal Criterion. A voting method fulfills the Favourite Betrayal Criterion if:
<i>For any voter who has a unique favorite, there should be no possible set of votes cast by the other voters such that the voter can optimize the outcome (from his own perspective) only by voting someone over his favorite.</i>
http://electionmethods.org/
Anyway, might be worth a post, or at least, you might enjoy looking over the site.
[Migrated from previous Suggestion box.]
I’m curious why the GUID structure is so oddly defined. Why is it 1 DWORD, 2 WORDS, and 8 BYTES? Why not just an array of 4 DWORDS?
[Migrated from previous Suggestion box.]
Do you know how many computers are used to build windows?
Or is there no central build and each subteam builds its own dll’s which are integrated afterwards?
[Migrated from previous Suggestion box.]
See http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-03.txt) for the straight dope on GUIDs.
To answer your question as to why its broken out like that, its because the fields have meaning. From the above doc:
UUID =
time_low "-" time_mid "-" time_high_and_version "-" clock_seq_and_reserved clock_seq_low "-" node
Of course, starting with win2k the OS does a hash so you can’t extract the MAC address.
You can still tell some interesting things through. The first character of the 3rd group (bits 48-52) contains the version, and will be 1, 3 or 4. Version 1 is typically pre-win2k, 4 is win2k or later. Version 3 GUIDs are used in .NET to signify that the GUID is a hash of the fully qualified class name, assembly, version, etc, so the GUID automatically changes when the class or interface has a breaking change (slick!).
[Migrated from previous Suggestion box.]
What do you look like Mr. Chen ?
[Migrated from previous Suggestion box.]
I’ve always wondered why it is there’s no way to get the filename(s) for a font enumerated by EnumFontFamilies(Ex)? I realize that a single file may contain more than one style of font (true of TrueType and OpenType fonts), or, in the case of Type 1 fonts, a single font style may utilize multiple physical files (pfm/pfb/afm/etc), but this always seemed kind of silly to me. Is there a history or reason this has never been supported?
PS: Hopefully this is within your area of expertise, if not, I apologize.
[Migrated from previous Suggestion box.]
When computer starts up, random set of programs get started. Trying to see how I can remove them from being autostarted. I have looked at run, runonce and runonceex keys and I do not see an entry for many of them.
Is there another way that shell does auto start?
[Migrated from previous Suggestion box.]
The fact that people disassemble internal windows functions has created backwards compatibility problems, has Microsoft ever considered code obfuscation to avoid this? If no, why?
Ivan.
puoti@inwind.it
[Migrated from previous Suggestion box.]
In the XP notification area, the most recently added icon is on the left. This is the opposite of previous OSes. What brought on that change? I assume it was a usability improvement, but was there a particular usability problem with the old way?
[Migrated from previous Suggestion box.]
‘Hair Color of the "Person" Icon for a User Group Becomes Gray If the Group Contains More Than 500 Users’ (KB 281923) The KB article says "Microsoft has confirmed that this is a problem", but is it? What kind of problem does it cause?
[Migrated from previous Suggestion box.]
I’ve found your blog when tries to search info about "How to get which window displayed in taskbar".
I’ve tried to Enumerate windows using EnumWindows function, then I tried to get, which window should be shown in task bar:
All returned windows are top-level, i.e. I suppose they don’t have parrents. Then I check, is window visible, does it have no WS_EX_TOOLWINDOW exStyle and… here I get stuck.. MS Visual Studio.NET have got two windows in top level, both of them have no parent, only one have got WS_EX_APPWINDOW, but this one have got zero-sized window rectangle!!!
Another one have no WS_EX_TOOLWINDOW exStyle but why I don’t see it in status bar? Also Spy++ have the same properties as one of that window and it is showed in status bar…
Could you give me the key?
—
Cyril Margorin
comargo@hotmail.com
[Migrated from previous Suggestion box.]
Sorry for disturbing, I’ve got the problem :) I’ve just forgot about Owner.
[Migrated from previous Suggestion box.]
I used the info from this website to fix the above referenced Windows XP Service Pack 2 problem. Then I turned off the automatic updates. When I needed to restart my computer the problem was back and I need help in getting rid of it. The Windows XP Hotfix file KB834707 is back and it won’t let me delete the file. Any help would be appreciated and you can e-mail me at the above address. Thank you.
[Migrated from previous Suggestion box.]
If you remember Norton Navigator from 1995, it had a feature that let 16-bit apps "see" LFNs (not sure how exactly, I didn’t use NN much). I’m curious if apps like NN cause the shell team any extra grief in app compat. Did the team ever have any discussions that included the words "WTF are they doing?" ;)
[Migrated from previous Suggestion box.]
My suggestions is to talk about how SetWindowsHookEx is implemented.
I was playing around with setting a global keyboard hook and am wondering how it does that. Is my dll with the keyboard window proc injected into every running process?
[Migrated from previous Suggestion box.]
Raymond, I have always been curious why the Windows painting model was originally designed to be two step: i.e. 1) erase the background and then 2) paint.
And, if you really fell like it, it will be a nice bonus if you can explain what role the WM_SYNCPAINT message plays in the entire story.
(honestly I think "used to synchronize painting while avoiding linking independent GUI threads" doesn’t explain everything).
And by the way — thanks for the nice blog.
[Migrated from previous Suggestion box.]
What’s the best way to determine if two different Windows path names point to the same file? Between shell links, UNC and DBCS, the problem would seem to be a little more complicated than a simple lstrcmpi call.
[Migrated from previous Suggestion box.]
How do you personally have your users set up on your desktop machine? Do you run everything as Administrator? Install everything as Administrator and run as another user? Install various packages under different users?
[Migrated from previous Suggestion box.]
Why is the zoom behaviour of CTRL-Mousewheel in Internet Explorer the opposite of the zoom behaviour in the Rich edit control?
Which should we prefer to implement in our own applications?
[Migrated from previous Suggestion box.]
Hi Raymond,
Is there a limitation in Managed C++ when calling unmanaged functions via Platform Invoke with regard to the type of return?
I am trying to call Kernel32.dll’s function GetLargestConsoleWindowSize from a Managed C++ class. I have created the prototype in my managed code like this:
[DllImport("KERNEL32.DLL", EntryPoint="GetLargestConsoleWindowSize")]
static COORD GetLargestConsoleWindowSize(int hConsoleOutput);
COORD is a structure declared like this
[StructLayout(LayoutKind::Sequential)]
private __value struct COORD
{
short x;
short y;
};
which mimics the API structure used by the API’s GetLargestConsoleWindowSize function.
The problem is that when I try to compile I get an error C3385 that tells me that "a function that has a DllImport Custom Attribute cannot return an instance of a class". I know for sure that the C# compiler doesn’t have this limitation. I tried to find some references to this error on the net, but couldn’t find any.
Do I interpret these the right way? Is there a workaround for this problem?
Regards,
Eddie
[Migrated from previous Suggestion box.]
Please explain how Windows draws ‘opaque’ windows that you can see through but still read the text on them.
[Migrated from previous Suggestion box.]
I’m curious about the reason for an XP annoyance I have come across. On previous versions of Windows, I could mark a file, hit SHIFT-delete and immediately hit return, knowing that the key press would be received by the "Are you sure?" dialog when it finally made an appearence.
On XP, the RETURN goes to Explorer instead. This is bad news if you’ve marked twenty files for deletion. Is this intentional?
[Migrated from previous Suggestion box.]
I would be really interested in knowing a bit more about the inner workings of the Memory Manager. The main reason I’m asking you this is because on fairly powerful machines, Windows behaves strangely sometimes when it comes to memory management.
For instance, if you have a machine with 1 or 2 GB of RAM, the currently running applications only use about 200-300 MB of RAM and you start copying a CD from the CDROM drive to the HDD, you’ll end up doing a lot of paging. It turns out that, although you have enough RAM to load the entire CD in it, the memory manager still feels a strong need to send some pages to the pagefile. Why does that happen?
[Migrated from previous Suggestion box.]
Im working on a very complicated desktop system used for electronic trading. The desktop uses many windows with plugins in each window.
In order to save on the hudreds of megabytes of memory used by loading plugins in separate windows i have converted the GUI from an SDI model to MSDI. This lets multiple windows share DLL’s and resources whilst maintaing the appearance of separate applications.
The only problem is that the system runs its own taskbar so i need to remove the window icons from the windows taskbar. The standard MFC solution requires a hidden parent window.
But this in turn means that when i activate one window, all the windows in the same MSDI process get raised. The breaks the illusion that the MSDI windows are actually separate processes and destroys the continuity of the desktop.
How do you prevent child windows of a hidden parent from gaining focus ? I need windows without windows…
[Migrated from previous Suggestion box.]
You often complain that users don’t read. Have you ever put that to the test, say by doing usability tests where all the dialog text is in a foreign language (menus are still english)?
[Migrated from previous Suggestion box.]
Whenever I create a .cmd/.bat file and use Swedish characters such as &amp;#229;,&amp;#228; and &amp;#246; in paths I wind up editing the file using the DOS edit.exe application since notepad doesn’t understand the "OEM" codepage.
Whenever I go through this pain I wonder why the command processor can’t execute Unicode .cmd files when piping Unicode text into commands works fine (i.e. sort <unicode.txt works fine and cmd with /u creates unicode text output). Do you know?
[Migrated from previous Suggestion box.]
Is there a reason why Shortcuts are the way they are?
Is there a reason why Shortcuts werent implemented more like Symlinks on unix or Aliases on mac?
Can you shed any light on the history of shortcuts?
[Migrated from previous Suggestion box.]
I’d love something on how to create a filter string for a File dialog. Basically it looks like I can hard code something / put it in the resources, or I can spend several days trawling through the registry piecing together what I need. Why can’t I just give the dialog a file suffix and let it work out what the full details of the filter string should be?
For example, not only do I need an extension I also need a "description" (for example "Text file" for .txt). This should probably change depending on what language your Windows is in (mine is German, and so is the File dialog, except the filter string depends on the language of the app, which I find odd).
[Migrated from previous Suggestion box.]
If you think there’s enough general interest and it’s interesting to you:
How would you save Explorer window positions, characteristics so as to be able to recreate the windows later in same location, directory, windows status (does it have an address bar, buttons, etc.) and how they were the files displayed (details, list, etc.)?
The last two seems to be rather difficult…
[Migrated from previous Suggestion box.]
With my Word for Mac v. X, I find no way to insert page numbers on my written documents. the "help" function tells me to go to the INSERT menu and click on "page numbers" therein. But there is no such thing as "page numbers" in my INSERT menu. Can’t find it on any menu. What gives?
[Migrated from previous Suggestion box.]
One of the things I have always wanted to know is the cases where you would use RegisterHotKey and where you would use the the hot key common control and which one you should prefer
[Migrated from previous Suggestion box.]
What do the RtlIsThreadWithinLoaderCallout() and RtlDllShutdownInProgress() functions do?
Ivan.
[Migrated from previous Suggestion box.]
I frequently launch explorer windows with an adjusted folder tree root, using a shortcut such as:
%windir%explorer.exe /e,/root,C:SomeDir
I love this option for explorer windows, which keeps the folders tree limited to this folder and below. It is especially useful if the actual root directory is several levels deep (say, C:SomeDirOtherDirOneMoreDir…).
BUT, when I press F3 to run a search from this window, it doesn’t default to "look in" the correct folder, and instead is set to search all local drives. Why is that, and is there any easy fix?
(incidentally, F3 in this scenario also opens a separate window, rather than replacing the folders pane with a search pane, but as I happen to LIKE the separate window behavior this is a "good thing" IMHO.)
I’m on WinXP SP1 if it makes any difference.
[Migrated from previous Suggestion box.]
What does the User32InitializeImmEntryTable() function do?
Ivan.
[Migrated from previous Suggestion box.]
I’d like to see some explanation about Windows memory management and virtual memory.
A lot of Mozilla Firefox users are complaining that when the app. is minimized and idle for a while, restoring it can take a long while and are blaming Windows memory management. Read more here: https://bugzilla.mozilla.org/show_bug.cgi?id=76831
[Migrated from previous Suggestion box.]
Could you please comment on
Q136218 – BUG: DdeConnect Never Returns
more specifically, on the "solution", which seems a bit unpractical to me: if a window message takes long to process (e.g. notepad opening a 1GB file) it will block DDE for ALL OTHER PROCESSES during this time, and yes: on win32.
[Migrated from previous Suggestion box.]
Rumors say that Longhorn will have a Secure Execution Environment (SEE) that will allow people to use their computer as administrators and perform administrative tasks, while running their regular applications as users. This can be achieved by using Code Access Security for managed code and restricted tokens for native code.
Technically, this is already possible today on Windows 2000 and later by using restricted tokens. One example is a tool written by Michael Howard that starts processes with such a restricted token (http://msdn.microsoft.com/library/en-us/dncode/html/secure11152004.asp).
Has the possibility of implementing this feature been taken into account for Windows 2000/XP? How would you differentiate between "administrative" and "regular" apps? (I assume you would not set a magic bit in some header, but use some cryptographic techniques instead – in .NET it’s easy, you can grant permissions based on an assembly’s origin).
Why isn’t such a feature present in Windows today? Many people blindly run as administrator, Windows XP by default creates administrator accounts after installation (the first account you specify in the list, the others are user accounts, to be more precise). Running Outlook Express or other apps with big security issues with restricted tokens might have made the world a better place in the past years…
[Migrated from previous Suggestion box.]
lfWeight of the LogFont structure.
I have always wondered this: I don’t know if you know all of the ins and outs of the GDI, especially when it comes to fonts.
But, why is it that in the MSDN documentation for LogFont it talks about weights for 0-1000 being available, but in reality, you get only really get the equivalent of FW_NORMAL and FW_BOLD…
Of course, I could be missing something, and if so, what am I missing…? (Maybe its the same thing every single web browser seems to be missing… It’d be nice if the weights worked as expected in browsers ;) )
[Migrated from previous Suggestion box.]
Question about how different parts of Windows go about finding an executable you wish to run.
Example: In Start->Run, if I type "winword", Word starts up. If I open a console and type "winword" I get the error "’winword’ is not recognized…’; if in the same console, I use "start winword" then Word comes up.
What is the logic and the different APIs used to find winword.exe? It seems that the console by itself simply uses SearchPath; but the shell seems to be more thorough.
[Migrated from previous Suggestion box.]
Raymond,
At various places I read that MS is using C (not C++) exclusively for developing products. But at least Visual Studio must have been created using MFC and thus, C++. I also recently encountered that there is at least one system DLL (WMI’s framedyd.dll) that has a strict C++ interface with C++ mangled names. I also read that during NT development the GDI group around Chuck Whitmer first started using C++ which they later abandoned in favor of C. Can you shed some light on which products or groups use C exclusively and which ones use C++ or a mixture of both? Maybe you could also give some historic retrospect on when and how far C++ pervaded development at MS?
[Migrated from previous Suggestion box.]
Hi Raymond,
I just ran into this issue with using a Tree-view control from a dialog when using the Edit labels style..
see KB: 130692
http://support.microsoft.com/default.aspx?scid=kb;en-us;130692
"SYMPTOMS
WM_COMMAND|IDOK errors are received when you edit labels in a TreeView control.
CAUSE
The edit control created by the TreeView control can, and usually does, have an identifier of 1. This identifier is the same as IDOK. This can cause the parent window or dialog box to receive WM_COMMAND messages with an identifier of 1. Then the TreeView control passes on the EN_UPDATE and EN_CHANGE notifications from the edit control to the TreeView’s parent.
This was a design decision made to meet system requirements and cannot be changed. If the parent window is going to perform some action in response to a command with an identifier of 1, this problem can occur. This problem is especially significant in dialog boxes that use the standard IDOK for a command button control. "
Just wondering if you know what was the design decision? I mean this looks like a glaring compatibility issue, why else would you stick to such a kooky implementation? I especially like the forceful verbage "cannot be changed," undoubtedly there was a lot of requests to change it.. so what was the scoop?
I liked the biPlanes piece, always good to understand how the software implementation really reflects the hardware, would love to read some more about those early decisions that shaped the GDI (and what’s with the DWORD aligned scanlines in a bitmap).
[Migrated from previous Suggestion box.]
I don’t know if this is a bug, but…
In Explorer if one sorts files by date and then change one of the files (e.g. open, change, and save it) Explorer recognises this, updates … and puts the updated file at the wrong end of the list. Why? What the heck is that all about?
[Migrated from previous Suggestion box.]
I’d like some discussion of LoadLibrary. Is it possible to simulate it in a user program?
[Migrated from previous Suggestion box.]
I’d love to see some discussion on thread affinity for Win32 UI objects. You will find lots and lots of statements everywhere that UI objects have thread affinity, but I have found it hard to find information on what exactly causes that thread affinity. Are the internal window data structure allocated per-thread? Is there something thread-specific in the queue handling code?
Always curious &amp;amp; infinitely grateful for this great blog:
Claus
[Migrated from previous Suggestion box.]
So many of the MSDN articles are about "Managed Code" that I begin to wonder is the Win32 API truly an Albatross? I mean the more I write C++, the more I want to write C++ and the less I’m inclined to write C# or Java, even though C++ is painfully slow compared to C# or Java, the granularity of C++ is so much better and perhaps it’s being a control freak, but knowing what’s going on and what I’m doing even with the abstraction of the API just feels so much better than having my code "interpreted". So where will the C++ programmers go over the next decade, are they dying out to a new generation of "managed coders"? And who will do the "managing"?
[Migrated from previous Suggestion box.]
Shell Namespace extensions in C++ code. The examples I’ve seen to be in MFC, or badly explained, and usually both. Actually, all the shell prgramming stuff is interesting, as is any COM or OLE stuff you can do.
More on non mainstream Windows platforms – ia64, x64, and any others that you can talk about. Could you do an article on XBOX/XBOX2 for example? Windows CE internals.
Windows history, especially the 16bit stuff.
[Migrated from previous Suggestion box.]
I would like more infomation on how the trash can really works in Windows.
[Migrated from previous Suggestion box.]
Interested in the history of FormatMessage and how it determines which MessageTable entry in a resource file to scan for the message id. On the same topic how does FormatMessage handle multiple MessageTable entries when internationalizing the message file.
[Migrated from previous Suggestion box.]
I have noticed that windows will sometimes take a very long time to delete a file. It seems to be the first delete after a reboot. I notice the hard drive spinning away for sometimes over 10 seconds before the file actually removes itself.
What the heck is going on??
[Migrated from previous Suggestion box.]
Could you please talk about NT native files?
[Migrated from previous Suggestion box.]
I would be interested in knowing how come each and every version of Windows I ever power-used (my Win95 days are a bit blurry, was still a kid back then) tilts up when I insert a CD or DVD into the drive?
The problem’s survived multiple reinstallations of Windows on many different hardware setups and as far as I hear, I’m not the only one with the problem.
It seems like a VERY annoying problem to me, but MS doesn’t seem to fix it in any of it’s new releases. I would suspect this is simply a matter of tuning the Generic drive driver… but I’m most certainly way off
anyway, I’d like to see the issue discussed :)
thanks for hearing me out.
[Migrated from previous Suggestion box.]
Are the backround of landscapes in windows xp and longhorn real pictures, are they artifically produced/assembled with a graphics program, or are they real photos tweaked with a computer?
[Migrated from previous Suggestion box.]
I’ve long been interested in learning a foreign language – perhaps German or Japanese. However, I don’t really know how to best go about doing so.
Perhaps you could share some tips for learning a second human language. What to learn (suggested starting languages), how to learn (books, classes, software) etcetera.
[Migrated from previous Suggestion box.]
Why does FloodFill bluescreen if it fills a to complex pattern/takes to long time to execute? It also seems to freeze every other process/thread while executing. Is this a "feature" of the driver or GDI?
[Migrated from previous Suggestion box.]
2. A more irritating problem is: While showing a newly created desktop, with a newly created Explorer-process, why does Win+R start a run window on the Default desktop instead of the active one? Does anyone really want this behaviour, I want Win+R to start a run-window on my current desktop. I suppose this applies to all hotkeys.
3. Is Multidesktop fully compatible with terminalserver+multimonitor?
4. Why isn’t it possible to BitBlt on a inactive desktop, while it’s possible to get windows coords &amp; layout from one.
5. What is the other always-existing desktops used for (SAWinStaSADesktop, __X78B95_89_IW…, Service…)
6. Why doesn’t Windows include a tool for the enduser to create/switch beetween desktops? The multidesktop feature is used frequently by x-windows users, but that’s because those systems usually has a bundled (installed &amp; obvious) tool for manage desktops.
[Migrated from previous Suggestion box.]
Why is there a CurrentVersion-key in the registry? Is it possible to hive several Windows-version’s registries there? How?
[Migrated from previous Suggestion box.]
Why is the scrolling of the mousewheel buffered but draging the scrollbar isn’t?
[Migrated from previous Suggestion box.]
What is the difference between SetWindowText() and WM_SETTEXT? Why are there situations where one works but not the other?
[Migrated from previous Suggestion box.]
Why does GDI32 invoke exceptions in it’s own functions (win95)?
GetRegionData
GetRgnBox
[Migrated from previous Suggestion box.]
How much wood would a woodchuck chuck if a woodchuck could chuck wood?
[Migrated from previous Suggestion box.]
Could you explain why Dr. Watson is called the way it is? Is it based on a true physician, or rather a random name?
[Migrated from previous Suggestion box.]
Is it true that windows has an inherit restriction in handling c++ classes residing in dynamically loaded dlls?
Can you explain if it is possible, and if yes, how to call &amp; access member functions in c++ classes and also public c++ class variables through a dll interface with explicit/late binding? Is it required to create ansi c wrapper functions or being dependant on com-like vtables which is compiler-dependant?
[Migrated from previous Suggestion box.]
Does GDI+ effectively re-implement everything in GDI, or is it a wrapper with some added functionality?
[Migrated from previous Suggestion box.]
Can you format a hard drive in XP Pro? I just put in a 250gig hard drive and made it my primary and turned my original 60gig drive to a slave secondary drive, but I can’t format the 60gig. I want to 60gig to just be a storage drive for images but I can’t format it.
How do you do this???
Brad in Virginia
[Migrated from previous Suggestion box.]
Is there an API that helps validate the ‘well-form-ness’ of a file/path name (Including the validity of characters used in that filename).
I looked in the PathXXX set in shlwapi.dll but didn’t find any relevant one.
TIA.
[Migrated from previous Suggestion box.]
Raymond,
I know I may be asking a lot here, but I would like to see more "Windows History" type postings. Recently, it seems you have mostly been talking about coding. That’s great and I enjoy it as well, but I’m realling loving why some things are the way they are in Windows.
Regards,
James Summerlin
[Migrated from previous Suggestion box.]
Its seems like I often come accross stuff about Win32 that says "Although this function is present in Win9x it has no effect when called" or "This function exists under Win9x but does not behave correctly". What was going on during Win9x developement? Why are there so many broken functions? And why are there so many partially or incorrectly implemented functions?
[Migrated from previous Suggestion box.]
I wonder why activating window doesn’t send WM_SHOWWINDOW message when window is hidden, though it actually makes window visible?
This produces strange effects if you can manage to activate hidden window. How you can do it? Easy! Select "menu &amp; tooltip" effects in display properties, and set it to "scroll effect". Now make simple app that will respond to size change and "minimize to notification area", i.e. hides itself when minimized. Then start application and double click on taskbar icon for application. First click will issue SC_MINIMIZE and initiate minimization (and animate window). While this is in process, window receives SC_RESTORE, but gets hidden before (by calling ShowWindow), and then WM_ACTIVATE comes to invisible window. It shows window, but never sends WM_SHOWWINDOW. This causes problems in Windows.Forms for example, because you have form displayed, but it’s Visible property is false! Weird…
You could suggest about responding to SC_MINIMIZE message instead and perform hide at this moment. The problem is that WIN-M button (minimize all) doesn’t send SC_MINIMIZE to windows, it instead changes their size and location.
[Migrated from previous Suggestion box.]
Several people say that Win9x still runs on DOS, like Win3.1 did.
To support this they give a screenshot of the system monitor with one DOS shell open, and it shows 2 virutal machines. They say this shows that Win9x is still based on DOS. My IT teacher says that is DOS based as well!
I know that a major part of Win9x is 16bit, but is DOS still the core of ths system?
[Migrated from previous Suggestion box.]
"The long and sad story of the Shell Folders key" has a lot of comments that havent been adressed.
To add my own story into the mix, I was writing an installation package some time ago for a program targeting mostly doctors. Just to do an unfair generalization I should point out that doctors are the greediest people I have ever met and their hardware is arcane. Most of them still use dot matrix printers.
Anyway, back to the point. While writing the installation package i naturally needed the folders of various files and used "shGetSpecialFolderPath" or a variation thereof. Thats when I discovered that the function is not present in shell32.dll versions released prior to the "Active Desktop" release, which means most installations of NT 4.0 and Windows 95. Neither was this package available for download anywhere (used to be, as a part of Internet Explorer 4.0), so "upgrading" was out of the question.
At this point I was tired of researching the problem and although I got a whiff of some DLL that could be bundled with my software to fix this, I just couldnt help but use the registry instead. It’s a lot cleaner and all the directories I needed where present after a clean installation.
The part that makes this story tragic (for me anyway) was that MSDN listed the function present in Windows 95 or newer without mentioning the version numbers of the DLL or Active Desktop (This has later been fixed). So I happily just followed the documentation, tested on windows 2000 and newer and shipped the thing. I’ll take partial fault on that one :)
Anyway, It would be really nice to see a follow up on that story where you try to give more detail on why just having it in the registry is such a bad idea. I fail to see how roaming profiles can be used as an excuse.
Oh and I should add that I love your blog. It’s nice to get a peek into the workings of microsoft without all the hubb hubb of marketing and such.
Kim
[Migrated from previous Suggestion box.]
http://discuss.joelonsoftware.com/default.asp?joel.3.57363.29
[Migrated from previous Suggestion box.]
Hi, I’ve been having a problem I have this thing NEWBIASANTI.EXE-2B742094, that’s always popping up in my taskbar under processes and it’s eating all my cpu. I delete it, but it keeps coming back on. I thought it was a virus or spyware but i did full scan and it wasnt. When i search it, it’s placed in the windows prefetch file. do you know what it is? how can I stop it from coming on? thanx
[Migrated from previous Suggestion box.]
I read your hyperthreading article (and others)–thanks for the excellent information!
After reading the article I was left wondering about something:
What’s the difference, from an application/device driver perspective, between hyperthreading and normal multithreading?
Here’s why I ask: I had a problem where a few programs and devices I use would halt my WindowsXP system with a bugcheck/blue screen. When I contacted the vendors, they told me to disable hyperthreading. I did, and the problems went away.
As a programmer, I can’t think of any reason why enabling hyperthreading would make it any more likely that thread-safety problems would be exposed.
What am I missing?
[Migrated from previous Suggestion box.]
IP Address Control Is Sooo Broken
I know it was made by IE team, but it is practically the part of Windows, and I struggle with it each time I have to change the IP address on some computer.
The designer of that control thought that only one octet of the address can be important to the user. If somebody sent you an IP address, can you copy that address and paste it in the control? No! Can you copy the IP address that’s in the control anywhere? No!
There is more: visual feedback: each filed behaves like separate edit control. So you are used to jump to the next control with tab. But you’d never get to the next field, just outside of the whole control.
It looks like the author considered more than extremely dangerous to let somebody type more than 3 numbers in one field.
It can be fixed. Just make one real edit control, limit the number of characters inside to 15 (4*3+3) and the characters to enter to 0..9 and ‘.’ and then let the people type the address, copy it, paste it, whatever. And then add some validation code on proper places, to keep all validations that already exist (e.g. if some filed is out of range, you can select exactly this part of the input, but it still can be an edit control).
[Migrated from previous Suggestion box.]
I have been using AVG Free for many years and now after being prompted to download up dates I find I can not shut down 98.
I tried all the fixes on the Microsoft site to no avail. Finally I uninstalled AVG Free and it was fixed.
Just to let you know.
Ed
[Migrated from previous Suggestion box.]
Why does the equal sign appear as I type an entry into a cell. I cannot get dates to appear as entered? Flustered.
[Migrated from previous Suggestion box.]
OK, here is my question. Why does Windows hide the ‘true’ name of a detected device?. For example, it pops up a message box saying "Ethernet Controller Detected" but not the device ID held in the devices firmware. I often find old bits of kit that still work and would be good in a simple box, but finding drivers is a pain, as I dont have a lot to search on.
[Migrated from previous Suggestion box.]
I wondered why there is a LVS_SHAREIMAGELISTS style for list controls, but none for tree controls.
[Migrated from previous Suggestion box.]
Windows Explorer buttons such as Back, Forward and Up are disabled when their action is not applicable.
On the other hand, buttons such as Cut, Copy, Paste, Delete are NOT disabled when their action is not applicable.
Why such a difference of behaviour ?
[Migrated from previous Suggestion box.]
I like to map shortcut keys to programs using by associating an alphanumeric key with a program through the program’s Windows shortcut. One thing I’ve noticed is that when I move a shortcut (from one part of the start menu to another) I have to delete and re-do the shortcut or it won’t work. Why is this, and is there any workaround other than recreating the shortcut.
See the following blog for a description of what I’m talking about:
http://www-128.ibm.com/developerworks/blogs/dw_blog_comments.jspa?blog=396&amp;entry=70266
[Migrated from previous Suggestion box.]
Hey, I just found your page yesterday. Great stuff! Okay, I’ve never read a blog before, so pardon me for being such a newb that I run right to the suggestion box, but I was wondering if Microsoft has done any psychological type of studies on programmers? For instance, I’ve been wondering for a long time why programmers take terminology so literally all the time. I think this would make a really funny piece. For example, I was in IRC one time (ok, yeah, it’s IRC, but I’ve seen this type of thing happen in many places), and someone (not a channel regular) enters the channel and asks something about null characters at the end of strings. Then someone (who I presume was a regular) replies, "you mean <such and such> about NUL characters?" Apparently, the regular thought that ‘