How can I display something over all other application. I want to to display something over all form of my program and all other programs open on my desktop (not mine).
*Top Most doesn't work I have tested and my browser can go OVER my application :S
Here is an image of when I use TopMost to TRUE. You can see my browser is over it...
http://www.freeimagehosting.net/uploads/5a98165605.png
1. We couldn't reach the apples on the topmost branches. 2. The topmost branches were full of birds.
To make the active window always on top, press Ctrl + Spacebar (or the keyboard shortcut you assigned). Press the keyboard shortcut again to disable “always on top” for the active window. For script options, right-click on the AutoHotkey icon in the system tray.
A top-level form is a window that has no parent form, or whose parent form is the desktop window. Top-level windows are typically used as the main form in an application.
You can use the form instance and set the property TopMost to True.
Here is what you could do:
In your form class add :
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
In the form load you can add :
SetForegroundWindow(this.Handle);
This should do the trick.
TopMost should do the job BUT: Top most OR/AND the Win32 Api call will only work not inside Visual Studio (well for Vista and with VS2008 I tested it... I can't tell for other). Try running the program with the .Exe from the /bin directory, it will works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With