Announcement

Collapse
No announcement yet.

Warp text output on resize

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Warp text output on resize

    Which API can I use to deactivate the CMD option "Warp text output on resize"?
    As long as the option is activated, the width "Screen Buffer Size" is disabled.
    I tried the API "SetConsoleMode" in connection with "ENABLE_WRAP_AT_EOL_OUTPUT". Unfortunately without success.

    Click image for larger version

Name:	Warp text output on resize.png
Views:	84
Size:	24.0 KB
ID:	807362

  • #2
    The API "GetConsoleMode()" cannot query the option at all. My plan is broken.


    Code:
    #COMPILE EXE
    #DIM ALL
    #INCLUDE "win32api.inc"
    
    
    FUNCTION PBMAIN () AS LONG
    LOCAL hConBuffer AS DWORD
    LOCAL dFlags     AS LONG
    LOCAL lRslt      AS LONG
    LOCAL e          AS LONG
    
        hConBuffer = CON.GETSTDOUT
    
        lRslt = GetConsoleMode (BYVAL hConBuffer, dFlags)
        IF ( lRslt = 0 ) THEN
            e = GetLastError()
            CON.PRINT "GetConsoleMode: "; e
        END IF
        CON.PRINT "Flags: "; dFlags
        CON.PRINT
        CON.PRINT "Now change the option 'Warp text output on resize' and then press any key."
        CON.PRINT
        WAITKEY$
    
        lRslt = GetConsoleMode (BYVAL hConBuffer, dFlags)
        IF ( lRslt = 0 ) THEN
            e = GetLastError()
            CON.PRINT "GetConsoleMode: "; e
        END IF
        CON.PRINT "Flags: "; dFlags; " (There is no change)"
    
        CON.WAITKEY$
    END FUNCTION

    Comment


    • #3
      The following registry entry deactivates the option:

      Computer\HKEY_CURRENT_USER\Console LineWrap=0

      But that only causes changes to the cmd window.

      Comment


      • #4
        Hi Bernhard,

        A couple of solutions were posted here - with a code sample in Post #24 of that thread.

        BTW.
        But that only causes changes to the cmd window.
        Console apps use the cmd window settings except when they have an individual registry subkey (featuring the same setting) like "Computer\HCU\Console\Drive:_Path_AppName.ext".

        Apps create an individual subkey the first time a user changes a Property and selects OK. Subsequently the App will use the settings recorded there to override (the cmd) defaults.
        Last edited by Dave Biggs; 4 May 2021, 12:08 AM. Reason: Add comments re cmd (Default) settings
        Rgds, Dave

        Comment

        Working...
        X