Multimobile Development: Building Applications for any Smartphone
Super Duper Focus Question
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.interop.


Dr Woo
GOOD ANSWER
Take a look at the "on-screen keyboard" under
Accessories -> Accessibility. Now open IE and click on
the address bar and then start typing an address from the
on-screen keyboard (OSK). Notice how the OSK does not
appear to gain focus even though your are click on the
the buttons on the OSK. IE retains focus. That is what
Take a look at the "on-screen keyboard" under
Accessories -> Accessibility. Now open IE and click on
the address bar and then start typing an address from the
on-screen keyboard (OSK). Notice how the OSK does not
appear to gain focus even though your are click on the
the buttons on the OSK. IE retains focus. That is what
I'm trying to do. The only difference is that I have a
popup number pad that is a child of the parent form.

I have two projects in mind.

1) I want to build a popup numeric keypad and have it
function similar to the "On-screen Keybord" that is under
accessibility or TIPs keyboard.

2) I want to build a popup input panel to capture ink and
perform the reco and send the text back to a textbox on
the parent form.

I have both controls working now but I have to volley
focus back in forth between the parent form and the
child. There are several examples of what I would like to
achive with the Tablet PC. The windows input panel (TIP)
does this and so does Franklin Covey's Tablet PC
planner.

I found something in the Win32 news group that mentioned
using WS_EX_NOACTIVATE | WS_EX_APPWINDOW.

If I use the following override the form shows but I
can not click on any of the buttons because it does not
have focus. 2nd if I use this with the ink panel I can
draw ink but I can not ever close my form because I can
not gain focus back to it. So I think I'm on the right
path,

What else should I be doing?

protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.Style |= 0x08000000;
return cp;
}
}

Reply to this message...
Vote that this is a GOOD answer... (1 vote from another user already)
 
 
    
Mattias Sjögren
GOOD ANSWER
Dr Woo,

I did a quick test and looked at the messages recieved by the OSK with
Spy++. It looks like it prevents gaining focus by handling
WM_MOUSEACTIVATE and returning MA_NOACTIVATE. Then it posts
WM_LBUTTONDOWN and WM_LBUTTONUP messages to itself to simulate that a
click took place.

Mattias

===
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Reply to this message...
Vote that this is a GOOD answer... (1 vote from another user already)
 
 
    
Dr Woo
GOOD ANSWER
Would it be possible if you could post a simple form
example of how to handle this type of interop? I'm still
rather green. I'm working hard though. :)

[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer... (1 vote from another user already)
 
 
    
Mattias Sjögren
GOOD ANSWER
Dr,

[Original message clipped]

This is more of a Winforms question, so I think you'll get better help
in the m.p.d.framework.windoesforms group.

Mattias

===
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Reply to this message...
Vote that this is a GOOD answer... (1 vote from another user already)
 
 
 
System.Windows.Forms.CreateParams




Ad
BootFX
Reliable and powerful .NET application framework.
iOS, Android and Windows Phone Development Training and Consultancy
Hosted by RackSRV Communications
 
Copyright © AMX Software Ltd 2008-2012. Portions copyright © Matthew Baxter-Reynolds 2001-2012. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - 4.0.30129.1734

Hi! 10 years ago I founded .NET 247. I am working on a new and exciting replacement for the site. Please join me on Twitter to discuss.

Thanks,
Matthew Baxter-Reynolds (@mbrit)

Follow mbrit on Twitter