Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > API > HowTo access object properties from the hWnd


Reply
 
Thread Tools Display Modes
  #1  
Old 09-23-2003, 11:03 AM
Goofy's Avatar
Goofy Goofy is offline
Centurion
 
Join Date: Jun 2002
Location: Montréal, Canada
Posts: 168
Default HowTo access object properties from the hWnd


Greetings all!

OK, here's the thing: I have the hWnd of a listView, and from this hWnd I want to be able to use the listView properties (height, top...).

Is this possible?

Thank you and have a nice day!
Reply With Quote
  #2  
Old 09-23-2003, 11:11 AM
OnErr0r's Avatar
OnErr0r OnErr0r is offline
Obsessive OPtimizer

Administrator
* Guru *
 
Join Date: Jun 2002
Location: Debug Window
Posts: 13,734
Default

Reply With Quote
  #3  
Old 09-23-2003, 11:16 AM
Goofy's Avatar
Goofy Goofy is offline
Centurion
 
Join Date: Jun 2002
Location: Montréal, Canada
Posts: 168
Default

Yhea, that works fine if I only want to get top height or stuff like that, but what if I want to get use the "SortOrder" properties, or any other properties?

Reply With Quote
  #4  
Old 09-23-2003, 12:32 PM
samr samr is offline
Senior Contributor
 
Join Date: Jul 2003
Location: London, England
Posts: 993
Default

You'll have to either use SetWindowText, SetWindowLong or SendMessage, though I doubt that you'll manage to find all of the parameters that you'll need to do this (I don't know them)
Reply With Quote
  #5  
Old 09-23-2003, 12:40 PM
Thinker Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default

Accessing the properties of an object means you need to have a
reference to the object. The hWnd is a property of the object, not the
other way around. So getting an object reference with the hWnd isn't
going to happen. But if this is all happening in the same process, there
is probably an easier way to get an object reference. What are you
really trying to do?
__________________
Posting Guidelines
Reply With Quote
  #6  
Old 09-24-2003, 08:29 AM
Goofy's Avatar
Goofy Goofy is offline
Centurion
 
Join Date: Jun 2002
Location: Montréal, Canada
Posts: 168
Default

Ok, thanks for this precision.

I was just wondering because lots of time I have functions that have a hWnd parameter (most API needs the hWnd...), so I was just curious if it was possible to access the object other properties without passing the object as a parameter.

Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing entire objects to a file? MoNoXBooGIE General 14 04-20-2004 08:21 PM
Enumerating object properties derekhos General 2 09-04-2003 01:08 PM
File System Object (Code for the masses) Aquila General 2 07-25-2003 11:10 AM
Access container's BackColor and Picture properties _Mark_ General 0 04-05-2003 06:18 PM
HowTo: Fetch backwards w/ Access Command object ddavison Database and Reporting 2 01-31-2001 09:08 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->