|
Sorry! I know it was so confusing!
I want to capture the messages, and detect these:
1)nonClientArea mouse down,
2)nonClientArea mouse up!
But the second is not being sent, because of that the window captures the mouse, and when some window captures the mouse, the mouse up message would not be sent to the window!
And I used the Spy++, but it didn't get me the answer!
Sojaner!
|
|
|
|
|
I did my spy++ lookup and I found out that few messages are sent when the mouse are Up in non-client area, eg:
WM_LPBUTTONUP: You can use these X, Y position to check if they are in the title bar or not
WM_NCMOUSELEAVE: This could be an equivalent to wat you are looking for.
Among other messages that would indicate the events that are happening like WM_NCHITTEST with coordiates also.
Close enough this time?
Regards
|
|
|
|
|
|
|
Yep!
You it 95%.
When there is a press message, there would be a release message after that, and in this case, I want to handle the minimize event myself, and capture the WM_NCLBUTTONDOWN and filter it if needed but still can capture the WM_NCLBUTTONUP that is the release message after the WM_NCLBUTTONDOWN.
Sojaner!
|
|
|
|
|
In this case:
1- Handle WM_NCLBUTTONDOWN and return true to filter it:
2- HANDLE WM_LBUTTONUP and check the coordinates. If they are in the minimize button Handle it and return true.
Try it!
Regards
|
|
|
|
|
|
Why doesn't it work? What exactly happens? Doesn't the WM_LBUTTONUP doesn't fire? Did you check that with Spy++.
I did a small test with Spy++ and it fires well. Just like I told you before, use Spy++ to identify the message that is fired when you release the button on the non client area. There ought to be one!!
Regards
|
|
|
|
|
Nop! Not WM_LBUTTONUP nor WM_NCLBUTTONUP fire!
I tested it in Spy++, it showes that the WM_LBUTTONUP fires but the application does not receive it, and even if it receives, there is no way to check if the mouse is on exactly on the minimize button!
And there is something else, although the Spy++ reports that the WM_LBUTTONUP fires, the MSDN tells that, the WM_LBUTTONUP message would be sent to the window, just when the mouse is on the ClientArea of the window.
Anyway, I changed my code to this:
private const int WM_NCLBUTTONDOWN = 0xA1;
private const int WM_NCLBUTTONUP = 0xA2;
bool filterOff = true;
Message message = new Message();
bool internalMessage = false;
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_NCLBUTTONDOWN && m.WParam == (IntPtr)0x8)
{
if (internalMessage)
{
internalMessage = false;
}
else
{
message = m;
if (filterOff)
{
Message mes = new Message();
mes.HWnd = this.Handle;
mes.Msg = 162;
mes.WParam = m.WParam;
mes.LParam = IntPtr.Zero;
this.WndProc(ref mes);
}
return;
}
}
else if (m.Msg == WM_NCLBUTTONUP && m.WParam == (IntPtr)0x8)
{
internalMessage = true;
this.WndProc(ref message);
return;
}
base.WndProc(ref m);
}
private void Form_KeyUp(object sender, KeyEventArgs e)
{
if(e.KeyCode.ToString() == "Escape")
{
if (!filterOff) { filterOff = true; }
else
{
filterOff = false;
}
}
}
and when I recieve the WM_NCLBUTTONUP, I send a WM_NCLBUTTONDOWN message to the window, myself, but I don't like it!
There have to be someway to make the WM_NCLBUTTONDOWN be sent to the window!
It is driving me crazy! I have to solve this!
Sojaner!
|
|
|
|
|
I know windows form progrmming , C# , VB , SQL , But never did WEB based applications , I know HTML , anyone can recommend how to convert into Web Application programming under .NET , maybe ASP.NET . any site or documentation for fast learning this stuf .
thanx
UnitecSoft
We Will Either Find A Way , OR Make One .
|
|
|
|
|
There's heaps of articles on CP, beyond that, I recommend buying a good book, Dino Esperito (sp?) has a couple of good ones on ASP.NET 2.0.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello
When starting learning a new language or anything else, I prefer video lessons/tutorials if available. If you google for "ASP video tutorials" you'd find plenty to choose from, whether free or with minimal costs.
Regards
|
|
|
|
|
And ofcourse in case of any trouble anytime you can come Here[^] .
Best Regards,
Apurva Kaushal
|
|
|
|
|
Apurva are u an ASP.NET prof ? , send me ur contact details .
unitecsoft
|
|
|
|
|
Ya I am working in ASP.NET. Why you want to have my contact details?
Best Regards,
Apurva Kaushal
|
|
|
|
|
Just for professional curtsy , if you don't mind .
My E.Mail is unitecsoft@hotmail.com
Thanx
unitecsoft
|
|
|
|
|
ofcourse not man.. Actually I work in hyderabad and having approximately 4 yrs of profesional experience majorly on asp.net c#. I will send you a test mail with my personal ID. Hope this much information would be enough.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi all. I have a separate class for connection manager. I have given ABSOLUTE PATH HERE like c:\simple\abc.mdf. I want to make it relative. I have tried the following but doesn't work:
"..\simple\abc.mdf". Please help me. I will be very thankful to you.
|
|
|
|
|
The path depends on what it is relative to. Where is the application that is using it located?
only two letters away from being an asset
|
|
|
|
|
I have a folder abc. In abc, i have following things placed: Simple(Folder) , simple.sln, simple.suo and database.mdf.
In Simple Folder, i have all classes, bin, web references etc.
So please tell me what will be the relative path in my case? Please help me in this regard.
|
|
|
|
|
Your exe is compiled and placed in the bin/debug or bin/release folder for a Wundows app. When setting the connection string for your database file it needs to be relative to this location.
only two letters away from being an asset
|
|
|
|
|
Or use Path.Combine(Application.StartupPath,"relative_path") . This will always work as long as relative_path is in the same directory as your executable.
|
|
|
|
|
AS i know:the path "..\simple\abc.mdf" which must exist under the project bin directory.otherwise it cann't be found by project.
maybe you can set a proprity for path which to get the path of file and then to deal with it.
|
|
|
|
|
Ok let's see who can answer this for me. I'm trying to use a transparent form programmed in C# to be the "surface" or an overlay of another active window. With this transparent form, I'm trying to draw lines, text, polygons, etc... with DirectGraphics (or Direct3D for that matter). When I create, and clear the device, the transparent form results in a horrible flickering due to the device repeatedly clearing itself with a solid color in the buffer over that active window. Suppose that this could be for a game or such...
All I want to do...is to draw using Direct3D on a transparent form without causing flickering when placed over an active window.
Any ideas???
If you don't understand my question, let me know.
Thanks.
|
|
|
|
|
I think I know what you're talking about. The flicker is from the window underneath your transparent DirectX window?
AFAIK, you won't be able to get rid of that flicker. Reason being is that the window you've overdraw (NOT your DirectX window) has to draw itself every time you update the DirectX form above it, this will force your DirectX form to then redraw itself. It's a fight between two forms for the top spot in the screen.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|