Home » U++ Library support » U++ MT-multithreading and servers » Why ie cannt catch messages from keyboard and mouse
Why ie cannt catch messages from keyboard and mouse [message #25523] |
Sat, 27 February 2010 14:16  |
bauso
Messages: 1 Registered: February 2010
|
Junior Member |
|
|
I try to make a wrapper class for Internet Explorer, and, when I use DHCtrl as browser's host window,ie cannt response any messages from keyboard and mouse. It only display the page.But if I use CreateWindowEx to create a window as the host window,ie working properly.Is it because the reasons for the upp's message loop?
-
Attachment: iedemo.rar
(Size: 957.68KB, Downloaded 400 times)
[Updated on: Sat, 27 February 2010 14:18] Report message to a moderator
|
|
|
|
|
Re: Why ie cannt catch messages from keyboard and mouse [message #25548 is a reply to message #25533] |
Mon, 01 March 2010 10:02   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
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
|
|
|
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
|
|
|
Re: Why ie cannt catch messages from keyboard and mouse [message #25572 is a reply to message #25571] |
Mon, 01 March 2010 15:06   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
jiuzhi wrote on Mon, 01 March 2010 08:51 |
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;
|
Actually, I believe that without correct AddRef/Release implemenation, there will be leaks...
Mirek
|
|
|
Re: Why ie cannt catch messages from keyboard and mouse [message #25574 is a reply to message #25572] |
Mon, 01 March 2010 15:19   |
jiuzhi
Messages: 10 Registered: October 2009
|
Promising Member |
|
|
luzr wrote on Mon, 01 March 2010 22:06 |
Actually, I believe that without correct AddRef/Release implemenation, there will be leaks...
Mirek
|
May not have to, IE is a self-management of these resources, but ie does not release the used memory is an old problem, as if without any solution. If really want to achieve a browser, I think it is better to use webkit
[Updated on: Mon, 01 March 2010 15:20] Report message to a moderator
|
|
|
|
Re: Why ie cannt catch messages from keyboard and mouse [message #25591 is a reply to message #25574] |
Tue, 02 March 2010 19:05  |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
jiuzhi wrote on Mon, 01 March 2010 09:19 |
luzr wrote on Mon, 01 March 2010 22:06 |
Actually, I believe that without correct AddRef/Release implemenation, there will be leaks...
Mirek
|
May not have to, IE is a self-management of these resources, but ie does not release the used memory is an old problem, as if without any solution. If really want to achieve a browser, I think it is better to use webkit
|
True, but IE does not use U++ heap, so any IE leaks remain undetected.
If U++ says leaks, it means such memory was allocated using our new....
|
|
|
Goto Forum:
Current Time: Tue Apr 29 09:46:42 CEST 2025
Total time taken to generate the page: 0.03932 seconds
|