Announcement

Collapse
No announcement yet.

Getmessage question

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

  • Getmessage question

    Code:
      While GetMessage(Msg,%NULL,0,0)
        Call TranslateMessage(Msg)
        Call DispatchMessage(Msg)
      Wend
    I understand the %WM_KEY,%WM_KEYDOWN,%WM_CHAR are messages that can be trapped here for the control with input focus, but I was wondering what other messages or what other ways of structuring this message loop people have found useful.

    Bob Mechler

  • #2
    I never trap messages in the message loop; I trap them at the destination window.

    If you want a 'system wide' or even a 'thread' thing, you can look at hooks.

    I don't avoid this for any technical reason, I do it for maitenance purposes: the message loop is the message loop is the message loop.

    In your case (" the %WM_KEY,%WM_KEYDOWN,%WM_CHAR are messages that can be trapped here for the control with input focus"), "subclassing" is the LED which turns on when I need to do this.

    YMMV.
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Message Watch Utility

      Bob,

      Check this out in the source code forum.

      I wrote a quick app that allows you to see what messages are being sent through the message loop versus to the dialog procedure directly.

      PowerBASIC and related source code. Please do not post questions or discussions, just source code.
      Chris Boss
      Computer Workshop
      Developer of "EZGUI"
      http://cwsof.com
      http://twitter.com/EZGUIProGuy

      Comment


      • #4
        I concur with the point of leaving it alone (the message loop), unless you have some funky special-needs app.

        There are a multitude of methods to obtain keystrokes: a few are subclassing, superclassing, using a custom control, or keyboard accelerators (see ACCEL in PB help).
        kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

        Comment


        • #5
          Thanks, Chris for the example.

          Bob Mechler

          Comment

          Working...
          X