How can I check if the computer is a Surface Studio? - c#

I am developing an app specifically for Surface Studio - how is it possible to check that the machine is indeed a Surface Studio?
Ideally from within .NET, although perhaps this is information gleaned from the registry, I am not sure.

You can get more info about it by using Win32 Classes, it will help you a lot querying almost everything about your system.
To be easier, you can also download an application provided by Microsoft which allows you to better search the info you are looking for. The information you are looking for is probably located at Win32_ComputerSystem.

Related

Xamarin : add .dll files at runtime to add functionnalities to application

I'm wondering if it's possible for a Xamarin application (all the platforms : Android, iOS, Windows Phone) to detect and load assemblies at runtime.
This is the kind of thing that I already did in WPF, and I'd like to use those modules (maybe with some modifications) in a Xamarin app.
I've spent yesterday looking for info online, and today I tried to implement a solution, but without success.
Prism seemed to be a way to do it, but it works only in WPF.
The restriction which makes this difficult is that I don't know at compile time any information about the assemblies. No names, no versions, no classes.
I can put the name and the version in the filename, and maybe find the classes by reflection. Using an interface as entry point (Prism use this), I should be able to do it.
Do you have any thoughts about this challenge ?
Thank you very much !
iOS: No
Apple does not allow code that was not bundled into the app at signing time to be executed, thus no on-the-fly Jit'ing of CIL allowed. The only exception to this is Javascript code that is run via their Nitro JavaScript Engine.
Android: Yes
Google allows just about anything you can think of, for better or worse ;-)
Windows Phone: No
All code must be signed as part of the Microsoft Store' App Ingestion process and thus you can not dynamically load assemblies later
Note: If this is a hard requirement for your app, you should look at hybrid mobile apps, like Cordova/Ionic, where you can perform a hot push to roll out new features, bugs fixes, etc... Besides self-hosting those hot pushes, various vendors support hosting of those, even Microsoft Azure has a full versioning publication system for this. Of course you would most likely be coding in JavaScript (or some trans-compiled variant).

Windows explorer integration like tortoisesvn

My company uses a flavour of GIT for moving source code from your local system to the repository at the desired location (which later deploys and stuff , its a server basically) and the support for that tool is BAD. It uses the commandline and its very tedious to use it . I want to build somthing similar to tortoiseSVN / tortoiseGIT for this purpose and i am looking for a starting point.
How would i get the overlay icons in the folder ?
How would i be able to do windows explorer integration in the "right" way ?
I'm going to use .Net C# to build this tool.
Thanks in advance for the help!
Cheers.
You can write a Shell Extension! There is a lot to learn, though. Part IX of the complete idiot's guide to shell extensions series explains how to deal with icons.
In general writing IE and Shell extensions in C# isn't supported. Of course, newer versions of the runtime do allow you more flexibility in the area of SxS support. But you're on your own in terms of writing the COM interop and you need to think very carefully about how this will effect other apps that do things like use the file-open dialog.

A good starting point for development Windows utilities interfacing with OS

I would like you to give me some good resources regarding Windows development of applications that integrates with OS like Application managers, Docks, Task-bar\System tray etc.
Resources like how to interact with particular subsystems are welcome.
Thank you
What you are looking for is information on writing shell extensions. Generally it is not recommended that you write shell extensions in .NET though the landscape might be much better now with Framework 4.0 supporting side by side loading of the framework.
Searching with Bing/Google for shell extension c# will yield a number of results that might be relevant.
As for the docking part of your question, the most reliable way would be to register your application as an Application Desktop Toolbar (AppBar), here is a Code Project article on doing this with C#, it should be a fair starting point. http://www.codeproject.com/KB/dotnet/AppBar.aspx
It appears much of what you would like to know about involves using the Windows API. Its documentation might give you a start: http://msdn.microsoft.com/en-us/library/aa383749(v=vs.85).aspx

Automating Windows GUI Testing - FindWindowEx and Control Classes

