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
2
votes
2 answers

HWND address changes when used for a parameter from inside its windproc

I was trying to make a function createscalingwindow that calls CreateWindowEx and writes the address's of the HWND used in CreateWindowEx to a vector, followed by it's initial size and position values. Another function I made called scalewindowsize…
user1934608
  • 405
  • 1
  • 4
  • 9
2
votes
1 answer

.NET Winforms Vertical Progress Bar Text

Recently, I needed a vertical progress bar for my win forms application. The derived class is like below. I also need to add text on progress bar. A label on it doesn't work beacuse of transperancy issues. After some research, I have found…
Deniz Alpaslan
  • 167
  • 2
  • 16
2
votes
2 answers

Capturing WndProc message of a certain button click

I have a cancel button on my form. I want to determine inside the WndProc method that this Cancel button is clicked and write some code for it. This is absolutely necessary because otherwise I'm not able to cancel all other control validation events…
Soham Dasgupta
  • 5,061
  • 24
  • 79
  • 125
2
votes
2 answers

Replace WndProc with JNA fails with Exception

I try to catch Windows Messages in a Java program using JNA to inject my own WndProc method. As I'll only be interested in a few message types, I'll have to forward the messages to the previous WndProc. In my test (Java 1.7.0_03, 64-bit, on Windows…
cello
  • 5,356
  • 3
  • 23
  • 28
1
vote
1 answer

Handling WM_ events in a windowless C# process

I've been looking around for quite a while, and can't seem to find a good way to do this. Basically I have a C# process using WPF (which has no visible window), that I need to handle WM_ events in (such as WM_CLOSE or WM_DESTROY for example; so that…
user1250991
  • 97
  • 2
  • 12
1
vote
1 answer

Drag-able WinForm Problem

I have a windows form that can be moved around by clicking and dragging on any portion of the form. I used the method of overriding WndProc, and setting the result of the NCHITTEST function to be HTCAPTION, in order to fool the form into thinking I…
Matt
1
vote
2 answers

What is WndProc message 24

I am currently trying to make an existing VB.NET Project run. A null pointer exception is thrown in the WndProc message but the stack trace does not really give me anything. I can place a break point in the startup form's designer code but when I…
Nap
  • 8,096
  • 13
  • 74
  • 117
1
vote
1 answer

Framerate of WM_PAINT

Could anybody tell me please how can I get framerate of WM_PAINT message in frames per second? I'm trying to make a software renderer, and framerate is very important for debugging.
Triang3l
  • 1,230
  • 9
  • 29
1
vote
1 answer

Way of getting control handle from TMessage

Is there anyway to get the control handle or other information with i can indentify a control having only TMessage variable? Question is Delphi related. the thing im doing is that im hooking several controls wndproc with one function and i need to …
Knobik
  • 383
  • 8
  • 26
1
vote
1 answer

How to check when the control is fully initialized?

How can I check if the control is fully initialized ? Consider the following code (I know it's very bad practice to do this, please take it as an example) type TForm1 = class(TForm) Memo1: TMemo; private procedure WndProc(var Message:…
Martin Reiner
  • 2,167
  • 2
  • 20
  • 34
1
vote
1 answer

Trying to understand what's really happening in a C# WinForms WndProc method when handling hotkey messages

I have been working on a C# WinForms application that registers several hot keys using the well-discussed GlobalAddAtom and RegisterHotKey PInvoke methods. The program starts in minimized mode and runs in the system tray. Each time one of the hot…
EricTheRed
  • 289
  • 5
  • 14
1
vote
2 answers

C# p/invoke to RegisterHotKey for the key combo ALT+TAB not working (returns 0)

I'm using the following code to intercept the ALT+TAB key sequence in my c# application. Some relevant snippets: [DllImport("user32.dll")] private static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vk); and bool ret =…
Richie Li
  • 1,257
  • 2
  • 13
  • 20
1
vote
2 answers

Handling Right Click/Left Click of Task-bar Button in c#

I have a form (having Taskbar button shown in Taskbar) and I want to handle left/right clicks of this Task-bar button. I searched everywhere but could find the right answer. There are some related queries posted in stack-overflow as well: Using…
bayCoder
  • 1,345
  • 1
  • 11
  • 19
1
vote
0 answers

Ram keeps increasing when calling WndProc

i'm making a small c# form app and i copied a piece of code that let me resize a borderless form from the bottom right of the form: protected override void WndProc(ref Message m) { if (m.Msg == 0x84) { …
Steve
  • 47
  • 6
1
vote
0 answers

Windows 11 Snap Layout over a button in WinForm

Is it possible to show Windows 11 Snap Layout over a button in WinForm? I can show it over any window edge, using WM_NCHITTEST message, but I don't know how to show the Snap Layout dialog over a button in the form Kind regards
Track
  • 109
  • 1
  • 4