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#
  4. How to birng to top an application?

How to birng to top an application?

Scheduled Pinned Locked Moved C#
tutorialhelpquestion
4 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.
  • I Offline
    I Offline
    Ivan Fernandez
    wrote on last edited by
    #1

    Hello, I'm trying to bring to top an application. I followed several examples that I've founded but it doesn't work. I have the instance of my application registered in the computer and I have access to it via Remoting. I've got a method (ShowMyWindow) that I want to call to show the main window of my application: public void ShowMyWindow() { if (IsIconic(hWnd)) { ShowWindowAsync(hWnd, 3); } SetForegroundWindow(hWnd); } Now, for example, I've got a instance of my application running in my computer and I try to execute another one from the console. I obtain the already running instance and execute the ShowMyWindow method. The problem is that the result of this is I've got the console window on top and the icon of my application flashing in the task bar (I want to show it a the top of my screen!!!!!:mad:) Instead, if my application is minimized, it works.... Any suggestion??? Thanks, Iván Fernández

    V 1 Reply Last reply
    0
    • I Ivan Fernandez

      Hello, I'm trying to bring to top an application. I followed several examples that I've founded but it doesn't work. I have the instance of my application registered in the computer and I have access to it via Remoting. I've got a method (ShowMyWindow) that I want to call to show the main window of my application: public void ShowMyWindow() { if (IsIconic(hWnd)) { ShowWindowAsync(hWnd, 3); } SetForegroundWindow(hWnd); } Now, for example, I've got a instance of my application running in my computer and I try to execute another one from the console. I obtain the already running instance and execute the ShowMyWindow method. The problem is that the result of this is I've got the console window on top and the icon of my application flashing in the task bar (I want to show it a the top of my screen!!!!!:mad:) Instead, if my application is minimized, it works.... Any suggestion??? Thanks, Iván Fernández

      V Offline
      V Offline
      Valeria Bogdevich
      wrote on last edited by
      #2

      Did you try BringWindowToTop instead of SetForegroundWindow?


      "...hasn't really been well accepted ... as the ratings tell us so far :)" - Nishant S

      I 1 Reply Last reply
      0
      • V Valeria Bogdevich

        Did you try BringWindowToTop instead of SetForegroundWindow?


        "...hasn't really been well accepted ... as the ratings tell us so far :)" - Nishant S

        I Offline
        I Offline
        Ivan Fernandez
        wrote on last edited by
        #3

        Yes, I tried but it doesn't work anyway... Iván Fernández

        V 1 Reply Last reply
        0
        • I Ivan Fernandez

          Yes, I tried but it doesn't work anyway... Iván Fernández

          V Offline
          V Offline
          Valeria Bogdevich
          wrote on last edited by
          #4

          :confused: It's strange, because "The BringWindowToTop function brings the specified window to the top of the Z order"


          "...hasn't really been well accepted ... as the ratings tell us so far :)" - Nishant S

          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