473,587 Members | 2,527 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do you preprocess WM_MOVING and/or WM_MOVE???

I need to be able to process the message WM_MOVING and WM_MOVE, however
I noticed that the following breakpoint in PreProcessMessa ge isn't hit
on move (it does get hit when I press alt for instance though). It does
get hit on the WndProc, however I can't return a true here, so it's
worthless for me... Any help would be awesome:

==== start code ====
public const int WM_MOVING = 0x0216;
public const int WM_MOVE = 0x0003;
protected override void WndProc(ref Message m)
{
switch (msg.Msg)
{
case WM_MOVING:
{
Debug.WriteLine ("break on this line");
//return true;
break;
}
case WM_MOVE:
{
Debug.WriteLine ("break on this line");
//return true;
break;
}
}
base.WndProc(re f m);
}
public override bool PreProcessMessa ge(ref Message msg)
{
switch (msg.Msg)
{
case WM_MOVING:
{
Debug.WriteLine ("break on this line");
return true;
break;
}
case WM_MOVE:
{
Debug.WriteLine ("break on this line");
return true;
break;
}
}
return base.PreProcess Message (ref msg);
}
==== end code ====
Nov 17 '05 #1
2 7820
Benny,

The documentation for PreProcessMessa ge states:

PreProcessMessa ge is called by the application's message loop to preprocess
input messages before they are dispatched. Possible values for the msg
parameter are WM_KEYDOWN, WM_SYSKEYDOWN, WM_CHAR, and WM_SYSCHAR.

To that end, that will not be called for mouse movement.

You should be able to overrid the WndProc method. Instead of returning
true though, just return the return value from the base implementation.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Benny Raymond" <be***@pocketro cks.com> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
I need to be able to process the message WM_MOVING and WM_MOVE, however I
noticed that the following breakpoint in PreProcessMessa ge isn't hit on
move (it does get hit when I press alt for instance though). It does get
hit on the WndProc, however I can't return a true here, so it's worthless
for me... Any help would be awesome:

==== start code ====
public const int WM_MOVING = 0x0216;
public const int WM_MOVE = 0x0003;
protected override void WndProc(ref Message m)
{
switch (msg.Msg)
{
case WM_MOVING:
{
Debug.WriteLine ("break on this line");
//return true;
break;
}
case WM_MOVE:
{
Debug.WriteLine ("break on this line");
//return true;
break;
}
}
base.WndProc(re f m);
}
public override bool PreProcessMessa ge(ref Message msg)
{
switch (msg.Msg)
{
case WM_MOVING:
{
Debug.WriteLine ("break on this line");
return true;
break;
}
case WM_MOVE:
{
Debug.WriteLine ("break on this line");
return true;
break;
}
}
return base.PreProcess Message (ref msg);
}
==== end code ====

Nov 17 '05 #2
So I guess Pinvoke will help here if he wants to stop the form from moving.

Ab.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:#r******** *****@TK2MSFTNG P11.phx.gbl...
Benny,

The documentation for PreProcessMessa ge states:

PreProcessMessa ge is called by the application's message loop to preprocess input messages before they are dispatched. Possible values for the msg
parameter are WM_KEYDOWN, WM_SYSKEYDOWN, WM_CHAR, and WM_SYSCHAR.

To that end, that will not be called for mouse movement.

You should be able to overrid the WndProc method. Instead of returning true though, just return the return value from the base implementation.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Benny Raymond" <be***@pocketro cks.com> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
I need to be able to process the message WM_MOVING and WM_MOVE, however I
noticed that the following breakpoint in PreProcessMessa ge isn't hit on
move (it does get hit when I press alt for instance though). It does get
hit on the WndProc, however I can't return a true here, so it's worthless
for me... Any help would be awesome:

==== start code ====
public const int WM_MOVING = 0x0216;
public const int WM_MOVE = 0x0003;
protected override void WndProc(ref Message m)
{
switch (msg.Msg)
{
case WM_MOVING:
{
Debug.WriteLine ("break on this line");
//return true;
break;
}
case WM_MOVE:
{
Debug.WriteLine ("break on this line");
//return true;
break;
}
}
base.WndProc(re f m);
}
public override bool PreProcessMessa ge(ref Message msg)
{
switch (msg.Msg)
{
case WM_MOVING:
{
Debug.WriteLine ("break on this line");
return true;
break;
}
case WM_MOVE:
{
Debug.WriteLine ("break on this line");
return true;
break;
}
}
return base.PreProcess Message (ref msg);
}
==== end code ====


Nov 17 '05 #3

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

Similar topics

4
5077
by: Sylvain Donnet | last post by:
Hi, My question is probably entirely described in the subject... I need to preprocess a PHP file before it enters the PHP parser. My goal is to change some non-PHP parts of text into PHP orders. I see in PHP doc an output_handler to postprocess the output. And I see that there is no input_handler. Does anybody have a clue, a solution ? I...
11
3328
by: Chris Croughton | last post by:
I have a requirement to partially preprocess C code. By 'partially' I mean that I need to define some macros (to the utility) and have it preprocess only those macros, leaving everything else intact. A compiler's preprocessor won't do this, since it will also process macros defined in the code (and in standard header files) and strip out...
4
25148
by: Sean | last post by:
Hi, I would like to know where I can get the value for Windows API Notification? For example: private const int WM_ACTIVATEAPP = 0x01C; private const int WM_NCACTIVATE = 0x086; I couldn't find it in the Windows API documentation.
0
744
by: DotNetJunkies User | last post by:
My porting 32 bit code to 64 bit using VC++.net 2003 & SDK Server 2003. In below code VC++.net 2003 compiler compiles the else part of code. Compile should go to if part. I think Pre-Processor is not Working VC++.net Well ? #define USE_MFC_CLIST
4
1371
by: rosik | last post by:
Hallo, is it possible to open a page like this: http://www.mydb.com/query.php?Lng=1&Edn=2&Sch=5&Sky=4&ID=MY_TEXT_HERE&Ava=Gt5 from a local page which would look like this: ----- local page starts ----- Enter ID: ....MY_TEXT_HERE......
1
2194
by: efinzel | last post by:
Good morning- I am brand new to any kind of programming language. I am only attempting it because I want to use the Generic Mapping Tools program (http://gmt.soest.hawaii.edu/) to create maps. I have a lot of Arc data that I want to convert to use in GMT. I found a file, shp2gmt (http://169.237.35.250/~dylan/grass_user_group/map1.html), that...
3
1708
by: markokosmerl | last post by:
Hello! Does anybody know if there is some kind of option in running preprocessor on any kind of source code that would only preproces macros - put definition of macro on every place where that macro is used... If not is there some kind of program allready written for that? Thanks for any kind of answer! marko
1
2294
by: =?iso-8859-1?Q?David_S=E1nchez_Mart=EDn?= | last post by:
Hi! I've seen the message below in this python list, that seems to be unanswered. I'm trying to do the pretty same thing. There's a way to preprocess the request with a mod_python handler and then proxying it with mod_proxy?
0
988
by: ramgopalkota | last post by:
Hi , I have a corba code generated by tool.In one of the header file created by the tool has a peice of code as below #include <someincludes> #ifdef _LC_attr #error "LC ATTR is DEFINED" #else < SOME CODE> #endif
0
7849
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8215
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. ...
1
7973
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...
0
8220
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...
0
6626
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...
1
5718
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...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.