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. How to switch between windows?

How to switch between windows?

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
6 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.
  • M Offline
    M Offline
    missnazar
    wrote on last edited by
    #1

    Hi, When I press a push button on one dialog box ,other dialog box or form should be displayed.How Can I do that? Also please tell me how can we start an application B from other application A( eg. by pressing push button on application A). Drushti

    M B 2 Replies Last reply
    0
    • M missnazar

      Hi, When I press a push button on one dialog box ,other dialog box or form should be displayed.How Can I do that? Also please tell me how can we start an application B from other application A( eg. by pressing push button on application A). Drushti

      M Offline
      M Offline
      Michael P Butler
      wrote on last edited by
      #2

      In the button click event handler, add something like CSecondDialog dlg; dlg.DoModal(); Have a read of CDialog::DoModal[^] for further info. Launching a FormView is slightly more complex, especially in an SDI app - have a read of Switching Views in a Single Document Interface Program[^] Michael CP Blog [^]

      M 1 Reply Last reply
      0
      • M missnazar

        Hi, When I press a push button on one dialog box ,other dialog box or form should be displayed.How Can I do that? Also please tell me how can we start an application B from other application A( eg. by pressing push button on application A). Drushti

        B Offline
        B Offline
        BlackDice
        wrote on last edited by
        #3

        to start another application, use ShellExecute() Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store My articles[^] bdiamond :zzz:

        M 1 Reply Last reply
        0
        • B BlackDice

          to start another application, use ShellExecute() Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store My articles[^] bdiamond :zzz:

          M Offline
          M Offline
          missnazar
          wrote on last edited by
          #4

          Hi bdiamond, How to use Shellexecute to switch to other application in VC++ by just clicling a push button?? Can u please elaborate on this ? Thankyou in advance. Drushti

          B 1 Reply Last reply
          0
          • M Michael P Butler

            In the button click event handler, add something like CSecondDialog dlg; dlg.DoModal(); Have a read of CDialog::DoModal[^] for further info. Launching a FormView is slightly more complex, especially in an SDI app - have a read of Switching Views in a Single Document Interface Program[^] Michael CP Blog [^]

            M Offline
            M Offline
            missnazar
            wrote on last edited by
            #5

            Thakyou Michael :), it really helped in my application. Drsuhti

            1 Reply Last reply
            0
            • M missnazar

              Hi bdiamond, How to use Shellexecute to switch to other application in VC++ by just clicling a push button?? Can u please elaborate on this ? Thankyou in advance. Drushti

              B Offline
              B Offline
              BlackDice
              wrote on last edited by
              #6
               ShellExecute(NULL, "open", "myapplication.exe", NULL, NULL, SW_SHOWNORMAL);
              

              that will open an application and start it called "myapplication.exe", of course you'd have to replace that with the real name of your app. However if an application is already open, you would probably have to use something like FindWindow() to get the window's hWnd, then call SetForegroundWindow() or something like that. Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store My articles[^] bdiamond :zzz:

              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