Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

IN PARVUM MULTUM
  • Administrators
Posted

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

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...