Determining which visual style is used? - winapi

Is there a method to determine which visual style (Classic, "XP Style", Aero, etc') is currently used? App is native, so .net solutions are out.

GetCurrentThemeName (IsThemeActive or IsAppThemed tells you if visual styles are on)

Related

How was the gui for Visual Studio 2012 achieved and how can we make similar looking applications

Visual studio 2012, being run under desktop mode under windows 8. Doesn't share the look of other windows 8 desktop applications.
How was this GUI achieved?
Did Microsoft scrap MFC/Winapi altogether (since its so different) and use Direct2d to create the custom gui? Or, have they just made calls to Winapi to customize it they way it looks?
Is there any shortcut for us developers to implement the vs2012 theme in our applications? Using the MFC Application template wizard we can chose from many themes but no vs2012 alike is available.
Indeed, Visual Studio 2010/2012 leverages WPF.
LEVERAGING WPF
WPF utilizes DirectX. WPF attempts to provide a consistent programming model for building applications and provides a separation between the user interface and the business logic. WPF leverages XAML, which is a declarative markup language. XAML stands for eXtensible Application Markup Language, which is based on XML. XAML is designed as a more efficient method of developing application user interfaces
ITS ABOUT MULTIPLE DOCUMENT WINDOWS AND FLOATING TOOL WINDOWS
Visual Studio was written to support multiple document windows and floating tool windows.
GREAT LIBRARIES ARE AVAILABLE
Codeplex provides a library to model the multiple document windows.
http://wpfmdi.codeplex.com/
There is also a docking library you can leverage:
http://avalondock.codeplex.com/
MEF IS USED HEAVILY
The internals have been redesigned using Managed Extensibility Framework (MEF).
MEF allows application developers to discover and use extensions without messing around with configuration files.
MEF allows you to easily encapsulate code and avoid fragile hard dependencies.
This allows developers to create add-ins to modify the behavior of the IDE.
DESIGN GOALS
In Visual Studio 2012, a one change is that the interface uses of all-caps menu bar.
Some design goals include reduced clutter and visual complexity by removing excessive lines and gradients in the UX.
The UI has been modernized by removing outdated 3D bevels.
You can take Spy++ which comes with Visual Studio and inspect the windows/class names of the application. If you do it with VS 2008, it's obvious that it's MFC. If you do it with VS 2010 and later, you will see that it's all WPF stuff--no MFC involved.

What assembly files does Windows Phone designer of Visual Studio use?

I am building a Windows utility that shows the user interface of a Windows Phone page. Visual Studio has similar designer that shows how the XAML of the selected page looks like. Visual Studio's designer must use some special assemblies that actually render XAML of the page just like on a real device.
I would like to use the same assemblies as the designer of Visual Studio uses. What are those assemblies?
These are all internal stuff for VS and Blend. The following blogpost gives you some insight into how this works under the covers: http://advertboy.wordpress.com/2012/04/27/xamluipresenter-what-are-you/
Albeit not WP specific the same applies to phone. However this is NOT supported for use anywhere else.
I'm wondering what your use case is? There might be something better and supported for you to use.

Visual Studio - Possible to create support for other languages?

Is it possible through their add-ins to add support to other languages that c# or vb.net? I mean, like have full control of the IDE, debugging included.
Yes, absolutely, using Visual Studio Extensibility.
"For an end-to-end sample of a language project system with debugging support, see the IronPython sample."
Then is a framework called the Irony project on codeplex to help with the creation of new language support.

Does VS 2008 SP1 support Property Editing for Silverlight 3?

I'm a Silverlight newbie. Just downloaded version 3.0 after the Mix announcement. I'm running VS 2008 SP1. When I select a design element in the preview pane or in XAML, the properties window is disabled and displays
Property Editing Not Available
I can open the solution in Blend and have no problems with it's property editor. So within Visual Studio, I'm forced to enter everything in the XAML pane and rely on Intellisense.
Is something wrong with my installation or environment? Or am I supposed to switch back and forth between Expression Blend and Visual Studio (I can't believe that should be the case).
There is nothing wrong with your installation or environment. The XAML designer/editor in VS2008 is very limited in what it offers for XAML editing whatever the version of Silverlight, being really just a rendering engine at the moment.
Expression Blend is the visual editor of choice for now - there are 3rd party editors available (such as XAMLCruncher and Kaxaml) but they don't really support XAML with code-behind classes.
Additionally the Blend 3 preview that was released to support SL3 seems to have a few improvements which address previously inferior experience of directly editing XAML in Blend (notably IntelliSense).
I had the same problem with Visual studio 2010 and Silverlight 5.0. It was intermittent.
One thing I found to help is to switch the XAML page to show Design view and then switch back to Code view or vice versa. If you have hybrid view, just temporarily switch.
I did that and it just worked fine. I do n't know the reason it worked but it did.
Is something wrong with my installation or environment? Or am I supposed to switch back and forth between Expression Blend and Visual Studio (I can't believe that should be the case).
You'll find you need to do that a lot for both Silverlight and WPF if you want to make full use of the UI controls.
I find VS incredibly slow and clunky for designing and rendering XAML and much prefer Expression. Switching between the two is no big deal as really one's for code and ones for design.
I haven't download the Silverlight 3 Beta yet, but the Silverlight 2 designer intergration in visual studio is very poor.
VS 2010 is suppose to have better support for XAML Editing in WPF and Silverlight. So for now, you'll have to find the right balance between Blend and VS.
SilverLight 3.0 beta just shipped. VS2008 SP1 shipped last year. It would be surprising if it supported SilverLight 3.0 out of the box, and more suprising if the VS support that ships with SilverLight 3.0 beta were not "beta" quality.
If you find problems, then be certain to report them to Microsoft.

Is Visual Studio written in Windows Forms?

Is Visual Studio written in .NET Windows Forms? Or is Windows Forms just too slow for a editor type application?
This isn't quite a fair question. :)
Visual Studio .NET (devenv.exe) is not written directly in WinForms, as it is not a CLR executable. (My hunch is that it is still produced with Visual C++.) I know for fact that neither 2005 nor 2008 versions of devenv.exe carry a CLR header. (I just dropped them both on ILDASM; they're definitely not managed code.)
That said, just because devenv.exe isn't written in WinForms doesn't mean WinForms is too slow for an editor. WinForms isn't, on most systems, too slow at all -- our app code will be the bottleneck before the framework is.
My hunch is that devenv.exe is written in C/C++ due to it being an upgrade of a long-standing environment; the cost to Microsoft to rewrite it in .NET is undoubtedly prohibitive.
Again, as far as WinForms speed is concerned -- there are quite a few WinForms apps which have no performance issues whatsoever, including a fairly robust .NET IDE (SharpDevelop).
Apparently VS 2010 has parts written in WPF.
SharpDevelop is a .NET Windows Forms application.
This sounds a bit like a "Are you still beating your wife?" question with no answer that sounds good from Visual Studio's point of view.
No, Visual Studio (at least up to 2008) is not written using .NET. However, SharpDevelop and other editors are and do not suffer from speed problems necessarily.
At its core VS is still an unmanaged executable, so it doesn't use winforms. There may be portions written in .NET particularly around some of the newer features, but the core extensibility model is COM based (and very complex...)
If the VS team didn't use WinForms, you're suggesting that the only possible reason would be that WinForms is too slow. That's not valid. The fact that SharpDevelop's IDE is written in WinForms and performs fine shows that it isn't "too slow," regardless of what Visual Studio's IDE uses.
This is kind of two questions in one. As others have mentioned, Visual Studio does not use WinForms. Your other question has nothing to do with the first, as a) Visual Studio isn't an "editor," it's an IDE and b) it's begging the question.
That said, WinForms is an excellent choice for any Windows-based application, including an IDE (like the aforementioned SharpDevelop) and any "editor" you can imagine, up to and including audio and video. So no, it's not "too slow" for an "editor type application."
You are free, of course, to write slow code that runs in a Windows Forms application. :)
Based on my experience with the VS SDK, it looks as if it was built with C++/COM but I think that's just because the Visual Studio team decided to go with that (AND Windows Forms didn't exist as a release version when they were first developing the VS.NET IDE).
You can use Windows Forms for an editor type application. I think SharpDevelop is a WinForms app.

Resources