Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Console window size

  1. #1
    Member
    Join Date
    Jan 2018
    Location
    France
    Age
    71
    Posts
    69
    Rep Power
    13

    Post Console window size [Solved]

    Hi,

    I'm looking for a method to get a console window with
    40 lines x 128 columns


    I've found Console_SetScreenBufferSize(xSize, ySise) but it seems to resize
    the buffer, not the window ( scroll bars appears around the window ).
    It is then possible to increase size of the window with the mouse.
    But what I wish is to achieve this only by program. The program I'm writing
    is intended to start on conditions driven by external stimulies, an display informations that can't
    enter in a 24x80 console.

    Thanks for help.
    Last edited by dco045; 06-01-2018 at 11:14.

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Ciao,

    try this one:
    uses "Console"
    
    Console_SetScreenBufferSize(40, 128)
    Console_ShowWindow(%CONSOLE_SW_MAXIMIZE)
    WaitKey
    
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    Member
    Join Date
    Jan 2018
    Location
    France
    Age
    71
    Posts
    69
    Rep Power
    13

    Red face Great

    Quote Originally Posted by ErosOlmi View Post
    Ciao,

    try this one:
    uses "Console"
    
    Console_SetScreenBufferSize(40, 128)
    Console_ShowWindow(%CONSOLE_SW_MAXIMIZE)
    WaitKey
    
    Hi,


    GREAT

    Full screen of thanks,

    Dany

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Inside \thinBasic\SampleScripts\Console\ there are some example script that can help.
    In any case just ask if you need something

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #5
    Member
    Join Date
    Jan 2018
    Location
    France
    Age
    71
    Posts
    69
    Rep Power
    13

    Question Now, I want more

    Hi,

    After having the window sized as I want/need, I wish another control over my console windows.

    The opened windows are always at the upper/left corner of my first screen (my machine have two screens).
    I would wish to choose the destination screen 1 or 2, and the position of the window in that screen.
    The screen and position should ideally set by variables in the script.
    IE: debug windows in left screen, alert windows centerd in right screen.

    Let me know if it' possible


    Dany

  6. #6
    hello dco045
    I think it should be possible, here's someone that did something similar to what your after but it's in FreeBasic but maybe it will give you ideas on how to do it in ThinBasic https://www.freebasic.net/forum/view...241467#p241467

  7. #7
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Honestly I use many screens at work but never thought to develop some thinBasic functionalities related to multi screens functionalities.
    I have to study Windows SDK how it manage it, if it is just a width/height extension or what.

    As a dirty solution you can get Console handle (the Windows ID that identify the any window) and use it to manage pixel width/height and window location using UI module.

    Here an example:
    uses "Console"
    uses "UI"
    
    
    Long ConsoleHandle 
    long DeskWidth
    long DeskHeight
    
    
    Console_SetScreenBufferSize(40, 128)
    'Console_ShowWindow(%CONSOLE_SW_MAXIMIZE)
    
    
    '---Get size of the virtual desktop
    DESKTOP GET CLIENT TO DeskWidth, DeskHeight
    Printl "Virtual desktop size is:", DeskWidth, "width", DeskHeight, "height"
    
    
    ConsoleHandle = Console_GetHandle
    printl "ConsoleHandle:", ConsoleHandle, hex$(ConsoleHandle)
    
    
    
    
    dialog set Size ConsoleHandle, 640, 480
    dialog set loc  ConsoleHandle, 100, 100
    
    
    WaitKey
    
    I will let you know if I find something on multi screens handling, it can be a nice to have.
    Last edited by ErosOlmi; 22-01-2018 at 21:48.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  8. #8
    Member
    Join Date
    Jan 2018
    Location
    France
    Age
    71
    Posts
    69
    Rep Power
    13
    Quote Originally Posted by ErosOlmi View Post
    Honestly I use many screens at work but never thought to develop some thinBasic functionalities related to multi screens functionalities.
    I have to study Windows SDK how it manage it, if it is just a width/height extension or what.

    As a dirty solution you can get Console handle (the Windows ID that identify the any window) and use it to manage pixel width/height and window location using UI module.

    Here an example:
    uses "Console"
    uses "UI"
    
    
    Long ConsoleHandle 
    Console_SetScreenBufferSize(40, 128)
    Console_ShowWindow(%CONSOLE_SW_MAXIMIZE)
    
    
    ConsoleHandle = Console_GetHandle
    printl "ConsoleHandle:", ConsoleHandle, hex$(ConsoleHandle)
    
    
    dialog set Size ConsoleHandle, 640, 480
    dialog set loc  ConsoleHandle, 100, 100
    
    
    WaitKey
    
    I will let you know if I find something on multi screens handling, it can be a nice to have.
    Hi Eros,

    Console windows are running a race around my screens

    You're faster than any telecom hot line. Faster than light.....

    Thanks


    Dany

  9. #9
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10


    You can get Virtual desktop size using this:
    uses "Console"
    uses "UI"
    
    
    Long ConsoleHandle 
    long DeskWidth
    long DeskHeight
    
    
    Console_SetScreenBufferSize(40, 128)
    'Console_ShowWindow(%CONSOLE_SW_MAXIMIZE)
    
    
    '---Get size of the virtual desktop
    DESKTOP GET CLIENT TO DeskWidth, DeskHeight
    Printl "Virtual desktop size is:", DeskWidth, "width", DeskHeight, "height"
    
    
    ConsoleHandle = Console_GetHandle
    printl "ConsoleHandle:", ConsoleHandle, hex$(ConsoleHandle)
    
    
    
    
    dialog set Size ConsoleHandle, 640, 480
    dialog set loc  ConsoleHandle, 100, 100
    
    
    WaitKey
    
    More info here:
    Virtual screen https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx


    Some other info: https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx

    I will add some functionality in next thinBasic release in order to have info on how many monitors, which is the primary one and for each have the resolution.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  10. #10
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Dear Dany,

    attached here a Bundled Executable with new functionalities working on multiple display monitor.
    Can you please run it and give feedback on what you see.

    Actually I do not have multiple monitor at home so my screen data is like the attached one.
    If you have more than one monitor you should get the number of monitor and for each of them resolution and working area relative to primary monitor

    Thanks a lot
    Eros
    Attached Images Attached Images
    Attached Files Attached Files
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Page 1 of 2 12 LastLast

Similar Threads

  1. user32dll + window size
    By Lionheart008 in forum thinBasic General
    Replies: 3
    Last Post: 12-11-2009, 17:52
  2. console window
    By fravado in forum Shout Box Area
    Replies: 3
    Last Post: 08-04-2008, 15:26
  3. console text screen size
    By sandyrepope in forum Console
    Replies: 11
    Last Post: 16-02-2007, 20:35
  4. MOVED: console text screen size
    By ErosOlmi in forum thinBasic General
    Replies: 0
    Last Post: 15-02-2007, 08:54

Members who have read this thread: 1

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •