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. Find window and click a button there?

Find window and click a button there?

Scheduled Pinned Locked Moved C / C++ / MFC
jsontutorialquestion
3 Posts 3 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.
  • 9 Offline
    9 Offline
    9ine
    wrote on last edited by
    #1

    There is a message box window and I need to find it among the other Win windows, should bi FindWindow to search for its specfic "title" and then it has 2 buttons in it "Cancel" and "Ok" I need to send a message button_click to one of them. How to find that message box window by its title, find the handles of the "Ok" and "Cancel" buttons and send a message to one of them? I dont remember all the windows API for this

    9ine

    T 1 Reply Last reply
    0
    • 9 9ine

      There is a message box window and I need to find it among the other Win windows, should bi FindWindow to search for its specfic "title" and then it has 2 buttons in it "Cancel" and "Ok" I need to send a message button_click to one of them. How to find that message box window by its title, find the handles of the "Ok" and "Cancel" buttons and send a message to one of them? I dont remember all the windows API for this

      9ine

      T Offline
      T Offline
      tanvon malik
      wrote on last edited by
      #2

      HWND hwndParent = FindWindow(NULL, "title"); HWND hwndOK = FindWindowEx(hwndParent , NULL, NULL, "OK"); SendMessage(hwndOK, BM_CLICK , 0,0);

      tanvon I Blog here my VC++ My all articles at codeproject here

      L 1 Reply Last reply
      0
      • T tanvon malik

        HWND hwndParent = FindWindow(NULL, "title"); HWND hwndOK = FindWindowEx(hwndParent , NULL, NULL, "OK"); SendMessage(hwndOK, BM_CLICK , 0,0);

        tanvon I Blog here my VC++ My all articles at codeproject here

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Or post/send message to hwndParent, WM_COMMAND, IDOK, or IDCANCEL.

        Truth is the subjection of reality to an individuals perception

        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