Re: SendMessage and Handles



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


.



Relevant Pages

  • Re: Usenet Dying? [Re: Alt Gr key]
    ... And I have seen lots of things deleted and changed by those who are in control. ... I found this out by searching for information and I found a lot of my posts on Usenet in these forums. ... And since they got rid of Steve, you don't need AOL software anymore. ...
    (comp.sys.laptops)
  • Re: Multiple relationships with one task (newbie)
    ... we have to have regulatory control approval ... For Imaging task, we must have regulatory approvals (2 ... "Steve House" wrote: ...
    (microsoft.public.project)
  • Re: Is there any way to start (and later quit) an EXE file.
    ... Fantastic Steve. ... regain complete control of XP and lose barcode scanner control. ... You can use the Shell function to launch an executable file but you don't ...
    (microsoft.public.excel.misc)
  • RE: looking up value in combo box
    ... Private Sub Primary_AfterUpdate ... Steve S ... There is a control named "Primary" ... PrimaryID, long ...
    (microsoft.public.access.formscoding)
  • RE: Access Database Reports
    ... Sorry I could not get back to you yesterday, Steve. ... If it is asking for a parmeter, then it can't find the control on the form. ... Dave Hargis, Microsoft Access MVP ... I don't know how you are opening your report, but I will assume you are ...
    (microsoft.public.access.reports)