473,795 Members | 2,968 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1346

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.mi crosoft.com> wrote in message
news:lB******** ******@cpmsftng xa07.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
1651
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 mails (and keep a copy on the server).
3
3144
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 have any kind of user interface. Can I use a Timer Control, A Winsock Control, and Serial Com Port class (The reason I am using this class from some borrowed code, is that I heard that .Net 1.1 does not have a built-in Serial Com Port...
4
4848
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 XmlMessageFormatter class. But it isn't working -- specifically, receiving isn't working. What am I doing wrong here? I begin by creating a MessageQueue object and setting up its XmlMessageFormatter to handle XmlDocument objects: System.Type...
4
16053
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 UDP tons of messages arrive.. What am I'm doing wrong My code looks like the following... private UdpClient udpClient;
2
4380
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 :) Anyway, here is the result of about an hour and half of work... // IPControl.cs using System; using System.Collections; using System.ComponentModel; using System.Drawing;
10
5726
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 form the control is on? Basically I have a number of controls in a form that are required, and to check it I am setting the Validation Rule to "<>"IsNull" so that when the user tries to tab through/click out of a required area without entering...
1
1506
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 function is used? Kindly help me... Thanks Rani
11
8133
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 "moving" into ToolStrip. Thank you EitanB
3
3617
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 working just fine except of one little thing. whenever the client tries to receive a message the server has sent it goes into a hang. unfortunately without an error or exception at all. the communication itself (sending message from client to...
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10439
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10165
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9043
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7541
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.