TheAphextwin Posted May 26, 2004 Posted May 26, 2004 I assume this needs to be an Win API call but I can't for the life of me find this anywhere, I am developing in VB.NET 2003. I appreciate an advice or pointers you can offer, thanks. Quote
pelikan Posted May 28, 2004 Posted May 28, 2004 you need to intercept one of the WM_NC.. windows messages sent to the form window. eg. WM_NCLBUTTONDOWN the 'hit-test' code for the message is HTCAPTION to get the values for these constants (API-Viewer? windows.h? if you ever had VS 6) I'm new to C# so not sure how to hook the WindowProc of the form - maybe use the NativeWindow class. :cool: Quote IN PARVUM MULTUM
Administrators PlausiblyDamp Posted May 28, 2004 Administrators Posted May 28, 2004 Paste this into the form in question - should give you a good idea of what you need to do. Private Const WM_NCLBUTTONDOWN As Integer = &HA1 Private Const HTCAPTION As Integer = 2 Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) If m.Msg = WM_NCLBUTTONDOWN AndAlso m.WParam.ToInt32() = HTCAPTION Then MessageBox.Show("hit") Return End If MyBase.WndProc(m) End Sub Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.