How to get application currently activated
-
Would somebody help me please do something in c++ step by step ? I want to get info. of currently active application: pid and name By active i don't mean the same application that wants to know the info. Example: from my application i want to know if notepad is currently active and somebody is writing txt.. REPORT 1/we have wo running applications = myapp and notepad 2/alt tab to myapp 3/status report in my application = myapp is focused 4/alt tab to notepad 5/status report in my application = notepad is focused 6/writing text in notepad 7/status report in my application = notepad is focused 8/status report in my application = event key pressed
-
Would somebody help me please do something in c++ step by step ? I want to get info. of currently active application: pid and name By active i don't mean the same application that wants to know the info. Example: from my application i want to know if notepad is currently active and somebody is writing txt.. REPORT 1/we have wo running applications = myapp and notepad 2/alt tab to myapp 3/status report in my application = myapp is focused 4/alt tab to notepad 5/status report in my application = notepad is focused 6/writing text in notepad 7/status report in my application = notepad is focused 8/status report in my application = event key pressed
This may help: [
GetForegroundWindow
]for getting handle of application which currently have Keyboard focus [GetWindowText
] retrieve the Caption Text associated with Windows handle [GetWindowModuleFileName
] return with the path of application!"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
-
Would somebody help me please do something in c++ step by step ? I want to get info. of currently active application: pid and name By active i don't mean the same application that wants to know the info. Example: from my application i want to know if notepad is currently active and somebody is writing txt.. REPORT 1/we have wo running applications = myapp and notepad 2/alt tab to myapp 3/status report in my application = myapp is focused 4/alt tab to notepad 5/status report in my application = notepad is focused 6/writing text in notepad 7/status report in my application = notepad is focused 8/status report in my application = event key pressed
I think u will have to use hooks. Try this link http://www.codeproject.com/dll/hooks.asp
-
I think u will have to use hooks. Try this link http://www.codeproject.com/dll/hooks.asp
thx maybe this would help.....just wait me to code some stuff and post reply my result thx again Always willing to participate in coding new projects. C++. Multimedia, graphics and hardware.