Loading ...
Sorry, an error occurred while loading the content.

Re: [perlguitest] GetPopupHandle

Expand Messages
  • Timothy Mitchell
    Perl functions, by default, return the last variable computed. I haven t tried the GetPopupHandle function, but I often have to add a sleep to give windows
    Message 1 of 3 , Jun 1, 2006
    • 0 Attachment
      Perl functions, by default, return the last variable computed. I haven't tried the GetPopupHandle function, but I often have to add a "sleep" to give windows time to appear before attempting to look for their handle.

      brentje <brentje@...> wrote: Hi

      I'm having some trouble with the GetPopupHandle function. It never
      seems to bring back a handle. It always returns 0. After looking
      into the .XS file, I noticed that the function that does the work,
      PopupHandleGet, doesn't seem to be setting it's return value, g_popup.
      I don't know much about the .XS side of things yet, but is this a bug
      or am I missing something? Are there other ways of getting the handle
      or X/Y coordinates of a popup menu, maybe through SendMessage or
      something?

      Brent






      ---------------------------------
      YAHOO! GROUPS LINKS


      Visit your group "perlguitest" on the web.

      To unsubscribe from this group, send an email to:
      perlguitest-unsubscribe@yahoogroups.com

      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


      ---------------------------------





      [Non-text portions of this message have been removed]
    • ls5302
      I d like to use the GetPopupHandle function to obtain the handle to the context menu within notepad. Unfortunately, like some earlier posts the function return
      Message 2 of 3 , Mar 31, 2007
      • 0 Attachment
        I'd like to use the GetPopupHandle function to obtain the handle to
        the context menu within notepad. Unfortunately, like some earlier
        posts the function return zero and not the handle. The code I have so
        far is below (header removed). The context menu appears in the correct
        place but the handle is 0.

        Any help is most appreciated.

        Thanks

        system "start notepad.exe";
        sleep(1);

        @windows = FindWindowLike(undef, "^Untitled - Notepad");

        if (not @windows) {
        die "Could not find Notepad\n";
        } elsif (@windows > 1) {
        die "There might be more than one Notepad running\n";
        }

        ($lx,$ty,$rx,$by)=GetWindowRect($windows[0]);

        @children = GetChildWindows($windows[0]);

        if (not @children) {
        die "Could not find children of Notepad\n";
        }

        $hpopup=GetPopupHandle($children[0],($lx+$rx)/2,($ty+$by)/2);
        printf("hpopup: %d\n", $hpopup);

        $hpopup=GetPopupHandle($children[1],($lx+$rx)/2,($ty+$by)/2);
        printf("hpopup: %d\n", $hpopup);

        $hpopup=GetPopupHandle($windows[0],($lx+$rx)/2,($ty+$by)/2);
        printf("hpopup: %d\n", $hpopup);
      Your message has been successfully submitted and would be delivered to recipients shortly.