Home » U++ Library support » U++ MT-multithreading and servers » Why ie cannt catch messages from keyboard and mouse
Re: Why ie cannt catch messages from keyboard and mouse [message #25571 is a reply to message #25548] |
Mon, 01 March 2010 14:51 |
jiuzhi
Messages: 10 Registered: October 2009
|
Promising Member |
|
|
luzr wrote on Mon, 01 March 2010 17:02 |
jiuzhi wrote on Sun, 28 February 2010 07:01 | I had try to overriding WindowProc and send message to ie's document handle,or setfocus to ie's document,but did not work.
Because I just want a control to browse a web page,I only spent a few hours to get this, so it is very simple.
|
OK, found it.
The problem is that DHCtrl was originally designed for OpenGL widget - in that case, it was not desirable that widget would eat all event messages. That is why by default, DHCtrl is disabled (so that parent Ctrl can take over message processing, effectively returning it back to DHCtrl, because in U++, message dispatch to child widgets is done by CtrlCore).
So the one simple remedy is to:
LRESULT hdIECtrl::WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
switch (message)
{
case WM_SIZE:
wb.doResize();
break;;
case WM_CREATE:
wb.attach(GetHWND());
EnableWindow(GetHWND(), true);
break;
}
return DHCtrl::WindowProc(message, wParam, lParam);
}
Now we have to fix those Heap leaks and we have one quite useful class... (what a pity that right now, there is no Linux counterpart).
Mirek
|
Thank you,luzr.
A simple solution is really unexpected, I was really very little understanding of Upp.
The heap leaks is on pClientSite.Because it can not work properly, so too lazy to go and change, heihei
I had update the attachment on third floor.Also modified in one place:
long hdWB::attach(HWND hwnd)
{
if(hwnd){
if(m_hwnd && m_hwnd!=hwnd) detach();
}else return -2;
[Updated on: Mon, 01 March 2010 14:56] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri May 10 18:01:12 CEST 2024
Total time taken to generate the page: 0.02747 seconds
|