The treeview is a SysTreeView32 class. I am using Win32::GuiTest and Win32::API for the calls not supported in Win32::GuiTest. My Win32 programmers reference does not mention any way to enumerate the treeview. I was hoping to find some Win32 API that I could call using the Win32::API module. I have tried GetWindowText and SendMessageA but to no avail. Ultimately I would like to write a sub that returned a hash of the treeview structure.
###############
sub getWindowText{
my $hwnd = shift || return;
$GetWindowText ||= new Win32::API("user32", "GetWindowText", ['N',
+ 'P', 'N'], 'N') || return;
my $title = " " x 1024;
my $titleLen = 1024;
my $result = $GetWindowText->Call($hwnd, $title, $titleLen);
if($result){return substr($title, 0, $result);}
#if no result send a WM_GetText message to the window
$WmSendMessage ||= new Win32::API("user32", "SendMessageA", [N, N,
+ N, P],'N') || return;
my $WM_GETTEXT=13;
my $text = " " x 2048;
my $textLen = 2048;
my $result = $WmSendMessage->Call($hwnd,$WM_GETTEXT, $textLen, $te
+xt);
if($result){return substr($text, 0, $result);}
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.