Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. WM_COPYDATA not received by SDI application

WM_COPYDATA not received by SDI application

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 2 Posters 0 Views 1 Watching
  • 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.
  • R Offline
    R Offline
    rp_suman
    wrote on last edited by
    #1

    I am getting valid HWND of another SDI application using FindWindow and sending message "WM_COPYDATA". But OnCopyData is not called at the receiving application. What could be the reason for WM_COPYDATA not received? Regards

    -- "Programming is an art that fights back!"

    A 1 Reply Last reply
    0
    • R rp_suman

      I am getting valid HWND of another SDI application using FindWindow and sending message "WM_COPYDATA". But OnCopyData is not called at the receiving application. What could be the reason for WM_COPYDATA not received? Regards

      -- "Programming is an art that fights back!"

      A Offline
      A Offline
      Aescleal
      wrote on last edited by
      #2

      The first question to resolve is... - what window are you sending the WM_COPYDATA to? If you do a FindWindow on an MFC SDI application by windows title you will find you've got the handle of the CMainFrame derived window, not the view window where generally all the interesting I/O happens. One really clean way of using WM_COPYDATA is to create a "data copy target" window who's sole job is to recieve and process WM_COPYDATA. This window will be invisible and/or off screen so no one can interact with it. Cheers, Ash

      R 1 Reply Last reply
      0
      • A Aescleal

        The first question to resolve is... - what window are you sending the WM_COPYDATA to? If you do a FindWindow on an MFC SDI application by windows title you will find you've got the handle of the CMainFrame derived window, not the view window where generally all the interesting I/O happens. One really clean way of using WM_COPYDATA is to create a "data copy target" window who's sole job is to recieve and process WM_COPYDATA. This window will be invisible and/or off screen so no one can interact with it. Cheers, Ash

        R Offline
        R Offline
        rp_suman
        wrote on last edited by
        #3

        Thanks for the help!! I've resolved the problem, I forget to give the size of data to be sent: cpds.cbData = _tcslen(csData) + 1; . Also if the receiving application runs in IDE(Running as Admin), and the sending application launched externally(Normal mode), then sending copydata message failed and GetLastError() returns "Access denied". So the sending application must have same or higher credentials as the receiving application. Regards

        -- "Programming is an art that fights back!"

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups