foreground

Changing the Foreground colour of a contentpresenter in a listbox

I have created the following style for a listbox that will have an image displayed next to some text: <Style x:Key="ImageListBoxStyle" TargetType="{x:Type ListBox}"> <Setter Property="SnapsToDevicePixels" Value="true"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="ScrollViewer.HorizontalScrollBarVisibilit...

My Calendar control is cut

Hi guys I've got an own control with a calenadar popup and other funcionalities. I've placed that Control into a grin in the content of another Page. My Problem now is, that the Calendar Control is cut. So i only see half of the calendar. How can i bring it to the Front? Like the normal DatePicker Control does?? Thx Patrick ...

How to detect which window is the foreground window ?

Hello, friends, I need to write an assembly (C#.net 2.0 class library) to monitor all applications currently running in a PC. Especially, I need to know which window is the top one, i.e., catch the event when a window becomes foreground window. Should I use WndProc() to catch related window messages? (I don't want to use timer). Any r...

Good text foreground color for a given background color

I'm drawing a color selection button and I'm looking for a nice and simple formula to get a good text color (foreground) for a given background color in RGB. A simple try would be to just take the complement color but this will produce an odd looking button for colors like pure blue or pure red. Is there something well known that does...

WPF, MVVM, and Menu Foreground Color - Oh My.

I'm new to both WPF and MVVM. I searched for a good way to dynamically create menus in the MVVM partern and, not finding anything to my liking, rolled my own solution. It works, but for some reason the Foreground (text) color of the menus is sometimes (just sometimes) not correct. I was going to include a picture to demonstrate my pro...

Get the topmost window of my own application ONLY - in C

I'm using the following code to get a handle of the topmost window: HWND hwnd; hwnd = GetForegroundWindow(); The problem with this is that it returns the top most system-wide. Is there any way to get the topmost ONLY from my own application? I want to get the top most window ONLY of my application. This means, that I need an API to ...

Setting the selected font colour to be different to unselected font colour in listbox control

I've found that the font colour comes from the content (ie outside of the controltemplate) of a listbox or combobox. I'd like to have black text on white background when the items are unselected, and when selected would like black background with white text. unfortunately I've not been able to figure out how to change the text colour. I...

WPF: How do I inherit property values to all child controls?

I have UserControls containing other controls. I want that if I set a Foreground color for the UserControl, all child controls automatically inherit it. I have the same problem with font style/size. Can I set these properties somehow to auto/inherit? Is this possible to set all subcontrols without a loop? ...

Keep window in foreground (even if it loses focus)

In my application (C', Windows Forms) I have got a telephone information screen: if there is an incoming phone call a window with additional information to the caller is shown. This window should open in foreground and should stay there even if the user is writing in another window (so the user still sees the information regarding the i...

Bring window to foreground after Mutex fails

Hi, i was wondering if someone can tell me what would be the best way to bring my application to the foreground if a mutex was not able to be created for a new instance. Eg - Application X is running but is in the background. I cant see it so i try to run another instance and because the mutex returns false the best thing to do is to br...

Android - Bringing Activity to Foreground via the Call Button (Green Key)

Hi all, I currently have an application that naturally gets pushed to the background when the home key is pressed. The activity losses focus but continues running in the background. So I want to know is it possible to bring the application back to the foreground when the user presses the green key (call button) on the device? ...

What are background, foreground & main threads ?

Hi folks, what's the difference between background, foreground & main threads? What are the diff types of threads in .NET? TIA ...

How can i get the exe path of the foreground window

Hello! I would like to get the executable file´s path of the active foreground window. I already have the handler of the foreground window: [DllImport("user32.dll")] static extern IntPtr GetForegroundWindow(); IntPtr handlerAppActual = GetForegroundWindow(); And i would like to get the path of it´s executable file, like a shortc...

How do you force a java swt program to "move itself to the foreground"?

Currently with swt, I sometimes want a program to arbitrarily come to the foreground (like an alarm clock might). Typically the following works (jruby): @shell.setMinimized(false) @shell.forceActive This brings the shell to the front if it was minimized. Creating a new shell at any time also brings the (new shell) to the front. So ...

Set focus on a runing Activity

Hi all, I have an Activity that keeps running after the HOME button is pressed (naturally) and of-course the focus is in the home screen, and when the running process ends i need to restore the focus on that activity... in more PC expression, i need to maximize the application ;) Any help is good. thx in advance. ...

Color palette reference for .Net foreground colors?

HI everyone, Just looking for a website or pdf reference which has a color palette of the .NET (Visual Studio 2008) foreground colors? (E.g. like AliceBlue, AntiqueWhite, Cyan....) ...

NSRunAlertPanel shows up behind the "active window"

I'm trying to put together a simple error reporting package. If my main program crashes, it saves a crashlog, then starts a reporter program. The reporter program asks the user if it can send the crash log to me, then does so. I'm using NSRunAlertPanel to create a basic message box. For some reason, that message box is showing up buried...

GetForegroundWindow not working when C# program is run from a shortcut key of a desktop shortcut

I'm trying to get a handle to the foreground window in C#/Net 2.0/WinForms by calling the native GetForegroundWindow WinAPI function, in my app's form's constructor. When I run the program directly from Windows Explorer or Total Commander, it correctly identifies the Windows Explorer or Total Commander window. However, if I create a sh...

VIM: Restore original foreground color for Normal highlight group

Howdy, Is there a way in vim to restore the terminal's original foreground color after changing it with the ':highlight Normal' command? For example, I'm using vim.exe 7.2 in a Windows Command Prompt. My Command Prompt has green text. When I start vim.exe, I can run the following command to change the text to red: :highlight Normal ct...

Active windows in Windows and QWidget::activateWindow()

The Qt documentation for QWidget::activateWindow() states: On Windows, if you are calling this when the application is not currently the active one then it will not make it the active window. It will change the color of the taskbar entry to indicate that the window has changed in some way. This is because Microsoft does...