1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to send messages to external window e.g. MS Paint ?

Discussion in 'Win32' started by unmeshjoshi, Jun 14, 2010.

  1. unmeshjoshi

    unmeshjoshi New Member

    Joined:
    Mar 17, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Hello all,


    I want to automate the operations in MS paint, for that i am using CreateProcess to spwan the Ms paint process, but i cannot send the messages to the paint WINDOW or any menus of the paint window. I could find the handle to the paint window using FindWindow API but after using SendMessage(hwnd,.....), the paint window does not process ANYTHING!!

    What can I do now?
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    There is an issue with you sending the WM_PAINT and many a times Windows cache the view and paint may not be called if Windows does not think that painting is needed.

    I had expereinced the same when you had 3 windows open and many times the third windows paint is not called.

    You can use the erase back ground message and paint will be called automatically
     

Share This Page