Announcement

Collapse
No announcement yet.

Message cue overflow

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

  • Message cue overflow

    Hi

  • #2
    while my app is doing some slow work i like to ignore any window message
    (esp. mouse clicks) or when the job is finished i like to empty the message cue (like key-buffer in DOS) ??? Is there a way ???
    To enable the whole window is not elegant isn't it?
    help !!! ....Michael

    Comment


    • #3
      Michael --

      DIALOG DISABLE
      Disable a dialog so that it no longer receives any mouse or keyboard messages.

      Syntax DIALOG DISABLE hDlg&

      Remarks hDlg& refers to the dialog you want to disable. A disabled dialog will not receive any messages when it is clicked with the mouse or selected with the keyboard.

      Disable a control so that it no longer receives any messages.

      For separate elements of DIALOG:

      Syntax CONTROL DISABLE hDlg&, Id&

      Remarks hDlg& refers to the dialog that owns the control. Id& is the unique control identifier you assigned to the control with the CONTROL ADD statement. A disabled control will not receive any messages when it is clicked with the mouse or selected with the keyboard. Most (but not all) controls will redraw themselves as "gray" when disabled.


      [This message has been edited by Semen Matusovski (edited December 28, 1999).]

      Comment


      • #4
        Hi Semen

        I wrote exactly as you suggested but all i get ist the famous error message
        Def Type id.....what allways appears even when you type a syntax error.
        I am using the hDlg-Variable for my main Dialog too so this cannot be the reason for the error !?! (I'm using PBDLL 5.0)
        Do you have any idea whats wrong ?...Michael




        [This message has been edited by Michael Rosner (edited December 28, 1999).]

        Comment


        • #5
          Sorry, Michael, you didn't informed that you use PB DLL 5.0.
          DDT are in PB/DLL 6.0 only. I simply copied a part of help file.
          Of course, it's possible to do the same, using parameters of API functions, but this is more difficult task.
          DDT are cool tools for creating forms. Could be there are reasons to upgrade to PB DLL 6.0 ?

          Comment


          • #6
            Refer to EnableWindow()


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

            Comment


            • #7
              Hi Lance.

              EnableWindow does not work ! (shame)
              When i active the window all the mouseclicks i did while the Window was disabled are in the cue again.

              Michael

              Comment


              • #8
                michael, do you play snooker?

                in a nut shell to prevent all those mouse messages from getting queued up create an little window with the style ws_ex_transparent and no border or caption then do a setcapture on it. now all mouse input will go to that window instead of your dialog box. once your calculation is complete, you can releasecapture and destroy the invisible window.

                the callback function for the invisible window does nothing except call defwindowproc, so your mouse and keyboard messages are deliciously eaten.
                however, this method is extremely nonmultitasking-aware for your application but setcapture will still let other applications run normally, as long as you did not setcapture in response to a wm_lbuttondown message.

                i have posted a working example. i don't invent these things, just find them!

                http://www.powerbasic.com/support/pb...ad.php?t=22539

                if you need more details send me a quick email and i will give you a page worth from the article.


                regards, jules
                mailto:[email protected][email protected]</a>




                [this message has been edited by jules marchildon (edited january 06, 2000).]
                Best regards
                Jules
                www.rpmarchildon.com

                Comment


                • #9
                  Cute solution Jules, but for Micheal's application it is like using a sledgehammer to crack a walnut

                  I don't really see why Michael is trying so hard to fight the way Windows and Windows applications should operate. By "clearing" the message queue instead of permitting the message queue to function normally will make his window appear unresponsive and will probably not repaint is the window is covered and then uncovered by another app or window. Additionally, the speed impact on his app would be almost unmeasurable unless, for example, his WM_PAINT handler is terribly slow.

                  A "better" solution would be to perform the processing in a separate thread, which can send a private notification to the window procedure to signal when the "processing" is complete. This is typically how a "normal" application would be constructed.

                  My 1% of $2.00.

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

                  Comment

                  Working...
                  X