AxWebBrowser and IME issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • allencpp
    New Member
    • Jun 2010
    • 3

    #1

    AxWebBrowser and IME issue

    Hi

    My project is a plug-in to Visual Studio. I have a painter class inherits from SHDocVw.AxWebBr owser class and uses mshtml interfaces. Painter is used to create GUI elements. I am facing set of pblms when I use IME.

    I am getting all the IME related msges in IHTMLEventObj.P rehandleEvent like startCompositio n, notify, IMERequest, endComposition everything. But i'm not able to process anything within it. For eg. When I try to use Microsoft's IME composition window it's not popping up....
    Could you please let me know how to use IME in WebBrowser.

    The sample code runs as follow....
    Code:
    if (state == 8 && inEvtDispId == 0 && pIEventObj.type == "startComposition")
    {
    	IntPtr hImc = WindowsAPI.ImmGetContext(this.htmlControl.Handle);
    
    	if (hImc != null)
    	{
    		hImc = WindowsAPI.ImmAssociateContext(this.htmlControl.Handle, hImc);
    	}
    	WindowsAPI.COMPOSITIONFORM cf = new WindowsAPI.COMPOSITIONFORM();
    	
    	cf.dwStyle = 2;
    	cf.ptCurrentPos = new WindowsAPI.POINTAPI();
    	cf.ptCurrentPos.x = 700;
    	cf.ptCurrentPos.y = 700;
    	bool setcom = WindowsAPI.ImmSetCompositionWindow(hImc, ref  cf);
    
    	WindowsAPI.ImmReleaseContext(hImc, this.htmlControl.Handle);
    
    	isCreatingLabel = true;
    
    	return;
    }
    // When 'endComposition', we should create a label on the painter
    else if (isCreatingLabel && pIEventObj.type == "endComposition")
    {
    	CreateLabel(pIEventObj);
    }
  • allencpp
    New Member
    • Jun 2010
    • 3

    #2
    is there any buddies can reply my question .....

    Comment

    Working...