|
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
|
|
|
|
|
That's what it is. I thought that the flicker was coming from the transparent overlay window.
It seems to happen when I use the device.Present() command. Before this happens though, the device.Clear() is called, clearing the buffer and screen to a solid color. I thought that solid color on the transparent overlay is what was giving me the trouble.
Everytime the screen updates itself, the device.Clear() is called first, which results in flicker from the solid color being overdrawn to the transparent window.
Is the reason really the active window underneath the transparent window? I just wanna be certain before I try another method to do what I want to do.
If so, any other ways that I could do this job with DirectX? GDI+ is just too slow in drawing and I just don't like OpenGL.
Thanks..
|
|
|
|
|
This is going to be a problem not matter what you use. You're forgetting how windows work. When you have one window over another, the bottom window gets painted first, then the window over it. If you move the top window, the bottom window has to paint itself, then the window you're moving.
Transparency actually makes this process even more important! If you move either window, the bottom window has to repaint itself, thus overwriting your overlay window, then the overlay window has to repaint itself.
Now, if something in the overlay window changes, making a previously hidden part of the bottom window visible, the bottom window has to repaint itself so that previously hidden parts are painted and, therefor, visible again, then the overlay window paints itself.
No matter what, if you use two windows, one over the other, you're are going to run into this flickering problem.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Somebosy pls help me...
- As seen below the initialization of "indexComponent1" -the designer uses the default contructor :
QuickProfitz.Data.IndexComponent indexComponent1 = new Data.IndexComponent();
- What I want the designer is to use the parameterized constructor as :
QuickProfitz.Data.IndexComponent indexComponent1 = new Data.IndexComponent(this);
public class DataTable : Data.Table
{
public DataTable()
{
this.InitializeComponent();
}
//Designer generated code.....
private void InitializeComponent()
{
Data.Index index1 = new Data.Index();
Data.IndexComponent indexComponent1 = new Data.IndexComponent(); // I Want designer to use 'this' as parameter
//
// DataTable
//
indexComponent1.Caption = "NewColumn";
indexComponent1.DefaultValue = "";
indexComponent1.Description = "";
indexComponent1.Mandatory = false;
indexComponent1.Name = "NewColumn";
indexComponent1.Size = 10;
indexComponent1.SqlDbType = System.Data.SqlDbType.VarChar;
indexComponent1.SystemColumn = false;
indexComponent1.Type = System.TypeCode.String;
indexComponent1.Value = null;
index1.Components.Add(indexComponent1);
index1.Description = "";
index1.Name = null;
this.Indexes.Add(index1);
}
}
-- modified at 16:57 Wednesday 27th September, 2006
|
|
|
|
|
Make the default constructor private, if it can't be used.
You may have to create it yourself in the constructor. I don't know of any way to change how the designer generates it's code. I've had situations over the years where I need to keep changing that code manually, as the designer code won't work.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Nope it won't work to define the constructor as private.. -If so the designer won't be able to access the constructor
|
|
|
|
|
I realise that, but as a code design issue, if it can't work without being passed the parent, the default constructor needs to be private.
The other way is to have a property that sets the parent, and call that after the InitializeComponent call, and let the auto generated stuff handle the rest. But, if you *need* the parent, you'll be coding around the designer, a private constructor makes more sense overall.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You will need to write your own CodeDomSerializer. It should be something like this:
[DesignerSerializerAttribute(typeof(IndexComponentCodeDomSerializer ), typeof(CodeDomSerializer))]
public class IndexComponent
{}
internal class IndexComponentCodeDomSerializer : CodeDomSerializer
{
public override object Deserialize(IDesignerSerializationManager manager, object codeObject)
{
CodeDomSerializer baseClassSerializer = (CodeDomSerializer) manager.GetSerializer(
typeof(IndexComponent).BaseType, typeof(CodeDomSerializer));
return baseClassSerializer.Deserialize(manager, codeObject);
}
public override object Serialize(IDesignerSerializationManager manager, object value)
{
CodeDomSerializer baseClassSerializer = (CodeDomSerializer)manager.GetSerializer(
typeof(IndexComponent).BaseType, typeof(CodeDomSerializer));
object codeObject = baseClassSerializer.Serialize(manager, value);
CodeStatementCollection statementCollection = codeObject as CodeStatementCollection;
if (statementCollection != null)
{
CodeAssignStatement assignStatement = statementCollection[0] as CodeAssignStatement;
if (assignStatement != null)
assignStatement.Right = new CodeObjectCreateExpression(typeof(PopUpMainMenu),
new CodeThisReferenceExpression());
}
return codeObject;
}
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi all,
kind of a stupid question, but I just can't seem to get it. I have a SaveFileDialog and can get the path of the file select with the file name, but I just want to display the file name to the user since my display space is small. Any hint to do this?
Thanks in advance
|
|
|
|