[EMAIL PROTECTED] wrote:
<snip!>
> I think that I can help me with GetGUIThreadInfo, however, this a
> structure
> needs
> GUITHREADINFO
> typedef struct tagGUITHREADINFO {
> DWORD cbSize;
> DWORD flags;
> HWND hwndActive;
> HWND hwndFocus;
> HWND hwndCapture;
> HWND hwndMenuOwner;
> HWND hwndMoveSize;
> HWND hwndCaret;
> RECT rcCaret;
> } GUITHREADINFO, *PGUITHREADINFO;
> in this structure is a pointer on another structure
> typedef struct _RECT {
> LONG left;
> LONG top;
> LONG right;
> LONG bottom;
> } RECT, *PRECT;
>
> how can I do this in perl ???????????????????????????????
As I read the the typedef for structure GUITHREADINFO, it does _not_
contain a pointer to a _RECT structure, but the structure itself. If it
were a pointer, the last element of GUITHREADINFO would be "PRECT
prcCaret", or something like that.
Under this assumption, you just unpack. Microsoft specifies structures in
terms of a Byzantine array of typedefs and #defines. As I read it (and you
should double-check me), when all these are resolved, the structure
consists entirely of 32-bit integers.
my ($cbSize, $flags, $hwndActive, $hwndFocus, $hwndCapture, $hwndMenuOwner,
$hwndMoveSize, $hwndCaret, $left, $right, $top, $bottom) =
unpack 'L12', $GuiThreadInfo;
If it were in fact a pointer, you could _try_ something like
my ($cbSize, $flags, $hwndActive, $hwndFocus, $hwndCapture, $hwndMenuOwner,
$hwndMoveSize, $hwndCaret, $rcCaret) =
unpack 'L8P16', $GuiThreadInfo;
my ($left, $right, $top, $bottom) = unpack 'L4', $rcCaret;
where the 'P16' comes because a RECT is (assuming I followed all the
typedefs and #defines correctly) 16 bytes long.
You should check this, since my examples are the most frigid of cold code.
Tom Wyant
This communication is for use by the intended recipient and contains
information that may be privileged, confidential or copyrighted under
applicable law. If you are not the intended recipient, you are hereby
formally notified that any use, copying or distribution of this e-mail,
in whole or in part, is strictly prohibited. Please notify the sender
by return e-mail and delete this e-mail from your system. Unless
explicitly and conspicuously designated as "E-Contract Intended",
this e-mail does not constitute a contract offer, a contract amendment,
or an acceptance of a contract offer. This e-mail does not constitute
a consent to the use of sender's contact information for direct marketing
purposes or for transfers of data to third parties.
Francais Deutsch Italiano Espanol Portugues Japanese Chinese Korean
http://www.DuPont.com/corp/email_disclaimer.html
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs