|
If an app is minimized or hidden in the system tray, can we still find a handle to that app? Can we make FindWindow work in this regard? If so, how?
|
|
|
|
|
You could depend on our collective expertise, or....
...you could find out for yourself!
Write a program that does FindWindow, and test it when the victim app is not minimised. Then test it again when the victim is mimised.
Iain.
|
|
|
|
|
I found out that when the app is minimized to system tray, it cannot be found by using FindWindow because the window becomes hidden. Now is there any other way to find the window handle while its minimized in the system tray? I'm running out of ideas so please help me.
->Demsen
|
|
|
|
|
I apologise. I misread your question.
I'm assuming...
There is an application that when running makes a notification icon in the systray / notification area. If you (eg) double click on the icon, it will pop up a nice big dialog box with a name (WindowA) etc that you can FindWindow. But when you finish with that dialog, FindWindow no longer works?
If the dialog was simply being hidden or minimised, then FindWindow should still work - so it's being destroyed. BUT - for a notification icon to work, it must have a window (WindowB) for the shell to send messages to. This window creates WindowA when needed.
When WindowB is up, use Spy++ to look for it. It may not have a parent window, but it will be in the same process as WindowA. It will just take a good lot of looking through Spy++ to find it.
Close down as many programs as you can first, as they'll just make your hunt harder.
You will then get the problem of what to do with the window handle, but that's a separate question.
Iain.
|
|
|
|
|
demxine wrote: I found out that when the app is minimized to system tray, it cannot be found by using FindWindow...
I just tried it and it works fine.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
you could try the EnumWindows function...
|
|
|
|
|
How do i use EnumWindow in this context of OnCopyData?
void CWindowsDVRDlg::CheckTray()
{
LRESULT copyDataResult;
CString mainAppName = "Setup";
CString quitMessage = ("minimized");
CWnd *pOtherWnd = NULL;
//pOtherWnd = CWnd::FindWindow(NULL, (LPCTSTR) mainAppName);
if(pOtherWnd != NULL){
pOtherWnd->SetForegroundWindow();
COPYDATASTRUCT cpd;
cpd.dwData = 0;
cpd.cbData = quitMessage.GetLength()+1;
cpd.lpData = (PVOID)(LPCTSTR) quitMessage;
copyDataResult = pOtherWnd->SendMessage(WM_COPYDATA,
(WPARAM)AfxGetApp()->m_pMainWnd->GetSafeHwnd(),
LPARAM)&cpd);
quitMessage.ReleaseBuffer();
}
}
Should I just replace this line:
//pOtherWnd = CWnd::FindWindow(NULL,(LPCTSTR) mainAppName);
with EnumWindow() and would I be able to get the handle of the hidden window in the system tray? If not, any ideas please?
->Demsen
|
|
|
|
|
not quite... as msdn says "The EnumWindows function enumerates all top-level windows on the screen by passing the handle to each window"...so you will have to check each window handle you get to see if its the window you want...
u will have to fiddle around with a bit im not 100% sure it will fix ur problem...
|
|
|
|
|
demxine wrote: If an app is minimized or hidden in the system tray, can we still find a handle to that app?
Yes.
demxine wrote: Can we make FindWindow work in this regard?
Yes.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The answer is both yes but how? Can you please post a code showing on how to make FindWindow, get a handle to an app minimized in the system tray (with regards to the OnCopyData code I've posted above)?
|
|
|
|
|
demxine wrote: The answer is both yes but how? Can you please post a code showing on how to make FindWindow, get a handle to an app minimized in the system tray...
Even if the application has been minimized to the taskbar notification area, you can still use FindWindow() , like:
HWND hWnd = FindWindow(NULL, _T("FaxWatch"));
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi!
I want to take a closer look to Microsofts Speech API version 5.3 (unmanaged).
The first thing: where can I obtain the API?
One source says, its part of the Platform SDK, the next it is part of the Windows SDK.
So, the Windows SDK is the newer one, but is the Windows SDK for Vista only?
Or can i run and develop Apps for Win2k, XP and Vista on a XP-Platform with it?
Regards!
|
|
|
|
|
Hello Friends,
I am creating a toolbar in which we are using an activeX control for search engine.When focus is on activex control Rich edit box and press alt key than alt key toggle to file menu of internet explorer but at the same time richeditbox hides. Pls give me a clue why it is so?
Thanks in advance.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
ok, Thanks.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
I think the parent Window handles the Alt key as in a Notepad itself. ie is why the focus goes to the menu. If u need to handle this then u have to handle WM_KEYDOWN Message in rich edit control of the AxtiveX. And think it is not a bug. u can see the same problem in Mozilla or IE etc.
|
|
|
|
|
Hi Nitheesh,
Thanks for reply.
I think i was unable to explain what is the issue.
If you are using google toolbar, first you set the focus on search box and than press alt key. the handle now goes to IE and and again you press alt than it again comes to search box.Here search box is not hide but here the issue is when i press alt than the richedit control (Search box) hides and when again i press alt key the focus comes at my control and it is not displayed properly but when i type some words, It works fine.That is my issue that when control goes to IE than why my activex control hides.Now pls do reply.
Again Thanks,
-Shilpi
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
how can read a avi file and write in another file?
|
|
|
|
|
|
|
|
i m already see this but its is in c# language and i m working on VC++2005.
thanks for help
|
|
|
|
|
|
v.j wrote: how can read a avi file and write in another file?
From what I understood from your question, you would like to read the entire AVI file and copy its content in a new file. In fact, you just want to copy the file, am I right ?
In that case, you don't need to make things very complicated: just copy the file and don't care about interpreting its contents. That's much more easier that using a specialized library that can read AVI files.
|
|
|
|
|
no i dont want to copy whole avi file.
i m select a part and copy this part to another file.
so now tell me wat can i do?
|
|
|
|