Merging Windows Forms Application - Win32 Project Application - winapi

Is there any way merging Windows Forms Application with Win32 Project Application (VS 2012), both written in Visual C++?
Windows Forms Application plays video (via vlc plugin) and Win32 Project Application displays the codes of a joypad (via a dialog box). I want an executable doing both. How can I achieve this?

If you use MFC, you should read the following article:
Integrate Windows Forms Into Your MFC Applications Through C++ Interop
And see here: Windows Forms and Unmanaged Applications Overview
If you just want to show a dialog, this should not be a problem; if you want to embedd a control, you should use ActiveX controls.
See also: http://www.gregcons.com/KateBlog/MixingMFCAndWinForms.aspx

Related

What tech stack was used to write Windows native applications like File Explorer?

I'm looking to write a Windows Explorer alternative application, such as FreeCommander.
What underlying language and tech-stack does Microsoft use to create native desktop applications for Windows, such as Windows File Explorer, Control Panel, Calculator, and so on?
Google search results point me towards one of UWP, WPF, WinForms, Java FX + Swing, Electron, Qt.
Given the following requirements:
the app should be as quick and responsive as the native File Explorer
in reading file metadata and opening files
the app should support file
previewing, and file operations -- renaming,
cutting/copying/pasting/moving etc.
the app needs to work on Win 10 at
the least, and support for previous Win version will be nice-to-have
the app should have the same right-click context menu items for files and
folders as the default File Explorer
the app should be mappable to a Windows hot key combo, such as ⊞ Win + F.
the app should be installable from a standard installer and not Microsoft Store
What should be my weapon of choice?
such as Windows File Explorer, Control Panel, Calculator, and so on
Windows Calculator is open-source, BTW. This should answer all of your questions. See for yourself. :)

Interact with UI controls of Windows Store apps

I am not able to identify UI controls of Windows Store apps using AutoIt Window Information Tool. The standard app Calculator for example (Windows 10):
As you can see, it doesn't show information for button 8. I tried both x86 and x64 versions.
How to interact with Windows Store apps? For traditional desktop apps AutoIt works as expected.
It's impossible, AutoIt developers have no plans to support UI Automation API. You can find Inspect.exe in your Windows SDK and run it in UIA mode to compare with AutoIt Info tool.
There are some other tools supporting UIA (TestStack.White (C#), Winium.Desktop (C#) and some direct UIA wrappers on other languages like pyuiautomation on Python). pywinauto 0.6.0 added MS UI Automation support.
UIA support for AutoIt; 24 Apr 2009 AutoIt forum thread. Plans may have changed, but it's the top result for a "AutoIt WPF support" Google search.
In order to use Autoit Window info tool in Win10 you should use 64bit version exe.
Au3Info_x64.exe
Common location is C:\Program Files (x86)\AutoIt3\Au3Info_x64.exe

Is the default mail app on Windows 10 done using HTML5, CSS and javascript?

One of my colleague try to convince me that the default mail app on Windows 10 is done using HTML5, CSS and javascript. But I doubted it and I believe it is written using Windows SDK and C#. Do you have any evidence to show how the mail app was built?
Cheers
You win. It's not HTML.
You can check by running the app and then examining it in Task Manager. Look at the details and the process name will be WWAHost.exe for an HTML app.
You can get more detail with Process Explorer. ProcExp will let you see the DLLs loaded in the process where you can see that it loads Windows.UI.Xaml.dll.
.Net (C#) vs. C++ is trickier, especially since it's likely a mix of both. The .Net Framework engines (mscorwks.dll, etc.) in the process would indicate a .Net app, but I don't believe they'll show up in a .Net native app, and Mail (along with all other .Net Universal Windows apps deployed from the store) will be compiled with .Net Native.
You can also figure out similar information by looking at the app's package in \Program Files\WindowsApps

Porting Windows Phone7 application to Windows 8

I ported my windows phone7 application to windows 8(just copy paste the xaml and c# code in visual studio 2012->new->project->WPFApplication) and made changes in UI sizes.The problem is the .exe file(after building wpf application) runs only in the system with .NET framework installed.I want to run my application in all system running windows(7(32/64),xp,vista).I am newbie to windows application basically wp7 developer.Thank u.
If you really want to port a windos phone 7 app to windows 8, You should go through the following resources. They provide most of the information.
http://msdn.microsoft.com/en-us/library/windows/apps/hh465136.aspx
http://leventoz.wordpress.com/2012/03/07/moving-a-windows-phone-app-to-windows-8-a-case-study-part-1/
http://leventoz.wordpress.com/2012/03/11/moving-a-windows-phone-app-to-windows-8-a-case-study-part-2/
WPF is a part of the .NET framework, so you can't write a WPF application that can run without the framework on the machine.
If you want to create a binary that run on the classic windows runtime you can't use WPF/C#/VB etc.
Best thing if you want to port your Windows Phone app to Windows 8 is to create a Microsoft Store app, File > New Project > Blank App in VS2012. The app won't run on anything except Windows 8 but the Microsoft Store for Windows 8 is probably the best place to have your app if it's ported from Windows Phone.
Migrating application to WP7 is not that easy as it sounds. There is lot of different APIs and also limited async/await in WP7 when using this extension.
I would probably recommend starting with this MSDN article. It describes basic problems and challenges and also contains useful namespace and API mapping:
Migrate/port a Windows Phone 7 app to a Windows Store app

Difference between winforms, web forms, and windows forms

Right now I am working on c# windows applications developement. But my concern is I want to know what is the difference between winforms in c# .
what is the difference between winforms and windows forms in c#?
Thanks
Winforms and Windows Forms are the same thing. Winforms is the shortened name for Windows Forms.
From Wikipedia:
Windows Forms (WinForms) is the name given to the graphical
application programming interface (API) included as a part of
Microsoft .NET Framework
Additional info from MSDN answer:
Based on my understanding, you want to know the difference between
Windows based application and WinForms application development using
c#. Windows based application is that the application is
developed under Window Operating System, excluding such application
developed under other Operating System like Linux & Unix.
However,there are two kinds of windows based application in .net, WinForm &
Web application. you can develop several different kinds of
Windows-based applications. You can create Windows Forms and Windows
service applications that leverage the power of the .NET Framework, or
you can use Visual C++ to create Windows Win32-based applications
However, the WinForm application is a kind of managed application,
develop on .Net platform. It's the extension of the Windows-based
application. The Windows Forms classes contained in the .NET Framework
are designed to be used for GUI development. You can easily create
command windows, buttons, menus, toolbars, and other screen elements
with the flexibility necessary to accommodate shifting business needs.
The topics in this section provide details about how to use the
features offered by Windows Forms.

Resources