ShellView losing focus during input

ShellView losing focus during input

Post by Mick » Wed, 02 Jul 2003 15:55:09



In a namespace extension, my ShellView object contains a CAxWindow hosting a
Webbrowser control, and displaying a DHTML form retrieved from the server.
As soon as the user tries to enter any data into a text field on the form,
however, the form loses focus until the user clicks on the field again. I
need to use the control to capture DWebBrowserEvents2 events, and process
the user data before transmission.

I have tried capturing the WM_KEYDOWN message, as well as interpreting the
IShellView::TranslateAccelerator messages directly, to no avail. Does anyone
have any otehr ideas on this one?

TIA

Mick

 
 
 

ShellView losing focus during input

Post by Mick » Fri, 04 Jul 2003 09:57:46


Answer found (after 2 days of experimentation)

For anyone interested, what I had to do was to Get the IHTMLDocument2 object
from the Document property of the Wenbrowser, and then get the IHTMLElement2
interface of the ActiveElement, and call the focus method of this interface.
All this is done during the OnSetFocus method of theShell View window.

I also had to query the browser object for the IOleInPlaceActiveObject
interface, and return the HRESULT from the TranslateAccelerator method of
this interface from the IShellView::TranslateAccelerator implementation.
This allows the correct handling of the backspace key.

Now it all works fine :)

Mick


Quote:> In a namespace extension, my ShellView object contains a CAxWindow hosting
a
> Webbrowser control, and displaying a DHTML form retrieved from the server.
> As soon as the user tries to enter any data into a text field on the form,
> however, the form loses focus until the user clicks on the field again. I
> need to use the control to capture DWebBrowserEvents2 events, and process
> the user data before transmission.

> I have tried capturing the WM_KEYDOWN message, as well as interpreting the
> IShellView::TranslateAccelerator messages directly, to no avail. Does
anyone
> have any otehr ideas on this one?

> TIA

> Mick


 
 
 

1. FOCUS.FOCUS.FOCUS

When I step though the following script and come to the file\open step, the
VT4 file\open opens instead of the application. Why is this? It's driving me
nuts. I seem to always have the wrong window. The wierd thing is that it
seems to work if I just run it without stepping through it. I'm starting to
get the impression that this isn't a very good product. No wonder M/S sold
it.
Frustrated.
Myles

'$include: 'basic.inc'
Sub OpenFile(FileToOpen as string)
dim hwndApp&
dim info as INFO
 hwndApp = wFndWnd(APP_TITLE, FW_ALL OR FW_PART OR FW_FOCUS ,20)
 If hwndApp Then WSetActWnd (hwndApp)

 wMenuSelect(FILE_OPEN)

 play FileToOpen
 if(GetText(NULL)= APP_TITLE) then
  WButtonClick(BTN_OK)
 endif

2. SMS: some clients, but not all???

3. Vuescan focus lost

4. Winsock.h parse error problem

5. Can a form field switch the input focus?

6. New IPD Modula-2* Version Available Now

7. Motif input focus

8. HP Printer Set-Up - Landscape & Side By Side

9. Lost Focus in Excel

10. Application Losing Focus

11. SLE input focus

12. Problems with threads when the Application lost focus an gets reactivated

13. handle of window which lost focus