PC Review


Reply
Thread Tools Rate Thread

How to awoid taking focus

 
 
Mads Hansen
Guest
Posts: n/a
 
      10th Aug 2003
I have now tried almost every thing to avoid a form taking the keyboard
focus but I have failed to avoid this.

How can I avoid a windows form taking focus in .Net. The problem is that I
have to create a onscreen keyboard and it would be nice if the form with the
keyboard on newer gains focus.

How can I create a form that newer takes focus ?


 
Reply With Quote
 
 
 
 
Joe White
Guest
Posts: n/a
 
      11th Aug 2003
Take a look at WM_MOUSEACTIVATE.


Mads Hansen wrote:
> I have now tried almost every thing to avoid a form taking the keyboard
> focus but I have failed to avoid this.
>
> How can I avoid a windows form taking focus in .Net. The problem is that I
> have to create a onscreen keyboard and it would be nice if the form with the
> keyboard on newer gains focus.
>
> How can I create a form that newer takes focus ?


 
Reply With Quote
 
Mads Hansen
Guest
Posts: n/a
 
      11th Aug 2003
I have been through almost any possible Windows messages with out luck.
But I will give it a try. Do you now the Id number of this messages.

Another thing do you now where to find examples for VB .Net and Win API
32 because almost all examples I can find is readen for VB 5/6 and I
cant seem to make them work in VB .Net at least not all of them.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Joe White
Guest
Posts: n/a
 
      13th Aug 2003
If you have Visual Studio .NET installed, you can look up the message
constants in C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\WinUser.h.

In case you don't have VS.NET, the numeric value for WM_MOUSEACTIVATE is
0x0021. You'll also need to know the return codes: MA_ACTIVATE is 1,
MA_ACTIVATEANDEAT is 2, MA_NOACTIVATE is 3, and MA_NOACTIVATEANDEAT is 4.

As for finding sample code, no, I haven't found any good comprehensive
sites for P/Invoke and WndProc stuff. I've had the best luck just
searching Google (both Web and newsgroups) -- so far that's always found
me what I need.


Mads Hansen wrote:
> I have been through almost any possible Windows messages with out luck.
> But I will give it a try. Do you now the Id number of this messages.
>
> Another thing do you now where to find examples for VB .Net and Win API
> 32 because almost all examples I can find is readen for VB 5/6 and I
> cant seem to make them work in VB .Net at least not all of them.
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!


 
Reply With Quote
 
Joe White
Guest
Posts: n/a
 
      14th Aug 2003
The only option I would know how to implement is to descend a new class
from the control and override its WndProc.

I'm sure there are other ways (using SetWindowLong to subclass the
control at runtime, for example), but I'm not sure how to implement them
in .NET.


Mads Hansen wrote:
> You should't happent to now how to grab windows messages send to a
> control on a form and not the form it self?
>
> mads
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Taking Focus Rich Microsoft Word Document Management 0 17th Sep 2009 04:54 PM
Textbox(s) not taking focus =?Utf-8?B?YXdyZXg=?= Microsoft Word Document Management 2 4th Dec 2006 12:07 PM
Taking Focus off datagrid kenglish_hi@yahoo.com Microsoft VB .NET 2 22nd Apr 2005 08:47 PM
Taking the focus Dan Windows XP Internet Explorer 0 30th Jul 2004 06:55 PM
PrintPreviewControl taking focus away =?Utf-8?B?WWFyb24=?= Microsoft C# .NET 0 20th Jun 2004 06:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:15 PM.