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

No WM_NCMOUSELEAVE messages under "Windows Classic Style"

Hi, hope I'm posting to the right forum.

I'm using C# under .NET 1.1, Windows XP SP2

I have a form and I've overridden WndProc to print to a text box whenever it
receives the WM_NCMOUSELEAVE message. Under "Windows XP Style", I get these
messages fine (when the mouse moves off the title bar or form borders).
Under "Windows Classic Style", I don't get the message at all!

Has anyone seen this?

Thanks!
Jen

Note: If you have an answer/solution, if you could also e-mail
lisseut_at_gmail_dot_com that would be great! (I get so much spam in my
Hotmail account now...).

Sample source (I've tried some different things here):

private System.Windows.Forms.TextBox m_txtMessages;

protected override void WndProc(ref Message m)
{
const int WM_NCMOUSELEAVE = 0x02A2;
const int WM_MOUSELEAVE = 0x02A3;

switch (m.Msg)
{
case WM_MOUSELEAVE:
m_txtMessages.Text = "WM_MOUSELEAVE\n" + m_txtMessages.Text;
break;
case WM_NCMOUSELEAVE:
m_txtMessages.Text = "WM_NCMOUSELEAVE\n" + m_txtMessages.Text;
break;
default:
break;
}
base.WndProc (ref m);
}

protected override void OnMouseEnter(EventArgs e)
{
base.OnMouseEnter( e );
TRACKMOUSEEVENT tme = new TRACKMOUSEEVENT();
tme.hwndTrack = this.Handle;
tme.cbSize = (uint)Marshal.SizeOf(tme);
tme.dwFlags = TME_NONCLIENT;
tme.dwHoverTime = 1000 * 3;
TrackMouseEvent(ref tme);
}

[DllImport("user32.dll")]
static extern bool TrackMouseEvent(ref TRACKMOUSEEVENT lpEventTrack);

[StructLayout(LayoutKind.Sequential)]
public struct TRACKMOUSEEVENT
{
public UInt32 cbSize;
public UInt32 dwFlags;
public IntPtr hwndTrack;
public UInt32 dwHoverTime;
};

const int TME_NONCLIENT = 0x00000010;
Jul 7 '06 #1
0 1957

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

Similar topics

3
by: Sara Khalatbari | last post by:
Hi! Suppose you're writing a module & writing the definition of each function in that module in " or """. for example: a) "This function does this & that" or: b) """This function does blah...
8
by: Hostile17 | last post by:
Consider the following HTML. ---------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <html> <head> <meta...
4
by: mike | last post by:
regards: <a href="JavaScript:loadwindow(106,90);" style="font-family:Verdana;">元智Intranet</a> In HTML spec,are "href" and "style" called "attribute"?....@@ Could someone good give me the...
5
by: johnsuth | last post by:
I want to produce a trivial demonstration of dynamic modification. I thought that pressing a button might change its color. I studied O'Reillys books and successfully created the button with a...
1
by: Shock | last post by:
Hey guys, I'm trying to connect to an SQL Server Database using classic ado in VS.Net using the C# lang. I am using the Microsoft ActiveX Data Objects Library version 2.8. Here is the code...
10
by: Parasyke | last post by:
I have a form that I choose from a list of database names and a list within a textbox comes up with the computer ID number and an associated (from a table) user name. Is there a way from looking at...
1
by: pcnerd | last post by:
I have VB.NET 2005 Express Edition. Is there a VB.NET equivalent to the "classic" VB's DoEvents? I searched the VB.NET Help & had no luck. In "classic" VB, DoEvents was used in code that might...
2
by: SAL | last post by:
I have the following line of code in my Page_Load Event of my ASP.net page: txtExplanationofChange.Attributes.Add ("style","overflow :hidden"); which allows me to can turn off the Scrollbar of my...
2
by: Phaiz | last post by:
Not sure if you'd need an activex control but I'm looking for a script to change the folder view to "Classic View" within IE. I have an iframe that loads the users My Documents folder and would...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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...

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.