How would I manipulate a Form's properties, such as .Left, .Height, etc.. through the API using the hWnd of that form?
Printable View
How would I manipulate a Form's properties, such as .Left, .Height, etc.. through the API using the hWnd of that form?
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.
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.