Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > Delphi программирование > Общие вопросы Delphi
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 20.10.2009, 20:17   #1
TwiX
Участник клуба
 
Аватар для TwiX
 
Регистрация: 28.07.2009
Сообщений: 1,510
По умолчанию Как сделать такой лист-вьев (скрин тут) и с помощью sendmessage вытянуть из i-ого итема текст?

Я всегда думал, что это листбокс) Но это оказался лист-вьев и мне стало интересно)
Изображения
Тип файла: jpg Снимок.JPG (25.6 Кб, 69 просмотров)
TwiX вне форума Ответить с цитированием
Старый 20.10.2009, 20:43   #2
.Phoenix
Форумчанин
 
Регистрация: 02.04.2009
Сообщений: 235
По умолчанию

Уххх, ты часом не забанен там? ))) Гх решил утворить да?! )))
Всё гениальное - просто!
.Phoenix вне форума Ответить с цитированием
Старый 20.10.2009, 20:44   #3
Пепел Феникса
Старожил
 
Аватар для Пепел Феникса
 
Регистрация: 28.01.2009
Сообщений: 21,000
По умолчанию

1)заголовка не вижу но думаю он там есть...
http://programmersforum.ru/showthread.php?t=63802
вот посмотри.
2)
Цитата:
The LVM_GETITEMTEXT message retrieves the text of a list view item or subitem. You can send this message explicitly or by using the ListView_GetItemText macro.

LVM_GETITEMTEXT
wParam = (WPARAM) (int) iItem;
lParam = (LPARAM) (LV_ITEM FAR *) pitem;


Parameters

iItem

Index of the list view item.

pitem

Pointer to an LV_ITEM structure. The iSubItem member specifies the index of a subitem, or it can be zero to get the item label. The pszText member points to a buffer that receives the text, and the cchTextMax member specifies the size of the buffer.



Return Values

If you send this message explicitly, it returns the length of the retrieved string.
If you can send this message implicitly by using the ListView_GetItemText macro, there is no return value.
структуры в Делфи этой я не нашел..поэтому выложу и это:
Цитата:
typedef struct _LV_ITEM {
UINT mask;
int iItem;
int iSubItem;
UINT state;
UINT stateMask;
LPTSTR pszText;
int cchTextMax;
int iImage; // index of the list view item's icon
LPARAM lParam; // 32-bit value to associate with item
} LV_ITEM;


Members

mask

A set of bit flags that specify attributes of this data structure or of an operation that is using this structure.
The following bit flags specify the members of the LV_ITEM structure that contain valid data or need to be filled in. One or more of these bit flags may be set:

Value Meaning
LVIF_TEXT The pszText member is valid or needs to be filled in.
LVIF_IMAGE The iImage member is valid or needs to be filled in.
LVIF_PARAM The lParam member is valid or needs to be filled in.
LVIF_STATE The state member is valid or needs to be filled in..


The following bit flag is used with the LVN_GETDISPINFO notification message:

Value Meaning
LVIF_DI_SETITEM The operating system should store the requested list item information, and not ask for it again.


iItem

Specifies the zero-based index of the item to which this structure refers.

iSubItem

Specifies the one-based index of the subitem to which this structure refers, or zero if this structure refers to an item rather than a subitem.

state

Specifies the current state of the item if the item's state is being retrieved, or the new state if the item's state is being set. The stateMask member specifies the bits of the state member that are valid. This member can be any valid combination of state values. For a list of item states, see List View Item States.

stateMask

Specifies the bits of the state member that are valid.

pszText

Pointer to a null-terminated string that contains the item text if the structure specifies item attributes. If this member is the LPSTR_TEXTCALLBACK value, the item is a callback item. Do not set the pszText member to LPSTR_TEXTCALLBACK if the list view control has LVS_SORTASCENDING or LVS_SORTDESCENDING style.
If the structure is receiving item attributes, this member is the pointer to the buffer that receives the item text.

