473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to have control always receive messages

I am creating a control to mimic the vs.net MainMenu . The control inherits
from control. Is it possible to recieve windows messages when the menu
loses focus. I am running into problems after the tab key is hit, the menu
loses focus and does not respond to messages untill focus is regained. This
is not desireable since hotkeys should open menus.

Also, I would like to stay away from p/invoke for use with linux's mono
project.

Thansk for the help
--
Ron Vecchi

Nov 15 '05 #1
3 1325

Hi Ron,

Thanks for posting in this group.
I think you should override the Form's WndProc method and intercept certain
message. Then invoke your control.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #2
Thanks for the reply, but is there a way to acheive without adding code to
the form but rather the control itself.
Mabey the control could subscribe itself to an event on the form.

Id like to be able to just add the control to any form without having to add
additional code to each form
Thanks

Ron
""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:lB**************@cpmsftngxa07.phx.gbl...

Hi Ron,

Thanks for posting in this group.
I think you should override the Form's WndProc method and intercept certain message. Then invoke your control.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #3

Hi Ron,

Thanks for your feedback.
Because your control has no focus, windows will dispatch the messages to
your control. So you had to do the dispatch in the Form.
This is the similiar as the windows mouse capture. You can use SetCapture
windows API to force all the mouse message pass to your window, actually,
once this API is called, windows will dispatch the mouse message to your
window.(In this situation, your window is the "control", while windows
system is the "Form").
Hope this make sense to you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: WebRod | last post by:
Hi, i use Net_POP3 from PEAR to get emails. I realized today that the UIDL associated to an email is not always the same!! That's terrible. I really need to find a way to download only NEW...
3
by: jean | last post by:
I am very new to .Net and Visual Basic in general. My goal is to write a Visual Basic .Net DLL that can have its functions and subroutines called from another .Net application. My DLL will not...
4
by: Robert Rossney | last post by:
I'm trying to send and receive XmlDocument objects using the System.Messaging.dll functions. The code I've written follows, as best I can tell, the methodology used in the sample code for the...
4
by: Morten Overgaard | last post by:
Hi I'm listening on the SysLog port (514) through UDP. The problem is that I am not receiving anything nut I know that i get messages on the port. When I use KIWI to listen on the same port via...
2
by: Tom Shelton | last post by:
I was goofing around tonight and decided to write a little IP address control. I had written a simple one a long time ago, but I decided I should try to write one that was half way correct :) ...
10
by: gweasel | last post by:
What is the best way to apply a Validation Rule - or rather, where is the best place to put it? Is there an advantage to putting it on the field in the table vs setting the validation rule on the...
1
by: vanirani | last post by:
I would like to send and receive messages to a server using ajax. I sent messages using sendReq.send. I would like to receive the messages sent to ajax from the server. How is this possible what...
11
by: =?Utf-8?B?RWl0YW4=?= | last post by:
Hello, I have a WinForm application. The form has one Tab Control and one ToolStrip. I would like to know what would be the best way to detect when the user is "leaving" the Tab Control and...
3
by: Joe Blauth | last post by:
Hi all, I am currently working on a small application that sends messages from a client to a server and receives messages in return. Basically the functionality is made with sockets which is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.