Hello,

I'm trying to write an application that benchmarks the time it takes to fully load WinMe's helpctr.exe program (Help and Support Center). I'm having a bit of trouble getting my mind around setting windows hooks using the Win32::API perl library. Also, confused as to the best way one would determine which "handle to application instance" I should pass SetWindowsHookEx. Would I need to determine which DLL's helpctr.exe uses? Can one get this from knowing the window handle for helpctr?

use Win32::API; use strict; # # Omitted code: # (1) start the helpctr.exe process # (2) create time 0 benchmark object # # SetWindowsHookEx prototype info - # HHOOK SetWindowsHookEx ( # int idHook, // hook type # HOOKPROC lpfn, // hook procedure # HINSTANCE hMod, // handle to application instance # DWORD dwThreadId // thread identifier # ); # use constant WH_CALLWNDPROCRET => 12; my $SetWindowsHookEx = new Win32::API( "user32", "SetWindowsHookEx", [qw(I P N N)], 'N'); # how to determine hInstance(s) of helpctr for the following call? my $Hook = $SetWindowsHookEx->Call( WH_CALLWNDPROCRET, 'CallWndRetProc', $hInstance, 0); </b> Am I right in thinking that the best way to determine the state of the window is to evaluate all the return values of the message processed by that window? Thanks much. Marshall Random thot - it would be really cool if this site used something like the GURPs system for tracking the monastic ascension of users - something like the character development in the PC game "Fallout".

In reply to Inspecting messages using Win32::API by mtaylor

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.