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
1 answer

Strange WndProc bug in .Net. VB.Net more specifically

ETA: I use visual studio 2008 express edition. If I override WndProc and mess up somehow, I'll usually backtrack by commenting out code until it works again. The strange thing with WndProc though is you can strip it down to: Protected Overrides Sub…
Jules
  • 4,319
  • 3
  • 44
  • 72
2
votes
1 answer

How to create a borderless form with System menu?

I have created a border less form, I managed to assign the system menu to it using: protected override CreateParams CreateParams { get { CreateParams param = base.CreateParams; param.Style |=…
Valentin Radu
  • 629
  • 1
  • 11
  • 26
2
votes
2 answers

not receiving WM_WTSSESSION_CHANGE in windows 7 64bit

I have been writting a DLL, and tried to get notification about locking the screen by user. I found that WM_WTSSESSION_CHANGE will be suitable for my needs, but I cannot read this message in my library, moreover when I have spied the app with the…
2
votes
2 answers

Difference between WindowProc and CallWindowProc?

What is the difference between WindowProc and CallWindowProc ? I can imagine when registering a new window class I can specify my own WindowProc for it. This leaves the question: When and what for do I use CallWindowProc ?
Bitterblue
  • 13,162
  • 17
  • 86
  • 124
2
votes
1 answer

Win32 Subclassing - About Messages

So I'm practicing subclassing a predefined window class in Win32 so I can define my own custom message proc for the predefined classes (e.g. making a custom WndProc for a button class) and I got it to work for the most part but I can't get the…
user3010974
  • 61
  • 1
  • 6
2
votes
1 answer

NativeWindow equivalent

In c#, I can "hijack" the WndProc of a window within the same process as the executing code, using the NativeWindow class, giving me the capability to override certain messages and let others pass. Here is an example: protected override void…
Rotem
  • 21,452
  • 6
  • 62
  • 109
2
votes
0 answers

How to globally detect active window change in vb.net?

Goal: To make use of windows events/hooks to immediately detect Windows foreground window changing (focus change) WITHOUT using a timer. This is for a global macros program, where I want specific keystrokes/mousebutton clicks to register events only…
NotJehov
  • 43
  • 7
2
votes
1 answer

Is there a .NET namespace where I can find the WIN32 API message-related #defines, like WM_COMMAND, etc

I'm overriding WndProc, so I want to write code like if (m.Msg == WM_COMMAND) my special stuff else base.WndProc(ref m)
Corey Trager
  • 22,649
  • 18
  • 83
  • 121
2
votes
1 answer

How to return a value in WndProc for C#?

In my application, I hid the cursor using SetCursor(NULL) and to make sure that Windows does not reset the cursor state, I handled WM_SETCURSOR in my WndProc method. However in the msdn documentation for C++, in order to handle WM_SETCURSOR I have…
godly-devotion
  • 177
  • 3
  • 15
2
votes
1 answer

Receive double value in WndProc from legacy

I'm trying to send double/float values from my MFC legacy code to WPF window. WPF WndProc procedure receives the arugments in LParam and WParam as ints (truncates the decimal values). private IntPtr WndProc(IntPtr hWnd, int msg, IntPtr wParam,…
WAQ
  • 2,556
  • 6
  • 45
  • 86
2
votes
3 answers

Transferring Win32 API WndProc Key messages from one window to the other

I'm developing for Windows Mobile in C++, and I'm running into a problem - I added my window class, and in it I the keyboard input with my WndProc implementation. The problem is that I'm getting the wrong codes, and identifying keys such as the func…
dan
  • 61
  • 2
  • 7
2
votes
1 answer

Default drawing for WM_PAINT in a memory DC

I want to treat WM_PAINT message. But at first, I want to let system to do the default drawing, then I draw something else manually. For example: case WM_PAINT: CallWindowProc(DefWndProcTabControl, hwnd, message, wParam, lParam); …
user565739
  • 1,302
  • 4
  • 23
  • 46
2
votes
2 answers

Use of WndProc for my C#.net app

I would like to know, if I use WndProc in my C#.net app to handle minimize event in my form, will there be any problem if my app will be installed in different version of windows or other platform? like xp, 2k3 and so on?
Jepe d Hepe
  • 899
  • 5
  • 22
  • 42
2
votes
1 answer

keyboard event works only once

I am trying to make simple key remapper - when one keyboard key pressed, another different key press generated by code. Here is my code: [DllImport("user32.dll")] static extern uint keybd_event(byte bVk, byte bScan, int dwFlags, int…
csharp newbie
  • 647
  • 1
  • 12
  • 31
2
votes
1 answer

SendMessage with an int as a parameter for lParam or wParam?

Say that I want to send a message to my WndProc, but I want to also send an integer. SendMessage (m_hWnd, WM_DISPLAYCHANGE, NULL, int?); My WndProc will receive it right? Then I want to send that lParam(integer) to a function. case…
Mickael Bergeron Néron
  • 1,472
  • 1
  • 18
  • 31