Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Handle WM_USER message in QT
Forum Update on Monday, May 27th 2025

Handle WM_USER message in QT

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 600 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Karuppu
    wrote on last edited by
    #1

    Hello Everyone,
    I'm new to Qt.
    I would like to create sample Qt c++ program to read barcode with zebra scanner.
    I have sample MFC c++ zebra scanner code, I could able to get barcode with that sample. this MFC C++ code uses PeekMessage and DispatchMessage to read barcode information(WM_USER type). I would like to replicate same kind of Message handling in Qt.
    Please help me to handle WM_USER message in QT.

    Christian EhrlicherC 1 Reply Last reply
    0
    • K Karuppu

      Hello Everyone,
      I'm new to Qt.
      I would like to create sample Qt c++ program to read barcode with zebra scanner.
      I have sample MFC c++ zebra scanner code, I could able to get barcode with that sample. this MFC C++ code uses PeekMessage and DispatchMessage to read barcode information(WM_USER type). I would like to replicate same kind of Message handling in Qt.
      Please help me to handle WM_USER message in QT.

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Use QCoreApplication::installNativeEventFilter() and you will get all windows messages.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      K 2 Replies Last reply
      2
      • Christian EhrlicherC Christian Ehrlicher

        Use QCoreApplication::installNativeEventFilter() and you will get all windows messages.

        K Offline
        K Offline
        Karuppu
        wrote on last edited by
        #3

        @Christian-Ehrlicher Thank you.

        I tried with QCoreApplication::installNativeEventFilter() , but i could not see the WM_USER message in nativeEventFilter() function. I could able to see other messages.

        What I'm missing here?

        1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          Use QCoreApplication::installNativeEventFilter() and you will get all windows messages.

          K Offline
          K Offline
          Karuppu
          wrote on last edited by
          #4

          @Christian-Ehrlicher What param should I pass to installNativeEventFilter() to receive WM_USER message ?

          Christian EhrlicherC 1 Reply Last reply
          0
          • K Karuppu

            @Christian-Ehrlicher What param should I pass to installNativeEventFilter() to receive WM_USER message ?

            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Karuppu said in Handle WM_USER message in QT:

            What param should I pass to installNativeEventFilter() to receive WM_USER message ?

            I don't understand this question - you have to pass a pointer to an event handler.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            K 1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @Karuppu said in Handle WM_USER message in QT:

              What param should I pass to installNativeEventFilter() to receive WM_USER message ?

              I don't understand this question - you have to pass a pointer to an event handler.

              K Offline
              K Offline
              Karuppu
              wrote on last edited by
              #6

              @Christian-Ehrlicher
              Thank you, I could able to receive WM_USER message in native event filter with the help of MFC class.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved