I can get any filename from the panel now using an arbitrary index, but I could not find a way to get the index of the selected or current file. I tried LB_GETCARETINDEX and LB_GETCURSEL, it seems to me, that both are not supported (TC returns 0). So how can I "retrieve current line via LB_GETTEXT" as promised?history.txt wrote:15.09.06 Added: Support for accessibility tools (e.g. for blind users) to main lists+separate tree+sync+CD-Tree, allows to retrieve current line via LB_GETTEXT
(SOLVED) Problem with LB_GETTEXT for current line
Moderators: Hacker, petermad, Stefan2, white
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
(SOLVED) Problem with LB_GETTEXT for current line
Last edited by SanskritFritz on 2006-11-14, 10:57 UTC, edited 1 time in total.
I switched to Linux, bye and thanks for all the fish!
2SanskritFritz
I cannot confirm this. It works fine here. Example:
I cannot confirm this. It works fine here. Example:
Code: Select all
HWND listBox = getActiveListBox();
if (listBox)
{
LRESULT r = SendMessage (listBox , LB_GETCURSEL, 0, 0);
LRESULT l = SendMessage (listBox , LB_GETTEXTLEN, (WPARAM)r, 0);
char* text = new char [l +1];
SendMessage (window, LB_GETTEXT, (WPARAM)r, (LPARAM)text);
MessageBox (hwnd, text, 0, MB_ICONINFORMATION);
delete [] text;
}
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
So are we having an AutoHotkey problem? Or maybe I am doing something wrong, can you check please this code?
Code: Select all
LB_GETCURSEL = 0xF188
SendMessage LB_GETCURSEL, 0, 0, TMyListBox1, ahk_class TTOTAL_CMD
nResult := ErrorLevel
MsgBox %nResult%
I switched to Linux, bye and thanks for all the fish!
- majkinetor !
- Power Member
- Posts: 1580
- Joined: 2006-01-18, 07:56 UTC
- Contact:
Code: Select all
msgbox % tcgetselection()
TCGetSelection(panel=1)
{
if LB_GETTEXT=
{
LB_GETTEXT = 0x189
LB_GETCURSEL = 0x188
VarSetCapacity(sss, 512)
}
SendMessage LB_GETCURSEL, 0 , 0, TMyListBox%panel% , ahk_class TTOTAL_CMD
SendMessage LB_GETTEXT, %errorlevel% , &sss, TMyListBox%panel% , ahk_class TTOTAL_CMD
return sss
}
Habemus majkam!
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary