I need to stop and kill a system tray icon application in NSIS scriptes ?
KillProcDLL::KillProc "xyz.exe"
KillProcDLL::KillProc "xyz"
nsisDDE::Execute "xyz-{D30034F8-AB97-419F-B3B6-FA5BB8CD926F}" "[Quit]"
nsisDDE::Execute "xyz" "[Quit]"
nsisDDE::Execute "D30034F8-AB97-419F-B3B6-FA5BB8CD926F" "[Quit]"
all above didn't works ?
KillProcDLL in 32-bit NSIS cannot kill a 64-bit process, you must use KillProcWMI.
Killing a process is not ideal, it is better to use the LockedList plug-in or use FindWindow + SendMessage $window ${WM_CLOSE} 0 0 to gently close the application.
FindWindow can only be used if the window has a unique window class. Use Spy++ (Visual Studio), WinSpy++ or WinSpyEx to find the window class.
Related
On linux, xdg-open can launch an application, but in most cases the desired behavior is to only launch the application if it's not already running, and to bring it to the front if it is already running.
Can xdg-open do this? Is there some other standard way to provide this functionality?
As you can see xdg-open is nothing more then the wrapper which handles the file type and opens it in the preferred application. It's up to the application if it does or doesn't support "bring to front" option.
$ file /usr/bin/xdg-open
/usr/bin/xdg-open: POSIX shell script, ASCII text executable
In order to bring to front the application window you might use other tools like wmctrl, xdotool or qdbus.
Details:
NAME
wmctrl - interact with a EWMH/NetWM compatible X Window Manager.
SYNOPSIS
wmctrl [ options | actions ]...
DESCRIPTION
wmctrl is a command that can be used to interact with an X Window man‐
ager that is compatible with the EWMH/NetWM specification. wmctrl can
query the window manager for information, and it can request that cer‐
tain window management actions be taken.
[...]
-a <WIN>
Switch to the desktop containing the window <WIN>, raise the
window, and give it focus.
NAME
xdotool - command-line X11 automation tool
SYNOPSIS
xdotool cmd args...
Notation: Some documentation uses [window] to denote an optional window
argument. This case means that the argument, if not present, will
default to "%1". See "WINDOW STACK" for what "%1" means.
DESCRIPTION
xdotool lets you programatically (or manually) simulate keyboard input
and mouse activity, move and resize windows, etc. It does this using
X11's XTEST extension and other Xlib functions.
There is some support for Extended Window Manager Hints (aka EWMH or
NetWM). See the "EXTENDED WINDOW MANAGER HINTS" section for more
information.
Is it possible to detect a double click on another window in wxwidgets?
In my quest to switch to linux I wanna build a program that reacts to double click on the desktop and the file manager and displays a menu.
Same as listary does on Windows.
Is this something that can be done with wxwidgets (preferably wxpython) under linux? What about on Windows?
You can't receive mouse clicks, or any other events, for windows of another process unless you capture the mouse (and never release it, which would be a bad idea).
You can try to use FindWindow() and then Bind() the event handler.
GTK# switch between Process window handles
Hi,
In a GTK# program. Does anyone know how to switch between Process Window Handles? For example if I press a button in a GTK# program it switches the window to process gedit (text editor), or switches window process to another GTK# program running.
Basically I'm trying to port some of my previous windows C# code which switches between windows (processes). For example in C# to switch windows I used:
[DllImport("user32", EntryPoint = "SetForegroundWindow")]
public static extern int SetForegroundWindow(IntPtr hWnd);
I simply passed the Process Main Window Handle to this function above. Is there something similar I can use in GTK# on MonoDevelop for Centos Linux?
Thank you,
Andy
There is a library called libwnck: http://developer.gnome.org/libwnck/stable/ (Window Navigator Construction Kit) which handles all this functionality. There seems to be bindings for Mono called wnck-sharp which as far as I can tell, are included with gtk-sharp.
I have Debian 2.6 running on a SBC that I plan on using in an embedded setup. What I need to do is configure it so that linux will start up and run just my Qt GUI application. Do I need a window manager to do this or can I just do it with X11. Also because it is going to be for an embedded system I do not want to load any desktop manager. Any info on how this can be done would be great!
Yes you can do this without a window manager.
first: You need to boot into a non X session, init level 1 or 3.
second: You need to start the X server, in a basic mode by just calling X or xinit.
third: Start your app. You may need to take a little more control over where your app is positioned on the screen and its dimensions in your code, as you will not have a window manager to help with this.
alternatively: you can launch one of the more basic window managers to see how they play with your system. Motif Window Manager (mwm) and Tab Window Manager (twm)
Note: While working without a window manager, you may get into a state where you cannot do some very basic operations (ex: close a window, move a window, resize a window). You may find that you cannot survive without at least some of the more basic window management functions. Until you close the loop on this, remember, Ctrl + Alt + Backspace will kill the XServer.
If you want to start your app just with X11, you need do:
copy file /etc/X11/xinit/xinitrc to ~/.xinitrc
write all you want to run to it
run command startx
It worked for me and I hope it will help you
What would be the best approach to install a keyboard hook on Linux (X-windows) in order to trigger some application when some key-combo is pressed?? Is there a way to do this regardless of which window manager is running? The idea is to have an application being called ( or brought to foreground ) when some key is pressed in a way similar that Google Desktop does to Ctrl-Ctrl.
XGrabKey on the root window is how xbindkey does it. Be careful about having some alternative method of killing the grab though, it's very annoying to have to go somewhere to ssh into your own box just to kill that process... And that's why, if it was me, xbindkeys+"echo 'moo' > /tmp/moo-fifo" would be the way to do it. That way, you could also control it in any number of other ways you haven't thought of yet.