MS Word is an MDI or SDI - windows

I have a confusion that MSWord is a MDI or SDI application. Looking at the Application, I do believe that it is a SDI application but there are people who strongly "believe" that its an example of MDI. After using the Taskmanager in windows, the Applications tab list all all the instances of the Documents currently opened. However there is only one process in the Processes tab.
Since all the documents have same process, it make me feel its an MDI. But at the same time, the Applications tab lists all the documents opened make methink its an SDI. What do you people think about this? Please give your valuable and detailed answers.

If you uncheck Show all documents in the taskbar in Options, Word is a classical MDI application (even Word 2010).
If you leave it checked, it's an SDI application with multiple root windows.

According to Microsoft, it is an MDI application: http://msdn.microsoft.com/en-us/library/aa263481(v=vs.60).aspx
Depending on your settings and version, it could be MDI or SDI. It is MDI in older versions and if you use the "Show all documents in taskbar" option; otherwise, it is SDI.

Honestly, I didn't realize this part myself, until I tested:
After using the Taskmanager in windows, the Applications tab list all all the instances of the Documents currently opened. However there is only one process in the Processes tab.
Thank you and +1 on the post. On exploring further, I found something that might shed light further. I am using 2007, but I guess it would apply for 2010 as well. I clicked on the Control Menu (the small menu that pops up when you click on the Icon on the top left corner - used to be called Control Menu, before Microsoft decided to redraw its interface). You would find a "Word Options" button. Click on it, in the dialog that pops up after that, go to "Advanced" tab. Scroll down to the "Display" section. Locate the "Show all windows in the Taskbar" check box, I guess it will be checked. Uncheck it. You would see that there are no multiple windows (corresponding to each document) anymore. Also, in Task Manager, you will see only one instance even in the Applications Tab.
With this, I strongly believe Word is still an MDI. Oh by the way, if you want to see every document opened after you change these "Advanced" options, you might want to go to View menu and and chose "View side by side" option.

I came across some more info regarding this from Chris Ryan which I am sharing here:
It depends on what you mean by MDI.
MS-Word does have multiple documents and an interface but it does not fit the classic definition of an MDI application because it does not use an MDICLIENT window class to manage the child frames.
For an example of an MDICLIENT, see:
ftp://ftp.charlespetzold.com/ProgWin5/Chap19/MDIDemo/MDIDemo.c .
ftp://ftp.charlespetzold.com/ProgWin5/Chap19/MDIDemo/Release/MDIDemo.exe
Even the older versions of Word and Excel that had the child windows inside the main frame, were technically not MDI. They looked like it but they did not use MDICLIENT. MS used a proprietary windowing library called Software Dialog Manager. SDM was used so a common application code base could be used on multiple platforms: Windows, OS/2, & Mac. All they had to do was recompile for that platform and link a platform specific SDM library.
This link talks a little about SDM but does not mention MDICLIENT
http://msdn.microsoft.com/en-us/library/windows/desktop/dd317997(v=vs.85).aspx

Related

Displaying MDI Application as a single ICON on the TaskBar (VC++/MFC)

I have created an MDI app based on the MFC DocView architecture in the latest version of Visual-Studio, which is working well.
However, when the application is running, and its minimised icon is displayed on the desktop TaskBar, all the open documents are displayed along side one-another. Is there a way I can get only the Document having the current Focus show on the minimised list.
(In case I am not explaining my problem properly, try opening Microsoft Word, and creating a few empty documents. Now click on the minimised Word Icon on the taskbar and you see all open documents displayed alongside each other. This is exactly what I am trying to solve. I only want one document to show up in this list. Is there a way ?)
Thanks you for your help.
Hello those Who have read or are interested in a solution to this dilemma:
I found it at:
How do you make your MDI MFC app show one instance in the TaskBar?
And it works. best wishes all.

What is 'Desktop Presence'? (As used in the Windows UI style guidelines)

