Showing posts from April, 2016

Capture or Detect mouse click on or outside Windows Form using C#.NET

Sometimes in case of Windows form application where we have multiple windows opened and we need to find on which window user has clicked. One method to find this is to capture the mouse click message. Here is the sample code to close form if mouse click happen outside the form. 
publicpartialclassfrmTest :Form     { classWindowCaptureChanged:NativeWindow         { publicCaptureChangedOnCaptureChanged;
protectedoverridevoidWndProc(refMessagem)             { if(m.Msg