473,387 Members | 1,766 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,387 software developers and data experts.

WinProc and Messages

Lav
Hi,
I want my Win form to listen to keystroke even when it is minimized.
I think it can be done overriding the WinProc method.
But I didn't get any useful articles on how to go about it.
Can someone tell what would be the best way to do it ?

Thanks
Lav

Jun 22 '06 #1
4 3696
Raj
// protected override void WndProc(ref System.Windows.Forms.Message m)
// {
// const int WM_LBUTTONDBLCLK = 0x203;
// switch(m.Msg )
// {
// case WM_LBUTTONDBLCLK:
// MessageBox.Show ("db click");
// return;
// break;
// }
// base.WndProc (ref m);
//
//
// }

"Lav" wrote:
Hi,
I want my Win form to listen to keystroke even when it is minimized.
I think it can be done overriding the WinProc method.
But I didn't get any useful articles on how to go about it.
Can someone tell what would be the best way to do it ?

Thanks
Lav

Jun 22 '06 #2
Lav

Raj wrote:
// protected override void WndProc(ref System.Windows.Forms.Message m)
// {
// const int WM_LBUTTONDBLCLK = 0x203;
// switch(m.Msg )
// {
// case WM_LBUTTONDBLCLK:
// MessageBox.Show ("db click");
// return;
// break;
// }
// base.WndProc (ref m);
//
//
// }

"Lav" wrote:

Raj ,

Thanks for the response.
But the Msg property of the Message could be different for the same
key.
Actually my requirement is to make a Form visible (which by the way is
in notification bar)
once the user presses a key or set of keys.
- Lav

Jun 22 '06 #3
Lav wrote:
Hi,
I want my Win form to listen to keystroke even when it is minimized.
I think it can be done overriding the WinProc method.
But I didn't get any useful articles on how to go about it.
Can someone tell what would be the best way to do it ?

Thanks
Lav
Hi Lav, I think it can be done overriding the WinProc method.


I'm afraid nothing so simple... if your window doesn't have the focus,
you're not going to get any key events, unless you wire in a windows hook.

Take a look at this article:
<UrlMightWrap>
http://www.codeproject.com/csharp/globalhook.asp
</UrlMightWrap>

This may be what you need.

Hope this helps,
-- Tom Spink
Jun 22 '06 #4
Lav
Thanks Tom.
:)

Tom Spink wrote:
Lav wrote:
Hi,
I want my Win form to listen to keystroke even when it is minimized.
I think it can be done overriding the WinProc method.
But I didn't get any useful articles on how to go about it.
Can someone tell what would be the best way to do it ?

Thanks
Lav

Hi Lav,
I think it can be done overriding the WinProc method.

I'm afraid nothing so simple... if your window doesn't have the focus,
you're not going to get any key events, unless you wire in a windows hook.

Take a look at this article:
<UrlMightWrap>
http://www.codeproject.com/csharp/globalhook.asp
</UrlMightWrap>

This may be what you need.

Hope this helps,
-- Tom Spink
Jul 15 '06 #5

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

Similar topics

0
by: piyush | last post by:
Sorry for repeated posting but I couldnt get things right/completely in the first post. I am in the process of deciding the IPC mechanisms to use for communication between 1) An application...
14
by: Pmb | last post by:
At the moment I'm using Borland's C++ (http://www.borland.com/products/downloads/download_cbuilder.html#) I want to be able to take an array of points and plot them on the screen. Is there a way...
5
by: Adam | last post by:
Hi, How do i listen for windows messages in c# on compact.net? I have a window containing an instantiation of the HTML viewer control, which is a child of the main form. As the compact...
5
by: zorhel | last post by:
Hi. My clients will be IE, Mozilla and Opera in a Windows and *nix OS. So, my web app need to, from a server, send messages to a specific client (browser), send messages for all clients,...
0
by: neonspark | last post by:
I'm buidling some simple macro functionality for my app so the users can record a sequence of keyboard inputs and replay them reliably via some menu. Originally, I used: protected override bool...
2
by: =?Utf-8?B?Y2pz?= | last post by:
Hi, I have CLI/C++ code to override WndProc(Message% m) in order to create NC area. I tried to marshal unmanaged ptr (m.LParam) to managed object by using Marshal::PtrToStructure like: if...
1
by: CodeSeeker | last post by:
I have an application, which uses pop3 to read the messages from the mailbox, and it has been working fine for so many year. We recently have started changing this application to use java mail IMAP 4...
0
by: Nir | last post by:
hi, why i am not getting any new Messages to my application when the pc is locked?
18
by: Grant Edwards | last post by:
Could whoever is responsible for the gateway that is grabbing my postings off of Usenet and e-mailing them out please fix the headers in the mail messages so that I don't get the bounce messages?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.