|
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?
|
|
|
|
|
v.j wrote: So now tell me what can I do?
1/ Use Shift key to make some letters capitals.
2/ You can modify your original question by adding the new information at the bottom, in case someone can help you, but reads the incomplete question.
Iain.
|
|
|
|
|
Please try to give us more informations on your task.
Do you want to save fragments of an source-avi to a new avi?
Do you want to transcode the streams?
DirectShow is also provided for C# ... have a look at: http://sourceforge.net/projects/directshownet/[^]
|
|
|
|
|
Hi every one;
am tryin to make an antivirus, and i am having a problem tryin to figure
out how i can stop a process that is running, i.e how can i make the AV to stop a virus process thats running, Also if you know how i can clean the registry with the AV you can assist me.
THANX in advance
|
|
|
|
|
Have a look at TerminateProcess [^]. There are security issues to overcome though.
Good luck.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I think generaly its better you didnt use of TerminaterProcess.
|
|
|
|
|
Even with viruses? Oh Hamid, I know, you are a really kind guy
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|