http://www.perlmonks.org?node_id=1019124


in reply to Re^5: How to get a window's menu as a Win32::GUI::Menu object?
in thread How to get a window's menu as a Win32::GUI::Menu object?

I don't know, but it certainly answers the question you asked , and I quote
"returns a menu HANDLE, not an object reference. This seems to be more or less useless -- unless there's a way to turn the handle into an object? "

Yes, but not just any old object -- THE object the handle was associated with. Sorry, but I would have thought this was obvious given the context of the question. :-/

I am actually using a global now, but I'm looking for a way around it since I'm also using threads which sometimes don't seem to play well with global Win32::GUI object variables.

Anyway, thanks for the suggestions. Storing $Menu inside $WinMain is the solution I'm looking for. I tried something like this before (on a different Win32::GUI issue), but I couldn't make it work -- it's been a while, but IIRC the stored variable refused to "stick" to the object (it was undefined when I tried to access it later). Chalk it up to my lack of understanding of perl's object handling I guess.