Announcement

Collapse
No announcement yet.

console control consolewindow

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

  • console control consolewindow

    console control consolewindow

    --------------------------------------------------------------------------------

    console controls software:

    I have the standard version (wish I knew enough to get the pro version)
    Going from a menu window (shell call) which has consolewindow %maximize to a specific program that has a small console window and then back to the menu:
    When I return to the menu the console window is still at the size of the called program. I want it back to %maximize. What to do? I have tried placing another %maximize in several places but nothing works.

  • #2
    Tom --

    I apologize for the delay, I missed your new post. (For other people reading this thread, it is about Console Tools.)

    Generally speaking, if program A changes the console window in some way, then shells to program B -- in the same console window -- which changes the console settings, then when B is finished, A will have to re-establish the settings it needs.

    Without a code example it's hard to speculate. Are you using a synchronous or asynchronous SHELL (i.e. the PowerBASIC shell FUNCTION or STATEMENT)?

    Also, it seems unlikely that the shelled program is affecting the "maximized" status of the console -- very few console programs do that -- and it's a term that is often misunderstood. Do you mean that the console is changing size, or changing screen location, or the font size is changing by itself (Windows 95/98/ME only) or that the console is going into the "full-screen" mode, or...?

    -- Eric Pearson, Perfect Sync, Inc.
    Last edited by Eric Pearson; 17 Apr 2008, 05:01 PM.
    "Not my circus, not my monkeys."

    Comment


    • #3
      more specifics

      program A
      CASE "3"
      SHELL "C:\PBCC40\SAMPLES\TK4c124.EXE", 1
      I call the program ---at this point I have %maximize and this is a full screen menu
      THEN
      after select is completed
      END SELECT
      consolewindow %maximize '''consoletools
      lResult& = ConsoleWindow(%shownormal)
      CLS
      consolewindow %maximize
      I have tried several options here

      BUT here is what happens -- the program I am calling tk4c124 I have console controls set a small window
      lResult& = Console80x(10)
      'ConsoleMove %desktop_center, %desktop_center '''consoletools equate
      lResult& = ConsoleMove(100, 100)
      then at the end of the program I tell it to put it back
      WAITKEY$
      consolewindow %maximize '''consoletools

      END FUNCTION

      But when I return the main program (A) has the same size window as B tj4c124 and I only see the bottom part of the menu

      Thanks

      Comment


      • #4
        I'm not sure I understand your code, but I think I see the problem.
        Code:
        SHELL "C:\PBCC40\SAMPLES\TK4c124.EXE", 1
        That's the PowerBASIC shell STATEMENT, which is "asynchronous". That means that Program A launches program B, but Program A continues to run. Use this instead:

        Code:
        lResult& = SHELL("C:\PBCC40\SAMPLES\TK4c124.EXE", 1)
        That's the syntax for the shell FUNCTION, which tells program A to run program B and wait for Program B to exit. After B exits, A will then run the code to re-maximize the console window.

        This isn't really a Console Tools issue, it's a "program flow" problem.

        -- Eric Pearson, Perfect Sync, Inc.
        "Not my circus, not my monkeys."

        Comment


        • #5
          Um, Mr. P, methinks thou hath reverseth the synchronous and asynchronous SHELLeth function/statement....
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            it's magic?

            Eric,
            My premise is that everyone is smarter than me.
            BUT
            what you suggested >lResult& = SHELL("C:\PBCC40\SAMPLES\TK4c124.EXE", 1)

            looks a lot like
            SHELL function
            Purpose
            Run an executable program asynchronously (as a separate process), while execution of the original application continues uninterrupted.

            Syntax
            ProcessId??? = SHELL([HANDLES,] CmdString [, WndStyle])

            nevertheless I fumbled around and arrived at a success

            What I did was
            add lResult& = Console80x(50) to program A after the consolewindow %maximize
            plus a sleep (100) before I left program B

            I am sure you are right but it still looks like the console80x(rows) from program B carries back to Program A. So that on the return to program A I have to bump up the row count on the console80x to get a bigger console window. I am beginning to think that consolewindow %maximize doesn't have anything to do with the size of the console window, only with whether it is maximized based on the last setting (from program B).

            Like I said- everyone is smarter than me; just what I observed!

            Comment


            • #7
              DOH!

              You are both right, I got the function and statement backward. Let me revise my answer...

              I have no idea.

              I'll look at the code again...

              -- Eric
              "Not my circus, not my monkeys."

              Comment


              • #8
                >SHELL([HANDLES,] CmdString [, WndStyle])

                As long as yiou brought it up....

                Is that HANDLES option documented better in the CC 4.04 and Win 8.04 help files?

                The ".03" versions just say..
                The HANDLES option allows the child process to inherit the file handles opened by your program. This affects only Windows handles, not PowerBASIC file identifiers. It is an advanced option, for those who know it works and why they need it.
                Which handles? The standard handles? File handles? Duplicated handles?

                I thought the doc was supposed to explain HOW it works and WHAT it does!

                Well, maybe the ".04" doc has addressed this...
                Michael Mattias
                Tal Systems (retired)
                Port Washington WI USA
                [email protected]
                http://www.talsystems.com

                Comment


                • #9
                  Tom --

                  > it still looks like the console80x(rows) from
                  > program B carries back to Program A.

                  Correct. To be more precise, the console row-count does not automatically revert to the previous setting when program B terminates. The console just sits there, waiting to be told what to do next.

                  > So that on the return to program A I have to
                  > bump up the row count on the console80x to get
                  > a bigger console window.

                  Correct.

                  > I am beginning to think that consolewindow %maximize
                  > doesn't have anything to do with the size of the
                  > console window, only with whether it is maximized

                  Correct, except if your program is running on Windows 95/98/ME. On those systems, maximizing the console window can change the size because of the "auto-font-size" feature.

                  On all other versions of Windows, ConsoleWindow %MAXIMIZE affects only the screen location of the console window. A maximized console is located in the top-left corner of the screen.

                  Does that answer everything?

                  -- Eric
                  "Not my circus, not my monkeys."

                  Comment

                  Working...
                  X