Re: SendMessage and Handles
- From: "Steve Barnett" <noname@xxxxxxxxxxxx>
- Date: Wed, 26 Oct 2005 16:25:50 +0100
Much appreciated guys.
Steve
"Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:O%23%23xY2j2FHA.3244@xxxxxxxxxxxxxxxxxxxxxxx
> Steve,
>
> See inline:
>
>> a) Call the SendMessage API,
>
> Check out http://www.pinvoke.net. It will have the declaration of
> SendMessage. You might have to tweak it for your specific message. In
> the case of SetScrollPos, you will want to use this:
>
> [DllImport("user32.dll", CharSet = CharSet.Auto, EntryPoint =
> "SendMessage", ExactSpelling = false)]
> static extern int SendEmSetScrollPosMessage(
> IntPtr hWnd,
> [MarshalAs(UnmanagedType.U4)]
> int Msg,
> IntPtr wParam,
> ref System.Drawing.Point lParam);
>
>> b) Code a "POINT" structure in C# for use in the call, or
>
> You can use System.Drawing.Point. It will marshal correctly.
>
>> c) Find the windows handle of the Rich Text box.
>
> The RichTextBox control exposes a Handle property which you can use to
> get the handle. Actually, the Control class exposes it, so all controls
> expose their handle.
>
> Hope this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
>
>>
>> All of which means that I have a very long way to go to achieve a very
>> simple function. Can anyone please point me at some code that does this
>> please? Better still, can I achieve this in native C# code?
>>
>> Thanks
>> Steve
>>
>
>
.
- Prev by Date: How do I add a record to an MS Access database
- Next by Date: Show image in DataGrid cell
- Previous by thread: How do I add a record to an MS Access database
- Next by thread: Show image in DataGrid cell
- Index(es):
Relevant Pages
|