I've inherited a C# window's application that I'm not real crazy about. I've got a looming deadline and I'm scared to death that some of my changes might be having adverse effects on existing functionality.
I've got a hobbyist background to RoR and I'm fairly comfortable with testing in that framework (using both RSpec and Cucumber).
I love having test scripts that can be ran on a regular basis and I'm willing to spend my personal time developing those for this particular project. I purchased a book from PragProg.com on scripted GUI testing with Ruby (http://pragprog.com/titles/idgtr/scripted-gui-testing-with-ruby). So far, I'm digging what I'm seeing and I think that this should work well.
Unfortunately, I've got a fundamental lack of understanding concerning Windows app development. I'm making calles to FindWindowEx (via Win32API) to "attempt" to retrieve sub-controls in my application.
A big part of my confusion is how I should retrieve the Class Name of the control that I'm trying to capture. The example provided in the text is as follows:
edit = find_window_ex.call #main_window, 0, 'ATL:00434310', nil
Where #main_window is my application's main window handle, and 'ATL:...' is the class of a text box area. There is no explanation given as to how the author arrived at 'ATL:...'.
I've read some very old posts concerning MS's SPY++, but those seem to be obsolete (or for some reason it wasn't installed when I installed vs2010).
So, what's the best way for me to find control classes to be used with the findWindowEx call? I do have the source code - should I be pulling from there? What if I don't have the source code and I want to automate an application? Is there a utility that allows you to somehow "browse" controls on a running application?
Sorry for the length - thanks in advance for the help!
Bob
The best is for you to install the components so that you get Spy++, this is the best way I know of to get to the actual class names esp. if you do not have the source to the original controls, which might be from a library or possibly some standard ActiveX controls that Microsoft ships.
The ATL class name is probably for controls developed using Microsoft Active Template Library (ATL), this is a C++ template library which significantly simplifies the development of ActiveX controls, and COM objects etc. in C++.

C# for Java/*nix programmers

I am mainly a java programmer, using linux/os x for as long as i remember. I am extremely comfortable in emacs and usually prefer doing things through command line.
I need to create a internet explorer addon for our next project. I need to intercept url ie is about to download and if they meet certain criteria pass it to our application.
So my questions are,
How can i build a c# project through command line so i can integrate it with our current build process.
Current i have windows 2k installed in a virtual machine that i use for testing. Is there going to be any compatibility problems.
I am assuming i am going to be creating a dll and inject it to ie to intercept url's. Am i on the right track?
Here are responses to your questions:
Use the C# Command Line Compiler. MSDN has an entire section devoted to its use.
Not for an IE add-on. If you plan to do more, using some newer libraries, you may run into problems unless you're running Windows XP or later. For IE addons, 2000 should be fine.
That's the basic idea. I'd refer to the MSDN articles on creating add-ons for IE, such as this one showing how to make custom menus.
Be aware, though, that you'll have a more difficult time if you avoid using Visual Studio (or some other IDE). There is no reason not to use VS, especially since you can use the Express Edition for free. If you're doing that, you can use msbuild instead of csc directly, and it will simplify your build process (even if you build from the command line).
However, the productivity gains from a good IDE will come in handy, especially for C#.
Responses to your questions:
If you use Ant maybe this will help. If you use Maven, maybe this will help. Otherwise, I'd just use MSBuild or NAnt.
Can't say for sure. I would guess that the IE API would be the same on each of the platforms. YMMV.
I'm busy writing an IE addon at work and I'm using SpicIE. It's very straightforward and simplifies the IE API drastically.
I've read in the comments elsewhere that you're not a fan of VS. I would probably use it (or MonoDevelop/SharpDevelop if they can create .csproj) to create the .csproj that can be used as an input to MSBuild. It might save you time rather than having to learn the syntax of the file.
If you give up the IDE, you give up one of the best debuggers on the planet and the best code-completion I've ever seen. Other than the fact that it will be a new system to you, there is no reason to claim that you can develop faster in EMACS. Everything you need is in the IDE, and there are keyboard shortcuts to mostly everything.
If you computer can handle the work load, I really see no good reason not to use Visual Studio.
edit: the newest version of visual studio won't run on anything less than XP sp2, to my recollection. This is most likely because the new versions of .NET won't run on anything lower than that... which would be a huge compatibility problem.

Categories