The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Force on February 19, 2012, 11:20:46 PM

Title: Calling Listview From Menu
Post by: Force on February 19, 2012, 11:20:46 PM
Is it possible calling Listview from menu or by clicking button  in a new window?
Title: Re: Calling Listview From Menu
Post by: dedndave on February 20, 2012, 12:47:06 AM
if you mean having the listview in the menu - not sure about that
but, you can always open a dialog with a listview in it

you may enjoy this demo by Chib777 with source, though...
http://www.4shared.com/file/m1BJWoRF/XXControls.html
shows you how to do owner-drawn menus and controls
Title: Re: Calling Listview From Menu
Post by: Gunner on February 20, 2012, 12:53:11 AM
Of course you can call it, it's phone number is 212-555-2368  :toothy

You can send messages to the listview to do many things to/with it http://msdn.microsoft.com/en-us/library/windows/desktop/bb774737(v=vs.85).aspx
Title: Re: Calling Listview From Menu
Post by: Force on February 20, 2012, 01:03:28 AM
I will make an accountany program so i will need open listview in dialog

for daily accounts for general accounts etc....

so i need listview again and again

i dont know how to make it yet  :bg
Title: Re: Calling Listview From Menu
Post by: Force on February 20, 2012, 01:06:21 AM
Gunner

that phone is busy  maybe Listview is talking with his girlfriend  :bdg
Title: Re: Calling Listview From Menu
Post by: Force on February 20, 2012, 01:12:28 AM
dedndave

connecting to that site is forbidden to my IP
Title: Re: Calling Listview From Menu
Post by: Gunner on February 20, 2012, 01:13:07 AM
That number will never be busy...  Change the area code to your area code and call it, it will direct you to 411 for your area code :-)  Actually it is - (area code)555-1212 but any number after 555 should work.

If you need to create a few listviews, use CreateWindowEx
Title: Re: Calling Listview From Menu
Post by: Gunner on February 20, 2012, 01:15:58 AM
1. http://www.gunnerinc.com/files/masm32stuff/XXControls.zip
2. http://www.gunnerinc.com/files/masm32stuff/XXControlsTXTeng.zip
Title: Re: Calling Listview From Menu
Post by: dedndave on February 20, 2012, 01:16:36 AM
send me a PM with your email   :P

all controls, dialogs, scrollbars, etc are really windows created using a system-defined class
i.e., you can create them with CreateWindowEx
for a listview control, i think it is
szListViewClass db 'SysListView32',0
so - to learn about that and find some examples, google "SysListView32"

there are a few different functions for creating dialogs in code
a bit fun to play with - lol
CreateDialog
CreateDialogIndirect
CreateDialogIndirectParam
CreateDialogParam

again, they all wind up calling CreateWindowEx, internally   :P
Title: Re: Calling Listview From Menu
Post by: qWord on February 20, 2012, 01:22:46 AM
maybe a simple popup window/listview is what you want?
Title: Re: Calling Listview From Menu
Post by: dedndave on February 20, 2012, 01:26:49 AM
cool qWord   :U

i had to add InitCommonControls for XP and fix the INCLUDE path

seems like you ought to be able to stick that in a menu, somehow   :P
Title: Re: Calling Listview From Menu
Post by: qWord on February 20, 2012, 01:33:43 AM
Quote from: dedndave on February 20, 2012, 01:26:49 AM
i had to add InitCommonControls for XP and fix the INCLUDE path
fixed  :bg
Title: Re: Calling Listview From Menu
Post by: Force on February 20, 2012, 01:29:02 PM
Thanks gunner n qword  :U
Title: Re: Calling Listview From Menu
Post by: Force on February 21, 2012, 11:34:42 PM
I made it by using button

but after close Listview ....Closing Menu too

I dont know What's wrong
Title: Re: Calling Listview From Menu
Post by: qWord on February 22, 2012, 01:06:31 AM
Create WndProcs for each window. Your windows/dialogs have different behaviours -> the program is closed, because the pretended child-Dialog send the quit message.
Also it is a very bad idea to jump out of the WndProc back to the entry point.
(seems like a failed try to create a superclass...)
Title: Re: Calling Listview From Menu
Post by: Force on February 22, 2012, 09:21:50 PM
Yes qWord as you said

i separated windows procs and 

I made a sample program

after clicking button then 2nd window (Listview)is opening and menu window is closing automaticly

When second window closed it turns back Button menu


Exit is just from Button Menu



Force