In Windows, developers are able to write a program, letting it automate lots of applications (such as Photoshop, Office Word) which are not in the same process as the program itself, provided those applications support OLE.
Since many of those well-known applications that support OLE automation in Windows also come with MacOS version. I wonder if there's a similar technique that can let developers write programs that can automate other applications which are not in the same process as the program itself.
Related
I want to create a multi-platform application with the focus on handling data from serial port, data processing/analysis and plotting. By now I wrote the application in Python (with a GUI generated by pyQTgraph) which works quiet well - but it is not possible to export my .py to .exe or .app (for Windows and Mac OS). I tried many tools like py2exe, PyInstaller, ...
Now I'm looking for a multi-platform programming language (C, C++, ..., but not Java) witch makes the transfer to other OS easy. Preferably it is possible to transfer the application frow Windows to Mac without big code-changes or redesigning the GUI. It is a lightweight application which should run without a previous installation.
Do you have some hints which programming language and frontend (like QT) is the best for the job?
Does your suggested language works well with serial-port-data?
How does the workflow from writing the code to exporting the final .exe/.app looks like?
Best and thanks
You should probably take a look at Xojo. It builds separate, native apps for Windows, macOS and Linux from the same source project. It also has serial support.
I am currently deployed overseas with the military and am using my down time to keep up with my civilian education, which is about 1 year of computer science. I developed this rather simple batch program that functions to use taskkill to kill a specific .exe after a specified time, aka an application-specific Sleep Timer:
Blog post describing use of program.
However, I have never had any experience with a GUI program. I have seen some old Q&As here recommending using Qt to get started, but as things change so quickly in the technology world, would you all be kind enough to give me some fresh information on how to create a GUI out of this application?
Instead of Microsoft technologies coupled with Qt, you'll cut learning and dev time by learning and using tcl/tk which comes with "expect" to communicate with command line programs and utilities. The only downside is needing to deploy tcl/tk to each machine to run your program as it's not compiled, rather an interpretive language.
I would use the Windows API + Windows Resource files + the C language to do it. ResEdit is a useful tool to edit resource files. Some handy links:
Windows Application UI Development
MSDN Library
ResEdit Home Page
Hope it helps.
This article (from the Windows engineering team) says:
WOA [Windows On ARM] will not support any type of virtualization or emulation approach,
and will not enable existing x86/64 applications to be ported or run.
Does that mean I won't even be able to recompile an x86/64 application from source for ARM?
If yes, what exactly prevents me from doing that? My understanding is that the Win32 API is present on Windows 8 ARM.
If no, what do they mean by not being able to port x86/64 applications to ARM?
From the Windows article you link to, the second quoted paragraph is the killer. Porting existing apps is definitely NOT supported.
Developers wishing to target WOA do so by writing applications for the WinRT (Windows APIs for building Metro style apps) using the new Visual Studio 11 tools in a variety of languages, including C#/VB/XAML and Jscript/ HTML5. Native code targeting WinRT is also supported using C and C++, which can be targeted across architectures and distributed through the Windows Store. WOA does not support running, emulating, or porting existing x86/64 desktop apps. Code that uses only system or OS services from WinRT can be used within an app and distributed through the Windows Store for both WOA and x86/64. Consumers obtain all software, including device drivers, through the Windows Store and Microsoft Update or Windows Update.
If we enabled the broad porting of existing code we would fail to deliver on our commitment to longer battery life, predictable performance, and especially a reliable experience over time. The conventions used by today’s Windows apps do not necessarily provide this, whether it is background processes, polling loops, timers, system hooks, startup programs, registry changes, kernel mode code, admin rights, unsigned drivers, add-ins, or a host of other common techniques. By avoiding these constructs, WOA can deliver on a new level of customer satisfaction: your WOA PC will continue to perform well over time as apps are isolated from the system and each other, and you will remain in control of what additional software is running on your behalf, all while letting the capabilities of diverse hardware shine through.
Only a subset of Win32 is supported on Win8 for ARM:
http://msdn.microsoft.com/en-us/library/windows/apps/br205757.aspx
If you try to build an application that uses a Win32 API that's not supported, it won't build because the API won't be in the library. If you try to create your own library to support the APIs, the application still won't be usable because the only way to deploy apps to customers will be through the MS app store, which will no doubt check for API conformance.
From The "Building Windows for the ARM processor architecture" article:
Consumers obtain all software, including device drivers, through the Windows Store and Microsoft Update or Windows Update.
It might be possible to do so on your development machine (but maybe not - I'm really not sure if such a 'hack' will be possible, supported or not), but you certainly won't be able to deploy it in any kind of widespread fashion.
In short, any existing Win32 application will likely need significant work to be ported to Win8 for ARM. It won't be a matter of recompile and fix any errors that pop out to get the application to run on ARM.
They do provide this caveat a little further in your cited article:
Additionally, developers with existing code, whether in C, C++, C#, Visual Basic, or JavaScript, are free to incorporate that code into their apps, so long as it targets the WinRT API set for Windows services.
They've got version of Office and IE available; I'm positive those weren't ground-up reimplementations.
I am a beginner in C++ application development. I use Visual Studio and I have an application which process the image like Photoshop does. I wish to automate the UI of my app and test various scenarios automatically by saving processed files. I use Visual studio on my Win 7 machine for development, do not have .NET. What options I have to automate my testing?
Thanks
On Windows 7 (and Vista/XP, if you install an update) you can use the COM-based Microsoft UI Automation API to write UI automation clients in C++.
I've successfully automated the UI of Windows apps this way. It works pretty well, and with a little extra work can even be called from C-based scripting language interpreters that understand COM (e.g. Python and Ruby).
Finding documentation on the UIA COM API can be a little tricky since searches for "MS UI Automation" usually turn up info on the .NET interface rather than the COM interface (the COM interface is much newer and not as well-known).
As Boann mentions you can use third-party libraries too, like AutoIt. That can ease some of the learning curve and extra work. AutoIt exposes its own COM interface (AutoItX) that you can likely use from a C++ app.
If you want to read about writing COM UIA apps in C++ here are some links to get started:
The UI Automation Client Programmer's guide on MSDN:
http://msdn.microsoft.com/en-us/library/ee684021(v=VS.85).aspx
http://msdn.microsoft.com/en-us/library/ee671216(v=VS.85).aspx
The IUIAutomation interface:
http://msdn.microsoft.com/en-us/library/windows/desktop/ee671406(v=vs.85).aspx
A couple of helpful articles with sample code:
http://www.code-magazine.com/articleprint.aspx?quickid=0810052&printmode=true
http://blogs.msdn.com/b/winuiautomation/archive/2011/05/18/building-ui-automation-client-applications-in-c-and-c.aspx
Windows accessibility and automation forum:
http://social.msdn.microsoft.com/Forums/en-US/windowsaccessibilityandautomation/threads
A language called AutoIt Script is designed specifically for Windows UI automation. Sadly it's a Basic-like rather than C-like language, but it does what it says well:
http://www.autoitscript.com/site/autoit/
For developing programs for windows, we need windows SDK. I understand that this SDK is what helps to create windows and handle window events and all that. I suppose it also enables us to manipulate with files and registries.
(Does the same SDK is the reason for thread creation and handling?)
All that is fine!
I would like to know what are the files and libraries that come as a part of this SDK. Also does it come when I install the OS or when I install editors like Visual studio? Sometimes I see links to windows SDK separately as such. Is it same as the one that I get when installing Visual Studio or has something more than that.
Base Services:
Provide access to the fundamental resources available to a Windows system.
Included are things like
file systems,
devices,
processes & threads
and error handling.
These functions reside in kernel32.dll on 32-bit Windows.
Advanced Services:
Provide access to functionality that is an addition on the kernel.
Included are things like the
Windows registry
shutdown/restart the system (or abort)
start/stop/create a Windows service
manage user accounts
These functions reside in advapi32.dll on 32-bit Windows.
Graphics Device Interface:
Provides functionality for outputting graphical content to
monitors,
printers
and other output devices.
It resides in gdi32.dll on 32-bit Windows in user-mode. Kernel-mode GDI support is provided by win32k.sys which communicates directly with the graphics driver.
User Interface:
Provides the functionality to create and manage screen windows and most basic controls, such as
buttons and scrollbars,
receive mouse and keyboard input,
and other functionality associated with the GUI part of Windows.
This functional unit resides in user32.dll on 32-bit Windows. Since Windows XP versions, the basic controls reside in comctl32.dll, together with the common controls (Common Control Library).
Common Dialog Box Library:
Provides applications the standard dialog boxes for
opening and saving files,
choosing color and font, etc.
The library resides in comdlg32.dll on 32-bit Windows. It is grouped under the User Interface category of the API.
Common Control Library:
Gives applications access to some advanced controls provided by the operating system. These include things like
status bars,
progress bars,
toolbars
and tabs.
The library resides in comctl32.dll on 32-bit Windows. It is grouped under the User Interface category of the API.
Windows Shell:
Component of the Windows API allows applications to access the
functionality provided by the operating system shell,
as well as change and enhance it.
The component resides in shell32.dll on 32-bit Windows. The Shell Lightweight Utility Functions are in shlwapi.dll. It is grouped under the User Interface category of the API.
Network Services:
Give access to the various networking capabilities of the operating system.
Its sub-components include
NetBIOS,
Winsock,
NetDDE,
RPC and many others.
Internet Explorer web browser APIs:
An embeddable web browser control, contained in shdocvw.dll and mshtml.dll.
The URL monitor service, held in urlmon.dll, which provides COM objects to applications for resolving URLs.
A library for assisting with multi-language and international text support (mlang.dll).
XML support (the MSXML components, held in msxml*.dll).
I have listed only files for 32-bit windows (as that is what many window developers work on)
For more info, please check http://en.wikipedia.org/wiki/Windows_API
EDIT:
Above dlls and all are part of the operating system, not the SDK. The Windows SDK provides import libraries (.lib files) that allow code to dynamically link against these system-provided DLLs.
(This was rightly pointed by Marcelo Cantos. Many thanks to him)
SDK stands for Software Development Kit. It is a big fat collection of headers, libraries, tools and other bits and pieces that developers use to construct software. Microsoft provides many SDK's for their large range of products, and they are not generally deployed to the end-user's desktop. They are usually only installed on developer machines, either as part of a development environment like Visual Studio, or separately (but usually intended for use within VS anyway).
When you talk about the thing that handles windows, threads, etc., you are describing the Windows APIs. The purpose of an SDK is to allow developers to write software that accesses the APIs.
The Windows SDK gives you, as a developer, access to all the services of the Windows platform, including all the things you list.
The SDK is installed as part of the installation of Visual Studio, and usually you'll use the one that came with the compiler, and never have to worry about it. The standalone SDK downloads are there to support two scenarios:
If you use a compiler other that Visual Studio, it may not come with the SDK files, so you can download them separately.
Each new version of Windows includes more features in the API, so to call these new functions you need an updated SDK.