Questions tagged [wndproc]

WndProc is a .NET method that process Windows messages. It is the .NET equivalent of the C++ WindowProc method.

Official documentation including example.

For more information on how Windows messages are processed, can consult WindowProc.

348 questions
7
votes
2 answers

Intercept single or double mouse click - only execute double click code on double click

I have a situation where I am handling both single & double mouse click events on a form. In both cases something has to be loaded, however when a double click occurs, I do not wish to execute the code attached to the single click event. Is there a…
Tony The Lion
  • 61,704
  • 67
  • 242
  • 415
7
votes
4 answers

JAVA JNA WindowProc implementation

I'm trying to write a simple application in Java that will communicate with an USB device. The USB device is made by me using a Microchip Microcontroller. The communication is rather simple, since the USB device is from the HID Class, arrays of 64…
Gabor
  • 197
  • 1
  • 9
7
votes
3 answers

Get the coordinates of a WM_NCHITTEST message?

How do I get the coordinates of a WM_NCHITTEST message in C# code? I'd love to get the fastest way, because performance is a requirement.
Vercas
  • 8,931
  • 15
  • 66
  • 106
7
votes
3 answers

Native Window: Release Handle On Close

I am currently working on a C# .NET Add-In for Microsoft Outlook. The goal of the Add-In is, to capture the search input from the Outlook Instant Search, and show in a Custom Pane my own search results. It works pretty well, and with subclassing the…
Florian Schöffl
  • 499
  • 3
  • 12
7
votes
0 answers

WM_NCLBUTTONUP message not sent at the end of dragging a form, how to do so?

EDIT: tl;dr go to the first comment. This question stems from another question of mine Get MouseDown event when mouse goes down on Form border? In that question I needed to have a form fire an event when the user pushed the left mouse button down…
AnotherUser
  • 1,311
  • 1
  • 14
  • 35
7
votes
2 answers

C#: How to drag a from by the form and its controls?

I use the following code to drag a borderless form, by clicking and dragging the form itself. It works, but it doesn't for when you click and drag a control located on the form. I need to be able to drag it when clicked on some of the controls but…
flamey
  • 2,311
  • 4
  • 33
  • 40
7
votes
3 answers

How to draw custom button in Window Titlebar with Windows Forms?

How do you draw a custom button next to the minimize, maximize and close buttons within the Titlebar of the Form? I know you need to use Win32 API calls and override the WndProc procedure, but I haven't been able to figure out a solution that works…
Chris Pietschmann
  • 29,502
  • 35
  • 121
  • 166
7
votes
1 answer

Sending/Receiving a string through PostMessage

Although there are already a few resources online that address this rough topic, I still haven't found an answer that works for me. I desire to have full communication between my VB.net process and my C++ process. I would like to be able to send a…
Spooky
  • 2,966
  • 8
  • 27
  • 41
6
votes
5 answers

C# Form Move Stopped Event

Is there any event in C# that fires when the form STOPS being moved. Not while its moving. If there is no event for it, is there a way of doing it with WndProc?
Ozzy
  • 10,285
  • 26
  • 94
  • 138
6
votes
5 answers

sending lparam as a pointer to class, and use it in WndProc()

i have this abstract code : i want to use lParam (last parameter) in CreateWindowEx() to save a pointer to a class thats declared in the begining of main - SaveArr. then, i want to use it in the function WndProc. in the begining i did a global…
dusm
  • 1,207
  • 4
  • 18
  • 24
6
votes
3 answers

WndProc: How to get window messages when form is minimized

To communicate with a certain service, I have to override the WindProc. and receive window messages. However, when the form is minimized, I get no longer any message. I know that it has to be like that, but is there a workaround for this? I don't…
lenniep
  • 679
  • 4
  • 11
  • 27
6
votes
3 answers

Resize Event for Console

So I thought the window resize event would come through winproc, I might be mistaken, looking to get notified for a Console resize event. I want to maximize the console buffer on resize, and once it's finished essentially shrink it back down to the…
David Torrey
  • 1,335
  • 3
  • 20
  • 43
6
votes
2 answers

Specifying a Window Procedure for child Windows

I would like to know if its possible to specify a WndProc for a Child Window created by CreateWindowEx. I have created a Window Class, the Main Window, the Window Procedure and a Message Loop already. The code works and I decided to keep it out for…
Vinz
  • 3,030
  • 4
  • 31
  • 52
6
votes
1 answer

WndProc message = 49619 -what is it?

I'm debugging a dragging bug in wpf and have subscribed to wndproc. I'm getting a message ID of 49619 with wparam=0 and lparam=0. I've exhausted my google efforts and have been unable to uncover what the name of this window message is. If you…
Bill Tarbell
  • 4,933
  • 2
  • 32
  • 52
6
votes
1 answer

Handling WM_NCACTIVATE in startup window blocks all other windows

I am trying to keep one particular WPF window in focus, meaning that it should not change the window style when losing focus (e.g. like the standard Windows Taskbar). To achieve this, I hook into the WndProc to check whether the WM_NCACTIVATE or…
dsfgsho
  • 2,731
  • 2
  • 22
  • 39
1
2
3
23 24