Add macOS Console Application to Accessibility - c++

I've developed an Accessibility API console application in C++ for High Sierra (and lower) - uses AXUIElementCopyAttributeValue etc.
I've disabled SIP to give me a chance here to write to the Accessibility database using tccutil.
So, the application runs as expected in Xcode, given that I've enabled 'Xcode' in System Preferences->Security & Privacy->Privacy->Accessibility.
I've wrapped my console application into a .app so I can drag and drop into this Accessibility panel.
If I run the application outside of Xcode in a Terminal window, I have to also give Terminal.app Accessibility rights for the application to use the API otherwise nothing is extracted. This then seems that you must give the calling application the rights.
I'm trying to launch the application on startup via a LaunchAgent with root privileges, /usr/bin/sudo being the calling application. Launching a script instead to run the application seemed the better method. The application launches fine, infact the console application inside the .app is also added now to the Accessibility panel.
Unfortunately, the Accessibility side of things is still not working and I've run out of ideas?
Any help will be appreciated.
Many thanks in advance.

Related

c++ program not launching any browser on 64bit machine

I am writing a code which launches browser on click of a button but during launch of Internet Explorer or be it any browser the application hangs producing the window attached with this message.IE ERROR. In the given pic appfthook.dll is used in my application
You can launch it as
system("START iexplore.exe");
assuming that it's in your path. You can avoid using appfthook.dll that way.

Windows store app automating testing, run and detect when the application is stopped (suspended) c++

Im using this guide "automating the testing of windows 8 apps" to test my windows store app
http://blogs.msdn.com/b/windowsappdev/archive/2012/09/04/automating-the-testing-of-windows-8-apps.aspx
Unfortunaltely Ive run into a problem, I need to know when my app closes (crashes) or when it goes into suspended mode, to log that info, and I want the launcher to be able to know the application has stopped , unfortunately iApplicationActionManager, does not have that method. And IPackageDebugSettings which is used to change the application suspend and resume states does not have a readable current state property (afaik)
Is there any way to do this?

Find application handlers?

Problem
I am attempting to find a window object handle inside a remote terminal that is run though Citrix Remote with ZenApp. My problem is I can see the parent window of Citrix Remote but no children. I have tried WinSpy, WFP Inspector, and a few other API spy utilities; none of which could view the Citrix Remote properties.
Question
What can I do to view these objects though this remote terminal?
EXAMPLE
No utility will be able to see the window handles for an application run over Citrix. The application is running on the Citrix server. The Citrix remote client presents only an image of the screen on the the client application.
The window handles that you are looking for are on the Citrix server, not the client machine you are running from.
You'll never be able to get the window handles, as they don't exist; however, you may be able to use UI Automation to get the accessibility properties (name, position, etc.) Certainly this works for Windows Remote Desktop on Windows 8 & above; it may or may not work for Citrix. It's worth a try.

Have my GTK application started on startup on Linux

I have an C++ executable that include some GTK code. I want this application to be started on startup of my machine (as root).
I tried with a init script (that is working perfectly when I use it from my user session), but having a look at the log file of my application I see that the latest logged line is before to call Gtk::Application::create() so it seems that it too earlier to initialize GTK.
How can I have my application started after the user session opened so that GTK initialisation is not failing ?
Create a .desktop file of your application, and put it to /etc/xdg/autostart/ for each user, or to $HOME/.config/autostart/ for current user.
If you want to load that application as root for general users, you may choose to use gksu or other tools to authorize priviledge.
Alternatively, you can see how network-manager is designed. It inits network-manager module as a init-script when system starts, and loads nm-applet, which is GUI for ordinary user, when a user session loads. Thus, network-manager can be managed on all the desktop environment (like Gnome, KDEE, xfce...) by desktop users.

Service Control Security Issues in XPCOM

I'm am developing a Firefox extension which interfaces with an underlying Windows service (which I have already made).
During the development so far I encountered one bug in the installer program (which installs the FF extension AND the service). This was due to the security model on Vista requiring elevated privileges to be able to install and start the service. I adjusted the installer and now it installs fine (just with additional Vista'esque warning dialogs being displayed to end-users - which I can live with !)
I am now in the process of developing an XPCOM component that will install along with the XUL stuff I have already made. There will be a XUL javascript interface to the XPCOM which will try to do things like stop and start the service (e.g when user-configuration data is changed).
My question: Since FF will normally be run under a user account, will I run into any difficulties on Vista or other Windows flavors trying to start or stop my own service via XPCOM?
(When users run the installer I don't mind security dialogs popping up in Vista. But I certainly don't want this to happen whenever they try to change their info in the XUL interface.)
What is the correct way to go about this?
Yes, if your service is running as an Administrator then the Firefox process, running as a normal user will not be able to start or stop it. However, it appears that you can use the "sc" command to set access controls on your service from your installer, which means you can allow non-admin users to start and stop your service.
You'll need to use "sc sdset", which is documented (lightly) here:
http://technet.microsoft.com/en-us/library/cc742037%28WS.10%29.aspx
However, to use that, you'll need to read up on the "Security Descriptor Definition Language", which looks kind of complicated:
http://msdn.microsoft.com/en-us/library/aa379567%28VS.85%29.aspx
This blog entry appears to have some human-readable information on it:
http://blogs.dirteam.com/blogs/jorge/archive/2008/03/26/parsing-sddl-strings.aspx