Detect modal dialogs with WMI - wmi

Is there any way to detect open windows or more specifically open modal dialogs with WMI calls? I've been able to get a list of the processes through Win32_Process, but this does not have any information about the windows that the processes have open. I specifically mention WMI because the solution must be able to get information from a remote machine without having anything I'm building installed on the remote machine.

No, there is not any WMI class related to Dialogs or Windows.

Related

How to get a device handle to pass to WriteFile within UWP C#

I have an UWP C# application that needs to use printers that are connected via USB. Unfortunately the UWP built-in functionality for these sorts of devices (Windows.Devices.Usb namespace) has some major shortcomings. It doesn't recognize the USB printers as printers without installing the manufacture's driver (because Pnp manager doesn't provide enough info to the registry). Installing a specific driver is something that I don't want to do. I have written a C++ script using CreateFile and WriteFile to access the printers, but unfortunately UWP doesn't offer support for CreateFile and CreateFile2 has limited access only to app's local folder and the package's installed location.
Do you have any suggestions how I might be able to bypass the UWP restrictions, or maybe some other way besides CreateFile to get the device handle that I could pass to WriteFile?
UWP app run sandboxed, it only can access certain file system locations by default as the document File access permissions. So my suggestion is that you can try to create a classic app to use these specific APIs, then convert it to UWP using Desktop Bridge.

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.

Qt::How to identify/detect if the system is Remotely access by other system in Linux

I am developing an application in ubuntu to access the other system remotely through QT. Both system are running some Qt applications.I want to check / make changes to the other system remotely using Qt programming.
I want to add a pushbutton (as a quit screen) at remote system that should be "Enable only if the system is remotely accessed", so that i can use it to close the remote access screen.
Is there any way through programming we can get the status whenvever it is remotely accessed???
I got through some solutions on forum but they are particularly for Windows. I am looking for some solution in Linux.
Please provide suggestion/links so that i can overcome this issue.
Thanks in Advance
If you are using the remote display abilities of the X11 protocol, you could check the value of the DISPLAY variable. For a local connection, it usually starts with :0; for a distant connection, it contains the hostname of the displaying server. For a connection thru ssh -X it could be localhost:10 and ssh is also setting SSH_CLIENT and SSH_CONNECTION environment variables.
Otherwise, you should define better what is a remote access for you (i.e. explain more your application). Your Qt application may also be e.g. some TCP/IP server. Perhaps the getpeername(2) syscall might be relevant.
If you just are interested in what remote connections flow into your box (independently of a particular application) you could read (e.g. using popen) the output of command netstat -a -n or use some /proc/net/ directory.

Fail to CoCreateInstance an EXE COM server

I have an EXE COM server (used to elevate our application to a higher integrity level) which is downloaded to %temp% and registered by an ActiveX control. This COM server works pretty well on Vista machines. On Window 7 machines I got something wired: the COM server can be downloaded and registered successfully, but I got the error 0x80080005 (Server execution failed ) when trying to initialize the server by CoCreateInstance. If I copy the COM server to %temp% manually instead of downloading it via internet then everything works as expected. I am suspecting that the downloaded EXE files have some special attributes that prevent it been loaded but have no idea how to figure it out.
Does anyone have the same experience or have any clue for this issue? Any suggests will be highly appreciated.
Joe
Yes they do. Start a command prompt and use DIR /R. You'll see the alternate data stream in the file. The one that says: "don't trust this file, it came from an untrusted source".
You can delete them with the filename:streamname syntax. Check if that's okay with your customer first. I don't know many that are thrilled about EXEs getting downloaded and bypassing normal security rulez.

COM MFC application don't show window

I have a MFC application with ATL support, the idea is when someone creates an instance of my interface declared in the mfc application, this instantiation creates and displays a window.
This all works fine if the com client is the cmd.exe, i made a quick com client that instance the interface and when this instances occur the window is displayed as desired.
But if this instantiation is done in another com objects (for example atl server objects (services)) the window is not displayed. Note that the mfc process is created under the DcomLaunch process but no window is displayed. Everything works fine but the window is not show in my desktop.
Two questions:
1) why my window is not displayed in this situation?
2) when i create the same interface with my console app, only one process of the mfc application is created, no mater how many console app i start, and if the service try to instantiate more than one object, more than one mfc process are created! why is this, how can i avoid this. How can i make that the first mfc process is allways the same one that responds to the client calls?
(i think this is all due to security settings... but i already try to change some and nothing...)
Thanks
Nuno
In general a service cannot create windows. Pre-Vista you can enable a service to interact with the desktop (for example, open a window) via the "Allow service to interact with desktop" check-box on the "Log On" tag of the given services properties. If you're targetting Vista, this isn't an option.
However, given this is the DcomLaunch service you're dealing with, you clearly don't want to do that.
Even if it was your own service you wrote most anyone would advise against you doing this anyway for a few reasons (in no particular order):
The UI created would be only accessible in session 0
Creating a window creates an attack service into your (probably) privileged process since any other process the user runs can interact with the service's window.
Again, since the above only works pre-Vista, and is a Bad Idea anyway, the generally accepted "best practice" for a service that wants to expose a UI is to have a separate application that contains the UI which communicates with the service using whatever IPC mechanism you choose to use.