cchTextMax

Size of the buffer pointed to by the pszText member if the structure is receiving item attributes. If the structure specifies item attributes, this member is ignored.

iImage

Index of the list view item's icon in the icon and small icon image lists.
If this member is the I_IMAGECALLBACK value, the parent window is responsible for storing the index. In this case, the list view control sends the parent an LVN_GETDISPINFO notification message to get the index when it needs to display the image.

lParam

A 32-bit value to associate with the item. If you use the LVM_SORTITEMS message, the list view control passes this value to the application-defined comparison function. You can also use the LVM_FINDITEM message to search a list view control for an item with a specified lParam value.



Remarks

The LV_ITEM structure is used with a number of messages, including LVM_GETITEM, LVM_SETITEM, LVM_INSERTITEM, and LVM_DELETEITEM.
Хорошо поставленный вопрос это уже половина ответа. | Каков вопрос, таков ответ.
Программа делает то что написал программист, а не то что он хотел.
Функции/утилиты ждут в параметрах то что им надо, а не то что вы хотите.

Последний раз редактировалось Пепел Феникса; 20.10.2009 в 20:47.
Пепел Феникса вне форума Ответить с цитированием
Старый 20.10.2009, 21:27   #4
TwiX
Участник клуба
 
Аватар для TwiX
 
Регистрация: 28.07.2009
Сообщений: 1,510
По умолчанию

.Phoenix, нет =) 30 лвл своими руками без читов и мегаэкспа =)
А тут просто переписываю прогу с автоита старую - та работала только "он-лайн" xD

Пепел Феникса, структуру я тоже искал, но не нашёл - поэтому пытался использовать listView_getitemtext... Но он убивал прогу - тупо погибаал процесс.
А можно пример работы с этой структурой? А то я не совсем понимаю как это организовать =) Надо создать свой класс с этими параметрами что ль?
TwiX вне форума Ответить с цитированием
Старый 20.10.2009, 22:14   #5
Lemo
Форумчанин
 
Аватар для Lemo
 
Регистрация: 13.10.2008
Сообщений: 714
Радость

бросай Гарену, она зло=(
Lemo вне форума Ответить с цитированием
Старый 20.10.2009, 23:05   #6
Пепел Феникса
Старожил
 
Аватар для Пепел Феникса
 
Регистрация: 28.01.2009
Сообщений: 21,000
По умолчанию

свою запись...так вот какие трудности я нашел...
могу кинуть ссыль как удавалось сделать...но там на англе и VB6
http://www.vbforums.com/attachment.p...5&d=1144367852
то есть получается нельзя прочесть(просто так) чужой итем

чето говорили что память на буффер надо как то через VirtualAlloc выделять...
(очень даже реально...память что мы выделили должна быть доступна другому поцессу)
и что при стиле OWNERDATA сообщение не поможет...но на том ком я пробывал я не заметил этого стиля
Хорошо поставленный вопрос это уже половина ответа. | Каков вопрос, таков ответ.
Программа делает то что написал программист, а не то что он хотел.
Функции/утилиты ждут в параметрах то что им надо, а не то что вы хотите.

Последний раз редактировалось Пепел Феникса; 20.10.2009 в 23:26.
Пепел Феникса вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Можно ли как-нибудь с помощью sendmessage послать дабл-клик на элемент listview'a? TwiX Win Api 4 20.10.2009 18:33
Как олучить текст итема в ListView? TwiX Общие вопросы Delphi 4 04.08.2009 22:49
Как сделать скрин рабочего стола на Delphi 7? dradysman Общие вопросы Delphi 10 26.07.2009 19:37
Помогите вытянуть нужный текст из memo XazzzI Общие вопросы Delphi 11 17.06.2009 17:06
Как вытянуть скрин c *.swf или *.flv файла на php iankov PHP 1 09.01.2009 13:51