petecm99 has asked for the wisdom of the Perl Monks concerning the following question:

Pious monks,

I recently retrieved the new version of Win32::GUI. As well as now requiring me to include parentheses in the Use statement use Win32::GUI(); it appears I can no longer use such flags as MB_OK and WS_VSCROLL.

Through trial and error, I found that the numeric equivalent of MB_OK equals 0. However, I don't want to guess at the values for all of these defunct words - is there a page in CPAN that shows what numeric values all of the deprecated flags equate to? I did a search under Win32::GUI and FAQ but came up empty.

Frankly, I don't even know how these flags worked in the previous version as they're obviously not scalars - don't really care though as long as I can find the numeric substitutes...

Thanks,
Pete

Replies are listed 'Best First'.
Re: Win32 GUI new version flag issues
by ikegami (Patriarch) on Sep 29, 2010 at 21:02 UTC
    "From v1.04 the support for constants is provided by Win32::GUI::Constants"
      Thanks for that! Simply including the Constants module did not solve the syntax error, but at least you got me looking in the right direction. Ended up 'importing' the one I needed -

      my $ws_vscroll = Win32::GUI::Constants::constant('WS_VSCROLL');
        If you know which tags you want, just import them at the use line: use Win32::GUI::Constants qw/WS_VSCROLL MB_OK/;

        Alternatively, you can also import the compatibility tags from the older version of Win32::GUI: use Win32::GUI::Constants qw/:compatibility_win32_gui/;