Results 1 to 3 of 3

Thread: Manipulate form properties through API?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091

    Manipulate form properties through API?

    How would I manipulate a Form's properties, such as .Left, .Height, etc.. through the API using the hWnd of that form?

    Visual Studio 2010

  2. #2
    jim mcnamara
    Guest
    You can only change the properties of a form (window) from within the app that owns the window. No api's do it, it's done only thru the COM interface the object exposes - ie., .Left, etc. - in the app.

    You can get any window to respond as if it were clicked or had keypresses using the SendMessage api. SendMessage doesn't change form properties. You can do a resize, move, etc. which will give you something of what you want. This is DIFFERENT from accessing properties in the COM interface.

    goto www.msdn.microsoft.com and look up 'windows messages'
    it's a vast subject.

    You can use SetWindowLong from a C++ dll to change things in an external window like border style, and a lot of related items.
    But not internal VB properties.

  3. #3
    Megatron
    Guest
    You can change properties via SendMessage (as Jim mentioned) or by SendWindowLong. If it's an external window, then using SendMessage would be a better approach. If you're dealing with internal windows, then use SetWindowLong.

    Of course, there are some things that you can do with one, but you can't do with the other.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width