How to get the items in the view before window is created?

i have some item in the list before starting the application.where i need to write the code to get the items in the list just after creation.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi srikadi,

please explain you problem more detailed: What kind of view/items/list? Where/what are they before the application starts?

srikadiAuthor Commented:
i have CListView,CformView.if CListView contain any task  i need to enable one button in CFromView.
first iam disabling the button after that i am checking getItemcount of Clistview.if getItemcount>1 iam enabling..its working fine if the list doesnot contain any tasks in Listview before creation of the application.
but i want to test before creation of the application.if it contains ant task then it should enable ie on creation time..
iam very poor in english..sorry if i did any mistakes.
Hm - I still don't really understand this: '... in Listview before creation of the application' - how can there be items (tasks?) in the listview before the application runs?
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

srikadiAuthor Commented:
sometime i directly close the when i open the application the nexttime the listview contains the previous i want to enable button if the list contain items.
I still don't see the problem. When you start the application there can't be items in the list, the list has to be filled by the application. There must be some code in the application which adds and removes items to the list - that's where you can enable/disable the button.
srikadiAuthor Commented:
sorry if i can't expalin properly..
1)my list has some items..
2) i closed the application with out deleting the items in the list.
3)next tiem when i opened the list contain same item which were there before.
now initially i disbled the button in OnInitialUpdate() funtion..after that i am rading getcount()..if it contains items then i am enabling the button..
but i want..
to check just after appearing of the window..where i need to write the code..
Ok, so you don't 'close' and 'start' the application, you 'minimize' it and 'restore' it, right?

Then I still would suggest to enable/disable the button in the code where the list items are added/deleted. Another possibility would be to implement a WM_ACTIVATE message handler. In there you can (in case of activation) count the number of items and enable/disable the button.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.