Announcement

Collapse
No announcement yet.

Your basic question..

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

  • Your basic question..

    No pun intended


    Code:
                 Case %IDM_SEND,%IDB_SEND
                     If IsFalse Exist(FileSpec) Then Exit Function
                     If CbCtlMsg = %BN_CLICKED And IsFalse(g_Busy) Then SendFile FileSpec
                     Function = 0
                     Exit Function
    This piece of code is activated by a button or a menu.
    While it is processing a function (SendFile), I want any messages indicating that button/menu to vaporize, never existed, when the process is done then they must press the button again...


    I know this is simple, just discarding the message is all I want to do....

    Scott

    -------------
    Scott
    mailto:[email protected][email protected]</A>
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

  • #2
    I assume that you want the pressed button to "pop up" before the sendfile function starts?

    If so, maybe consider starting the SendFile function as a thread, so that execution in your message processor continues, and the button refreshes itself.

    If I am on the wrong track, please excuse me!

    If you need help threading, then let me know, and I'll share my limited knowledge (I know that there are plenty of other BBS'ers who know tons more than me).

    Dorian.


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

    Comment


    • #3
      Scott --
      What about EnableWindow GetDlgItem(hDlg, xxx), %False - for button; EnableMenuItem ... %MF_GRAYED and DrawMenuBar for menu ?


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

      Comment


      • #4
        I had disabled the button for a while, while it's processing, and that certainly works, but there are instances where I might have to reenable it in the middle of the transaction, ie if Cancel is pressed or something....that is my workaround but I hope to just find a way to make the button click once but not again until the file transfer is complete...

        Ie I know the message is in for BN_CLICKED so I want to make it null...probably requires subclassing the thing...


        Scott

        ------------------
        Scott
        mailto:[email protected][email protected]</A>
        Scott Turchin
        MCSE, MCP+I
        http://www.tngbbs.com
        ----------------------
        True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

        Comment


        • #5
          Sounds like a job for a Synchronization Object... Using a static variable to signify "busy" is not 100% bullet-proof (it's to do with the way that preemptive multi-tasking can perform context switches at inappropriate moments! (g)

          Check out Michael Mattias' article in a recent issue of Basically Speaking... www.infoms.com ... It's worth a read.

          Alternatively, get a copy of Rector/Newcomer's "Win32 Programming" which discusses Synchronization Objects in detail.


          ------------------
          Lance
          PowerBASIC Support
          mailto:[email protected][email protected]</A>
          Lance
          mailto:[email protected]

          Comment

          Working...
          X