Xlib event when window is moved from one workspace to another - x11

I want to know the event name of application moving from one workspace to another using Xlib.

You will get a PropertyNotify on _NET_WM_DESKTOP
http://standards.freedesktop.org/wm-spec/latest/ar01s05.html#id2568910
(only with WMs that support _NET_WM_DESKTOP, but most standard ones do)

Related

How to save current windows state using Delphi and JEDI Docking?

I'm using Delphi 6 and JEDI Docking visual components. I realise drag and drop between windows of my propgramm. I need to save current state of windows. For example, in first run I have separate one server window and two client windows, then I remove client windows into server window using DragandDrop. Then I close my programm and in second run I expect to see last state of windows (two client windows inside server window). How to realize this?
I have found solution. There are two methods for saving and loading windows state in JvDockControlForm module.
SaveDockTreeToFile('MyFile');
LoadDockTreeFromFile('MyFile');
Also there are another ways to save state by components in JvPersistence tab.
Anyway you need to put JvDockServer component from Jv Docking tab to your main form to use these methods above.

Handle GUI window changes

I'm doing an automation script for installation wizards using AutoIt. I'm trying to handle window changes in some way.
Can some one explain how these GUI's work?
When I click on the Next button it looks just like the components in the GUI is beeing changed. Is this tha case? Or is a new window created and the old destroyed?
I've noticed that the process ID is the same for all windows.
I'm sure there is some way to know which "state" the GUI is in, or which step?
By the way. All the windows has the same title.
Thanks
/Anders
This will be dependant on the program you are automating.
The easiest approach would be to look at what changes in the GUI between stages, likely candidates are if there is a label that is giving instructions for that step, or a button that has text changing (e.g. if the button says "Finish" then you know your at the end).
Most installer programs have child windows for grouping the controls of each stage. These are typically implemented as dialog resources (as can be seen when using something like reshacker on them). So although the window remains the same, the panels are being created/destroyed as appropriate. This is a very neat method of doing it, for the obvious reason that you don't need to have to code to create/destroy a lot of controls. Resource created dialogs don't have nice class names like windows sometimes do though, so this may not be a reliable way to check the state.

Is there a way to parent a standard Windows dialog inside another form?

I know it's possible to take a dialog that you built yourself and parent it on another form. But is it possible to parent a standard Windows system dialog on a form that you designed?
Specifically, I'm trying to set up a form with multiple tabs that provide different ways to obtain a reference to data used by the program. One of those tabs should represent the file system, and the ideal way to do this would be with the standard Open dialog that can be instantiated with the COM identifier CLSID_FileOpenDialog.
Is there any way to take a system dialog and cause it to appear parented on another window, without the border, title bar, etc?
There are ways to use a hook, either via SetWindowsHookEx() or SetWinEventHook(), to grab a system dialog's HWND, then you can do whatever you want with it, such as call SetParent(). But just because you CAN does not mean you SHOULD. System dialogs are designed to run as their own windows, not embedded in someone else's window. A better solution might be to use the same Shell display components that are used by Windows Explorer (and system dialogs) via IShellFolder::CreateViewObject() or SHCreateShellFolderView(), or find a third-party solution that does the hard work of interacting with the Shell for you.

Want to resize other applications running in Windows

I'm looking for the cleanest way to get all open windows and have access to moving/resizing them. I'd like to be able to get their current locations and move them where I'd like.
I want access to all windows, not just top level ones.
Thanks
One way to get the list of processes running is shown on this tutorial: Win32 APIs for Process Retrieval. Another way is through EnumDesktopWindows.
If at this point you have access to the window's handle then you can move it with SetWindowPos(). But if you only have access to it's title, then you'll need to use FindWindow() first and obtain a handle to that window.
Here is an example that shows how to do several different operations on a specific window, including how to move it to another location.

How do I display a file or directory browser dialog using MATLAB

I have created a blank GUI and now I want to program a push button to display a file or directory browser dialog.
Your question could use a little more detail, but here's a general suggestion to get you started...
You could set the callback for your push button so that it invokes one of the built-in dialog boxes available in MATLAB. You may be most interested in UIGETDIR or UIGETFILE to browse for and select a directory or file, respectively.
In addition to gnovice's advice, if you want your directory browser to be embedded within your GUI (as opposed to opening in a separate dialog window), you can use Java component. Take a look at my UICOMPONENT utility on the File Exchange for a working example.
Alternately, you can design your own tree-view of folder contents within a matlab panel, using the documented yet unsupported UITREE function or a Java JTree component (take a look at my UIINSPECT or FINDJOBJ utilities for working examples).

Resources