Hi,

There is this useful yet annoying feature on windows command prompt called quick edit mode. Useful because it lets a user cut and paste off the command prompt. Annoying because it causes a running process to hang in select mode (that is an unsuspecting ignorant user clicking once in the command prompt window by mistake). This feature is on by default in our working environment. I am looking for a way to turn this off while a user runs my perl scripts, to prevent him from hanging the running script. One of the ways suggested to me by someone here was to use a sparsely documented win32 perl module called Win32::Console. I have found very few examples on the use of this module. Below is a snippet of the perl code that I am trying to turn quick edit mode off with:

$myConsole = Win32::Console->new(STD_INPUT_HANDLE); $myConsole->Title("Title 1"); # this works my $mode = $myConsole->Mode(); # Get the current console mode $mode = $mode & 0xFFBF; $myConsole->Mode($mode) || die "error setting console mode to $mode "; sleep 10;


The above code fails for me with the die message. Any further help would be greatly appreciated. I am also open to any other ideas which might bypass using win32::console module.

Thanks,
Waris

In reply to win32::console question by arkamedis21

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.