Loading ...
Sorry, an error occurred while loading the content.

Re: help with NOMAINWIN

Expand Messages
  • carlg@libertybasic.com
    What you re trying to do doesn t work because nomainwin is a compiler directive, which means that if nomainwin appears anywhere in your program, it s going to
    Message 1 of 7 , Oct 3, 2001
    • 0 Attachment
      What you're trying to do doesn't work because nomainwin is a compiler
      directive, which means that if nomainwin appears anywhere in your
      program, it's going to do its thing.

      Sorry,

      -Carl

      --- In libertybasic@y..., "Surplushunter" <surplushunter@s...> wrote:
      > Hi -
      >
      > Help!!! This should work - I can't figure out why it doesn't:
      >
      > For diagnostic purposes I'd like to use the main window, then turn
      it off with NOMAINWIN when I'm done. I've tried this:
      >
      > test=1 '0 for normal operation, 1 for testing
      > if test=0 then
      > nomainwin
      > else
      > nothing
      > end if
      >
      > and this:
      >
      > if test=0 then nomainwin
      >
      > and neither one works - the nomainwin works regardless of the if-
      then test. If I comment the line with nomainwin out - I get a main
      window every time. If I uncomment the line - I don't get a main
      window - every time.
      >
      > Has anyone else tried this? I can't find anything in the docs about
      this - so I don't know why it doesn't work.
      >
      > Thanks in advance,
      >
      >
      > surplushunter@s...
    • Guy Canida
      HI, If I read well the help command section for nomainwin I do : nomainwin (for testing) and nomainwin (for final and further run) It is not more work to
      Message 2 of 7 , Oct 3, 2001
      • 0 Attachment
        HI,

        If I read well the help command section for nomainwin I do :

        ' nomainwin (for testing)

        and

        nomainwin  (for final and further run)

        It is not more work to put the quote to comment out a line of code or remove it than to set test=0
        then test=1

        Guy.

        Surplushunter wrote:
        Hi -
         
        Help!!! This should work - I can't figure out why it doesn't:
         
        For diagnostic purposes I'd like to use the main window, then turn it off with NOMAINWIN when I'm done. I've tried this:
         
        test=1                       '0 for normal operation, 1 for testing
        if test=0 then
            nomainwin
        else
            nothing
        end if
         
        and this:
         
        if test=0 then nomainwin
         
        and neither one works - the nomainwin works regardless of the if-then test. If I comment the line with nomainwin out - I get a main window every time. If I uncomment the line - I don't get a main window - every time.
         
        Has anyone else tried this? I can't find anything in the docs about this - so I don't know why it doesn't work.
         
        Thanks in advance,
         
         

        To unsubscribe from this group, send an email to:
        libertybasic-unsubscribe@egroups.com



        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service .

      • A. Watson
        You can close the mainwindow via api, if it is necessary to use it in a program and close it during program execution. If THE VERY FIRST THING THE PROGRAM
        Message 3 of 7 , Oct 3, 2001
        • 0 Attachment
          You can close the mainwindow via api, if it is necessary to use it in a
          program and close it during program execution. If THE VERY FIRST THING THE
          PROGRAM DOES is call GetActiveWindow, this will return the handle of the
          mainwindow. When you no longer need the mainwindow, send a DestroyWindow
          message. This example simply destroys it after a few seconds.

          Alyce

          open "user" for dll as #user
          calldll #user, "GetActiveWindow",_
          hMain as short 'handle of mainwin

          TIMER 3500, [quit]
          print "This window will close in a few seconds"
          wait

          [quit]
          calldll #user, "DestroyWindow", _
          hMain as word, _ 'handle of window
          result as ushort 'return from function
          close #user
        • John Jacques
          Yes, but some people use LB for the BASIC portion and do not want to get involved with API calls. BTW - you might want to write our own book on using the API
          Message 4 of 7 , Oct 3, 2001
          • 0 Attachment
            Yes, but some people use LB for the BASIC portion and do not want to get
            involved with API calls. BTW - you might want to write our own book on using
            the API calls in LB2 and 3 and market it, maybe sell it with Carl's LB as an
            add-on or something. You know 99% of the API interface questions that I've seen
            asked.

            John

            "A. Watson" wrote:

            > You can close the mainwindow via api, if it is necessary to use it in a
            > program and close it during program execution. If THE VERY FIRST THING THE
            > PROGRAM DOES is call GetActiveWindow, this will return the handle of the
            > mainwindow. When you no longer need the mainwindow, send a DestroyWindow
            > message. This example simply destroys it after a few seconds.
            >
            > Alyce
            >
            > open "user" for dll as #user
            > calldll #user, "GetActiveWindow",_
            > hMain as short 'handle of mainwin
            >
            > TIMER 3500, [quit]
            > print "This window will close in a few seconds"
            > wait
            >
            > [quit]
            > calldll #user, "DestroyWindow", _
            > hMain as word, _ 'handle of window
            > result as ushort 'return from function
            > close #user
            >
            >
            > To unsubscribe from this group, send an email to:
            > libertybasic-unsubscribe@egroups.com
            >
            >
            >
            > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
          • A. Watson
            ... seen ... Thank you very much, John. I have written an eBook called Using Liberty BASIC 2 which is here. http://iquizme.0catch.com/lb/sss/cd.htm The
            Message 5 of 7 , Oct 3, 2001
            • 0 Attachment
              At 03:18 PM 10/3/01 -0400, you wrote:
              > BTW - you might want to write our own book on using
              >the API calls in LB2 and 3 and market it, maybe sell it with Carl's LB as an
              >add-on or something. You know 99% of the API interface questions that I've
              seen
              >asked.
              >
              >John

              Thank you very much, John. I have written an eBook called "Using Liberty
              BASIC 2" which is here. http://iquizme.0catch.com/lb/sss/cd.htm The
              entire third section is on API calls. The book is in three formats...
              typical Windows Help file, plain HTML, and Win98 Explorer-type help. When
              this message arrived, I was at work updating the eBook for LB3.

              Alyce
            Your message has been successfully submitted and would be delivered to recipients shortly.