A lot of the Windows style guidelines refer to 'Desktop Presence' in various places, e.g. http://msdn.microsoft.com/en-us/library/windows/desktop/dn742496(v=vs.85).aspx', but it's never defined anywhere that I can see.
Is there a definition for what exactly they mean by this?
Is it the presence of a normal window on the screen throughout the execution of the application? Do apps that occasionally appear on screen (with dialogs or notifications), but are predominantly hidden count? What about applications you can interact with on the desktop but only on demand, e.g. the wireless network connection menu?
Found an ok answer in the article I initially linked to, in the end (http://msdn.microsoft.com/en-us/library/windows/desktop/dn742496(v=vs.85).aspx):
"The taskbar is the access point for programs displayed on the desktop, even if the program is minimized. Such programs are said to have desktop presence."

MFC: Address Bar control like Windows Explorer

In my MFC app, I'm attempting to make a window that resembles the Windows 7 Open File dialog, but it browses a virtual/fake file system. It doesn't need to be pixel-perfect, but I'd like parity with the native OS dialog where possible.
Probably the most challenging part is the address bar the runs along the top of an Open dialog. The address bar control is also atop all Windows Explorer windows. It shows the folder names that make up your path. It shows and hides buttons when moused over (including an attractive fade animation), changes the active directory when names are clicked, and shows submenus when the triangles between names are clicked. This doesn't seem to correspond to any MFC control (or group of controls). Spy++ shows it as an "AddressDisplay Control" but I can't find much documentation beyond that.
Is there a way to access a control like this, or to mimic it, in MFC? Also, I am not browsing the real file system, so I have to be able to tell the control what to display--I can't just point it at C:\ and let the system do the rest.
Here's a picture of the control in question.
Unfortunately, I think this is one of those controls that Microsoft has decided not to expose to developers through the Feature Pack. The Feature Pack was developed from the BCG control library. And, that library contains the control you want. However, it's not free. The only other alternative is to code it yourself.

Mac style menus on Windows, system wide

I'm a Mac user and a Windows user (and once upon a time I used to be an Amiga user). I much prefer the menu-bar-at-the-top-of-the-screen approach that Mac (and Amiga) take (/took), and I'd like to write something for Windows that can provide this functionality (and work with existing applications).
I know this is a little ambitious, especially as it's just an itch-to-scratch type of a project and, thanks to a growing family, I have virtually zero free time. I looked in to this a few years a go and concluded that it was very difficult, but that was before StackOverflow ;)
I presume that I would need to do something like this to achieve the desired outcome:
Create application that will be the custom menu bar that sits on top of all other windows. The custom menus would have to provide all functionality to replace the standard Win32 in-window menus. That's OK, it's just an application that behaves like a menu bar.
It would continuously enumerate windows to find windows that are being created/destroyed. It would enumerate the child windows collection to find the menu bar.
It would build a menu that represents the menu options in the window.
It would hide the menu bar in the window and move all direct child windows up by a corresponding pixel amount. It would shorten the window height too.
It would capture all messages that an application sends to its menu, to adjust the custom menu accordingly.
It would constantly poll for the currently active window, so it can switch menus when necessary.
When a menu hit occurs, it would post a message to the window using the hwnd of the real menu child control.
That's it! Easy, eh? No, probably not.
I would really appreciate any advice from Win32 gurus about where to start, ideas, pitfalls, thoughts on if it's even possible. I'm not a Win32 C++ programmer by day, but I've done a bit in my time and I don't mind digging my way through the MSDN platform SDK docs...
(I also have another idea, to create a taskbar for each screen in a multi-monitor setup and show the active windows for the desktop -- but I think I can do that in managed code and save myself a lot of work).
The real difference between the Mac menu accross the top, and the Windows approach, is not just in the menu :- Its how the menu is used to crack open MDI apps.
In windows, MDI applications - like dev studio and office - have all their document windows hosted inside an application frame window. On the Mac, there are no per-application frame windows, all document windows share the desktop with all other document windows from other applications.
Lacking the ability to do a deep rework of traditional MDI apps to get their document windows out and onto the desktop, an attempt, however noble, to get a desktop menu, seems doomed to be a novelty with no real use or utility.
I am, all things considered, rather depressed by the current state of window managers on both Mac and Windows (and Linux): Things like tabbed paged in browsers are really acts of desperation by application developers who have not been given such things as part of the standard window manager - which is where I believe tabs really belong. Why should notepad++ have a set of tabs, and chrome, and firefox, and internet explorer (yes, I have been known to run all 4), along with dev studios docking view, various paint programs.
Its just a mess of different interpretations of what a modern multi document interface should look like.
The menu bar on a typical window is part of the non-client area of the window. It's drawn when the WndProc gets a WM_NCPAINT message and passes it on to DefWindowProc, which is part of User32.dll - the core window manager code.
Other things that are drawn in the same message? The caption, the window borders, the min/max/close boxes. These are all drawn while processing a single message. So in order to hide the menu for an application, you will have to take over handling of this message, which means changing the behavior of user32.dll. Hiding the menu is going to mean that you become responsible for drawing all of the non-client area.
And the appearance of all of these elements - The caption, the borders, etc. changes with every major version of Windows. So you have to chase that as well.
That's just one of about a dozen insurmountable problems with this idea. Even Microsoft probably couldn't pull this off and they have access to the source code of user32.dll!
It would be a far less difficult job to echo the menu for each application at the top of the screen, and even that is a nearly impossible job. When the menu pops there is lots of interaction with the application during which the menu can be (and often is) changed. It is very common for applications to change the state of menu items just before they are drawn. So you will have to replicate not only the appearance of the menus, but their entire message flow interaction with the application.
What you are trying to do is about a dozen impossible jobs all at once, If you try it, you will probably learn a lot, but you will never get it to work.

Placing toolbar into Windows taskbar (ala language bar)

I'm currently in the process of writing a Windows MFC app to quickly search our corporate DMS. The idea is to have a button placed at the right hand edge of the windows taskbar much like the language bar, that when clicked, would popup the search interface.
I can't seem to find much regarding how placing items in the taskbar like this is performed, can anyone point me to some useful resources or examples?
I'd prefer native API resources (that is, not .NET) if possible.
Thanks!
Such toolbar is named a Deskband.
Here's an example: http://www.codeproject.com/KB/shell/dotnetbandobjects.aspx
You could look at the StExBar. It implements an explorer toolbar which can also be added to the taskbar. Doesn't use MFC though, just plain win32.

Resources