|
-
Dec 18th, 2001, 05:05 PM
#1
Thread Starter
Frenzied Member
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?
-
Dec 18th, 2001, 05:20 PM
#2
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.
-
Dec 18th, 2001, 05:48 PM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|