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.

325 questions
0
votes
0 answers

How to detect when a device has been connected/disconnected?

I have tried the following: Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) Const WM_DEVICECHANGE As Integer = &H219 Const DBT_DEVICEARRIVAL As Integer = &H8000 If m.Msg = WM_DEVICECHANGE Then If…
thehoten
  • 113
  • 1
  • 9
0
votes
0 answers

Windows USB Plugged In message code

What is windows "USB plugged in" message code? I mean that, for example 513 is mouse left click (WM_LBUTTONDOWN) code.
0
votes
1 answer

WndProc() is not getting the messages I sent to it

I made a project that creates a DLL. This project uses the WFS methods and they access some hardware (devices) to get information or execute some commands. In my project, I first open these devices then register them, I later use other methods to…
M.H.
  • 633
  • 2
  • 8
  • 20
0
votes
0 answers

Can not receive Message from application running under another account

I'm trying to communicate between applications running under different user accounts. This is what I'm trying to accomplish: http://imageshack.com/scaled/large/692/p3vc.png However, this isn't working using SendMessage. Why is this? What can I do…
Mlsoun
  • 9
  • 5
0
votes
2 answers

Processing windows messages, threading COM objects

I have an application that captures Windows messages sent to the Form, and runs a method if an update is made to the system Clipboard: protected override void WndProc(ref Message m) { switch (m.Msg) { case WM_CLIPBOARDUPDATE: …
B L
  • 1,472
  • 1
  • 14
  • 25
0
votes
3 answers

How to correctly handle Windows messages from an MSFTEDIT_CLASS (RichEdit) control?

UPDATE: As requested I have added all of the code I am using to create the Window and its RichEdit control. I'm trying to handle windows messages for a RichEdit control used as a child of another window. Now I did have the RichEdit control working…
Interminable
  • 1,268
  • 3
  • 18
  • 41
0
votes
0 answers

Override The WindowProc Of A Different Process?

Simply: I want to evaluate messages that are send to a window by WinApi. This window is not part of my application. So when messages are send to the window of let's say notepad I want to read them and forward them to the actual window proc of the…
Bitterblue
  • 9,526
  • 12
  • 71
  • 114
0
votes
1 answer

WndProc, Marshal.DestroyStructure & preventing memory leaks

Just a general question, take the following code from a WindowsForms application: using System.Runtime.InteropServices; protected override void WndProc(ref Message m) { if (m.Msg == 0x216) // WM_MOVING = 0x216 { Rectangle rect =…
Tsef
  • 998
  • 8
  • 22
0
votes
3 answers

CreateWindow() [Win32 API] : Only parent window gets

I asked a question, and some people commented that my question wasn't clear, So here is a new one. I'm trying to create an application with multiple windows using the WIN32 API. I created two windows, one is a child of the parent. Then i have a…
dan
  • 61
  • 1
  • 7
0
votes
1 answer

Win32 , WndProc, and parent-child windows

I'm developing in C code that uses the Win32 Api to create multiple windows. I used createWindow twice - to create parent and child windows. I have a message loop while ( GetMssage (&msg, NULL,0,0)){ . translate dispatch . } But I only get the…
dan
  • 61
  • 1
  • 7
0
votes
1 answer

How to prevent system mouse cursor movement in a C++ applicatioin with custom cursor?

I am writing an OpenGL/DX application in which I read WM_INPUT messages in WndProc() to move a custom mouse cursor. The system mouse cursor is hidden via ShowCursor(false) when it is over/in the application's window. The problem is that the system…
Matthias
  • 8,321
  • 8
  • 45
  • 97
0
votes
0 answers

VB.NET / Get WndProc of a window?

I'm trying to get the WNDPROC from a open Windows Explorer window. I can successfully get the handle of the window, but "GetWindowLongPtr" returns always "0". I'm declaring the entry: _ …
Meyer
  • 1
0
votes
1 answer

Adding a button to form prevents WM_KEYDOWN messages from being sent

The following code works and will print to Label1 when the user presses the a key on the keyboard: Public Class Form1 Sub New() InitializeComponent() End Sub Public Declare Function PostMessage Lib "user32.dll" Alias "PostMessageA" (ByVal…
0
votes
1 answer

Redraw checkbox

I was wondering is it possible to draw a checkBox with custom colors for text and tick? I heard it was possible by overriding WndProc and using WM_PAINT, but I have no experience doing that. Can someone please point me in the right direction?
p0enkie
  • 487
  • 2
  • 8
  • 18
0
votes
1 answer

Win32 ListBox WNDPROC never called

I am writing a fairly simple wrapper around Win32 controls/dialogs/windows. The issue I have is that ListBox's and ComboBox's seem to behave rather differently. In the base Widget class that I am inheriting from, I override the existing WNDPROC…
Gary McLean Hall
  • 854
  • 6
  • 14