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. Switching between applications

Switching between applications

Scheduled Pinned Locked Moved C / C++ / MFC
c++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.
  • T Offline
    T Offline
    techysavvy
    wrote on last edited by
    #1

    Hi folks.... How do we switch the focus to another application using its filename in VC++??? heeellllpppp:confused: Pooja

    _ 1 Reply Last reply
    0
    • T techysavvy

      Hi folks.... How do we switch the focus to another application using its filename in VC++??? heeellllpppp:confused: Pooja

      _ Offline
      _ Offline
      __Cerb
      wrote on last edited by
      #2

      HWND hwnd = ::FindWindow(NULL,"Program name"); ::PostMessage(hwnd,WM_SETFOCUS,0,0); This should do it. ~Michael

      T 1 Reply Last reply
      0
      • _ __Cerb

        HWND hwnd = ::FindWindow(NULL,"Program name"); ::PostMessage(hwnd,WM_SETFOCUS,0,0); This should do it. ~Michael

        T Offline
        T Offline
        techysavvy
        wrote on last edited by
        #3

        Hey thanx...:cool: this code works better: CWnd *pWnd = FindWindow(NULL,”My Application”); pWnd->SetForegroundWindow();

        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