wndproc

C#: How to drag a from by the form and it's controls?

I use following code to drag 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 not others - drag by labels, but don't by buttons and text boxes. How do I do it? protected overr...

WM_SIZE with loword==hiword==-1 ?

Just tried some small graphics application of mine on Windows 7, and I'm getting a WM_SIZE event with loword==hiword== -1 -- can this be safely ignored, or does it have some special meaning? I never saw such sizes on XP/Vista, only with Windows 7. The docs don't tell much about what hiword/loword can be, so I wonder if -1 has some specia...

How do I send/receive windows messages between VB6 and c#?

I know I can receive messages with the code below in c#, how do I send to vb6, and receive in vb6, and send from vb6? [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")] protected override void WndProc(ref Message m) { int _iWParam = (int)m.WParam; ...

WIN32 keyboard question - not recognizing windows mobile keys

HI I'm developing in the WIN32 environment, for windows mobile, and experiencing a few problems - I have keys that have both numbers and letters, but no matter if i press the 'function' key i always get the numbers my program does not recognize * and # clicks. Debugging it, i got to the WndProc method, which was registered in the MyReg...

Win32 , WndProc, and parent-child windows

Hi - 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 WND_Proc function called once, instead of twice for each of the windows. What am i d...

CreateWindow Win32 API problem - Only parent window gets

Hi. 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 message loop, But unfortunately only the parent WndProc gets message, while the child ...

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

Hello, I'm developing for Windows Mobile in C++, and i'm running into a problem - I added my window class, and in it i handle the keyboard input with my WndProc implementation. The problem is that i'm getting the wrong codes, and identifying keys such as the func key incorrectly. And to make it worse, the values i'm getting (the wParam o...

Transferring Win32 API WndProc Key messages from one window to the other OR keyboard problem with Windows Mobile Win32 API

Hi - I'm posting this question again - as i got some potentially useful comments on my question, but unfortunately when i replied to the comments i got no answers. It seems that unless i post the question again, no one will look at it. Sorry if this is against StackOverFlow moral code - If it is - Then what is the way to resurface a ques...

Taskbar left click minimize the borderless winde.

Hi, I want to know is there any WNDProc message which the form can handle left click or double click on the taskbar inorder to set windows state minimized. Thanks, Raj ...

Finding WndProc Address

How can I find the address of a WndProc (of a window of another process). Even if I inject a DLL and try to find it with either GetClassInfoEx() or GetWindowLong() or GetWindowLongPtr() I always get values like 0xffff08ed, which is definitely not an executable address. It is according to MSDN: "... the address of the window procedure, or...

How to receive the Windows messages without a windows form

I am trying to write a class library that can catch the windows messages to notify me if a device has been attached or removed. Normally, in a windows forms app I would just override the WndProc method but there is not WndProc method in this case. Is there another way I can get the messages? ...

If I send a WM_KEYDOWN message (using wndproc) will the computer hold the key down until I send WM_KEYUP?

I am looking for a solution to programmatically hold a keyboard key down during some time (I don't know how many time). I think that if I send a WM_KEYDOWN message the key will be held down until WM_KEYUP is send, but I am not sure. I would test it. But I need to go and I don't have much time. I want to see if someone already tested th...

I want to make a virtual keyboard. Do I need to send WM_KEYDOWN to the current active window or HWND_BROADCAST?

I am making an app that simulates a keyboard. I will do it by sending WM_KEYDOWN to a window, but I am not sure where to send the message. to the currently active window or to HWND_BROADCAST? Here is an other question I posted, related to this one. http://stackoverflow.com/questions/2089968/if-i-send-a-wmkeydown-message-using-wndproc-wi...

Intercepting Dialog Window Activate message by Owner Window

Hi, we are using c# NativeWindow and overriding WndProc method to intercept the widow messages. Is it possible for a owner window(NativeWindow) to know when its child window(dialog window) gets activated when user presses alt+tab or click on the window in task ...

Delphi - WndProc() in thread never called

I had code that worked fine when running in the context of the main VCL thread. This code allocated it's own WndProc() in order to handle SendMessage() calls. I am now trying to move it to a background thread because I am concerned that the SendMessage() traffic is affecting the main VCL thread adversely. So I created a worker thread ...

Why doesn't SAPI's ISpNotifySource::SetNotifyWindowMessage() send the notification to my WndProc()?

I'm using WinForms, and I'm trying to get SetNotifyWindowMessage() to send a message to the WndProc, but it does not do so. The function call: HRESULT initSAPI(HWND hWnd) { ... if(FAILED( g_cpRecoCtxt->SetNotifyWindowMessage( hWnd, WM_RECOEVENT, 0, 0 ))) MessageBoxW(hWnd, L"Error sending window message", L"SAPI Initialization E...

Execution difference between "App.exe" and "App.vshost.exe" with WndProc

I am attempting to adapt an application developed in VS 2008/C# that listens to another application's WM_ messages through the use of the Control.WndProc method. When the "app.exe" version is run, WM_USER messages are visible and processed; however when the "app.vshost.exe" version is run, these same messages are no longer visible to th...

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 WndProc(ByRef m As System.Windows.Forms.Message) MyBase.WndProc((m)) End Sub and ...

Sample source code for processing messages of a window created by an external program?

I know I have to use SetWindowLongPtr with GWLP_WNDPROC and create my own WndProc that handles the message I want (such as WM_GETMINMAXINFO and modify the MINMAXINFO structure). However, because I want to do this for a window created by another program (like notepad.exe), I can't do this from my C#/WinForms program, I have to create a n...

Does the Message to WndProc change value from 32Bit OS to 64Bit OS?

When the following Method is overrided in .NET it seems that I get different Messages in 32Bit and 64Bit OS:es. Can this be true? protected override void WndProc(ref Message m) I want to catch the following: private const int WM_LBUTTONDBLCLK = 0x0203; but WM_LBUTTONBLCLK seem to have another "Id" in my windows 2003 64 bit installation...