|
G'day Folks,
I was just wondering if it is possible somehow to determine if an application is in focus or not. For example, an instance of ms excel is running, it is in focus, if its window is active. Reason for this is that I have managed to write a small c# application which can determine if an instance of ms excel is running, ie. it can be the active application or be minimized to the taskbar.
Therefore I was wondering if anyone can shed some ideas as how to I can determine if the desired application is in focus or not.
thanks
Vee
|
|
|
|
|
The System.Diagnostics namespace has some good classes to help you knwo if some process is alive or not.
|
|
|
|
|
thanks for the tip.. I will look into this and maybe post back a solution if i can.
|
|
|
|
|
When there is a statement in a windows form application which is executing in an infinite loop, the name of the form will show "Not Responding". How does .NET determine if the application is in an unstable state? I wonder if WMI is the right way to track the application? If so, what is the right way to start? If not, is there a way to determine the unstable state of an application?
Welcome any advice
|
|
|
|
|
When your app is in an infinite loop, then usually no windows messages are processed and thus your app is not responding.
So "Not responding" is just another word for "Not processing messages".
You can make your app responsive either by putting the loop code in a separate thread or by calling Application.DoEvents() inside the loop.
Regards,
mav
|
|
|
|
|
I think a separate thread will be more accurate since you may want to make another loop or any ting else.
|
|
|
|
|
Is there any method for mouse over event in this control,or how can i capture the mouse position on this control,or how can i display a Message/alert anything when mouse is over the Control.
I Hope u ppl understand my english
|
|
|
|
|
hi group,
I have a winform application. One of my winform contain a panel with few child controls. I would like to impliment zooming (like 50 % , 100 % etc) facility for all child controls which are avilable inside that panel.
The main reason is, i have a collection of controls inside that perticular panel. Sometime user want to see some or all controll at a streach without scrolling panel up and down.
How will do this ? Please post your idea.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
i hope i understood your question. you can add a Zoom function to your pannel that has a zoom parameter (on a 1 to at least 100, it can be higher since you could zoom to lets say 500%) that will resize the size of your controls and the distance betwin them(theyr location that is). you need to define a scale however for your controls. ofcourse you need to remove the anchor proprietys of all the controls in that panel and for more realism you will need to code a function for resizing the text font of the controls and add it to every control's SizeChange eventHandler.
|
|
|
|
|
thanks a lot for your submission. it would be greate , if you can send some url's .
Sreejith Nair
[ My Articles ]
|
|
|
|
|
I'm trying to overlay a form that I have created in C# over another application that is not an MDI window. I've been doing some research in the user32 dll and found how to overlay my form onto other applications such as IE that are MDIs but ran into this problem when I tried it with the one im intending to use it on. Is there a way to do this without too much trouble or will I have to just create the window without a parent and then manage the z-orders of the windows to make it appear to be a child? and if so are there events that fire that will let me know when the z-orders change and the position of the parent window changes? Thanks for the help.
|
|
|
|
|
I would like to set the focus of a text box with the blinking cursor after the form is loaded. Where in the construction do I accomplish this functionality?
|
|
|
|
|
In FormLoad event.
Ex: textbox1.Focus();
|
|
|
|
|
|
Hi,
You can use the tabindex property. Set the tabindex property of that control to 0.
Thanks and Regards
SGS
|
|
|
|
|
select the text box you want to get focus, in designer go to its properties, set "TabIndex" property to 0 and Its done
|
|
|
|
|
I want to hide windowxp taskbar from C#.net.
Who can help me?
pls...
|
|
|
|
|
|
Hi kyawsoe;
The only way I know how to do this is by using unmanaged code. The two functions you need to call are FindWindow and SetWindowPos which are found in user32.
Here is some code to do it.
Import the two dll's [DllImport("user32.dll",EntryPoint="FindWindow",CharSet=CharSet.Unicode)]
static extern IntPtr MyFindWindow(string _WindowClassName, string _WindowName);
[DllImport ("user32.dll",EntryPoint="SetWindowPos",CharSet=CharSet.Unicode)]
static extern bool MySetWindowPos (IntPtr hWnd, Int32 hWndInsertAfter,
Int32 X, Int32 Y, Int32 cx, Int32 cy, uint uFlags);
Define some variables
private IntPtr hTaskWindow; // Handle to task window
private const uint TOGGLE_HIDEWINDOW = 0x80;
private const uint TOGGLE_UNHIDEWINDOW = 0x40;
You can place this in form load event or somewhere appropriate. It is the handle to the task bar
hTaskWindow = MyFindWindow("Shell_traywnd", "");
Now when you want to hide the task bar execute this statement
MySetWindowPos(hTaskWindow, 0, 0, 0, 0, 0, TOGGLE_HIDEWINDOW);
Or when you want to un-hide the task bar execute this statement
MySetWindowPos(hTaskWindow, 0, 0, 0, 0, 0, TOGGLE_UNHIDEWINDOW);
That's it.
I hope that is was of some help.
-Fernando Soto
|
|
|
|
|
Ok, now that I have access to my data I need to display it in another aspx page. How do I do this?
What I am trying to do is use one of my frames to display different bits of informtion depending on what the user is doing.
|
|
|
|
|
You would be answerded if you ask this in the asp.net forums.
|
|
|
|
|
Hello,
How can i block Pop-Ups in a AxBrowser Component? has a way to do this?
Thanks.
|
|
|
|
|
|
|