Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 #25572 is a reply to message #25571] Mon, 01 March 2010 15:06 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13976
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. Embarassed


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 Very Happy
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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: multi-threading slower than single thread
Next Topic: Exclusion of underline chars in UrlEncode function
Goto Forum:
  


Current Time: Fri May 10 19:14:09 CEST 2024

Total time taken to generate the page: 0.02076 seconds