sendmessage

Can SendMessage return early if the receiving thread starts pumping messages?

How precisely does windows decide that SendMessage should return- that is, how does it decide the receiving thread has finished processing the sent message? Detailed scenario: I've got thread A using SendMessage to send a thread to thread B. Obviously SendMessage doesn't return until thread B finishes processing the message. Thread B ...

RichTextBox: How to determine if text extends beyond the control bounds? - Horizontal Scrollbar appearing when it shouldn't after sending EM_SETTARGETDEVICE and then resizing the control

I have extended the RichTextBox control to implement much of the missing functionality provided in the native RichEdit class. I'm running into an issue where if the control is set to wrap to the window or to wrap to printer the horizontal scrollbar appears even though it shouldn't when the control is resized. Cycling the wordwrap to ...

RichEdit / RichTextBox scollbar length, grab handle width, enabled/disabled, etc... How is all this controlled?

I have another question open regarding an error I'm experiencing with the horizontal scrollbar of a RichTextBox not functioning properly and am not getting much response. It came to me that I might be asking the wrong question. My new question is how do the scrollbar properties get set/controlled. I know I can SendMessage to change the...

Problem with SendMessage

Hello friends, I am developing an application using C# having similar functionality of copy,paste as in Windows. I have added menu items and linked with respective applications. Please look at the following image for getting more idea. Like we select multiple items in windows explorer, you need to select multiple files and/or folde...

Drag Drop using SendMessage

hi guys, This sounds funny..just a little experiment. i wanted to simulate a drag drop of a file on a Application/Window using Send Message. Is it possible? I dont have code for the application but on the executable. The application is IP Messenger. What i wanted to do is use "Send To" functionality to send the file to an .exe ,which ...

How to simulate mousemove event from one window to another?

Hello, I am trying to Create an empty window, which process the WM_MOUSEMOVE message in WinProc: case WM_MOUSEMOVE: { HWND otherHwnd = HWND(0x000608FC); POINT pt = {LOWORD(lParam), HIWORD(lParam)}; ClientToScreen(otherHwnd, &pt); PostMessage(otherHwnd, WM_TIMER, WPARAM(4096), 0); PostMessage(...

SendMessage to .NET Console application

I have been experimenting with Sending Messages from 2 .NET Winform applications using WM_COPYDATA .. works great. What I would like to know is if that can be accomplished with Console applications. After all the SendMessage function takes in a window handle, so how can I get the window handle of a console application ? [DllImport("Us...

RichTextBox Scroll Sync and 16-bit Limit

I am synchronizing the vertical scroll events of two RichTextBox controls using the EM_SETSCROLLPOS/EM_GETSCROLLPOS method. While things seem to be working well for short text files, I am hitting the 16-bit limit with long text files. Specifically, when I have text over 65,535 pixel lines, the message handler appears to be scaling the sc...

vb6: set SysTabControl32 by code

hi, i'm coding a little app for controlling soulseek - what i want do is clicking the "Search Files" button by code. i've got the handle to the tabbed control (SysTabControl32) and managed to change the tab with following code: rc1 = SendMessage(hwnd, TCM_SETCURFOCUS, ByVal 0, ByVal 0&) the problem: the tab control is changing t...

in c, how to change text on ThunderRT6UserControlDC btn

I get a handle to ThunderRT6UserControlDC button which in terms has two children of type ThunderRT6Timer (though I am not sure what these timers are for) The ThunderRT6UserControlDC window looks like a button but has no caption set (verified via spy++). When sending SetWindowText from within the same process, the caption changes (verif...

Use SendMessage in C# to perform a CTRL-C operation on a given handle

Hello everyone, In Google Chrome you can retrieve the text of a JavaScript alert/dialog by simply having the dialog open and doing CTRL-C on the dialog. This will put the text in the dialog into the clipboard. I'm trying to use SendMessage to send CTRL-C to perform a copy on the text of a JavaScript dialog. I've already managed to do t...

Send Email in .Net 3.5

I need to send a basic email from my site when someone registers for my site. Is their an easy way? or a site to reference? ...

C# SendMessage to C++ WinProc

I need to send a string from C# to a C++ WindowProc. There are a number of related questions on SO related to this, but none of the answers have worked for me. Here's the situation: PInvoke: [DllImport("user32", CharSet = CharSet.Auto)] public extern static int SendMessage(IntPtr hWnd, uint wMsg, IntPtr wParam, string lParam); C#: stri...

Parts of statusbar disappearing with IE BHO

I have a C# IE BHO in use for an internal company app that is adds a pane to the statusbar with SB_SETPARTS (it mitm's the SETPARTS call and inserts an element into the array) and then draws the controls by moving them from a hidden (in-process) form with SetParent() This technique works well but it causes other parts of the statusbar t...

Capture Highlighted Text from any window using C#

How to read the highlighted/Selected Text from any window using c#. i tried 2 approaches. Send "^c" whenever user selects some thing. But in this case my clipboard is flooded with lots of unnecessary data. Sometime it copied passwords also. so i switched my approach to 2nd method, send message method. see this sample code [DllImp...

Can I get a bitmap of an arbitrary window in another application process?

I am trying to automate a third-party Win32 application where I want to capture the graphics content of a particular window at defined time intervals. I am in the early phases of this, and I'm currently trying to use the Microsoft UI Automation API via C# to do most of the interaction between my client app and the external app. I can n...

Window screenshot using WinAPI

How to make a screenshot of program window using WinAPI & C#? I sending WM_PAINT (0x000F) message to window, which I want to screenshot, wParam = HDChandle, but no screenshot in my picturebox. If I send a WM_CLOSE message, all waorking (target window closes). What I do wrong with WM_PAINT? May be HDC is not PictureBox (WinForms) compone...

PostMessage does not seem to be working.

I am trying to use PostMessage to send a tab key. Here is my code: // This class allows us to send a tab key when the the enter key // is pressed for the mooseworks mask control. public class MaskKeyControl : MaskedEdit { // [DllImport("coredll.dll", SetLastError = true, CharSet = CharSet.Auto)] // static extern IntPtr SendMessag...

JMS MessageCreator.createMessage() in Grails

Hi there, I am trying to implement jms to my grails application. I have several JMS consumer in a spring based enviroment listining on an ActiveMQ broker. I wrote a simple test commandline client which creates messages and receives them in an request response manner. Here is the snippet that sends a MapMessage in Spring JMS way. This...

SendMessage videocapture consts

Hello, I am using a code sample to connect to a webcam, and don't really understand the meaning of the variables passed to the SendMessage method. SendMessage(DeviceHandle, WM_CAP_SET_SCALE, -1, 0) SendMessage(DeviceHandle, WM_CAP_SET_PREVIEW, -1, 0) What does the -1 mean? To scale/preview or not to scale/preview? I'd prefer that zer...