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. COM
  4. Can't bring to top a specific "Microsoft Word" window

Can't bring to top a specific "Microsoft Word" window

Scheduled Pinned Locked Moved COM
helptutorial
2 Posts 1 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.
  • N Offline
    N Offline
    nadzzz
    wrote on last edited by
    #1

    Hi everyoone, I made a function that bring any window of any application to top. But I have a issue with the Microsoft Word application. When I have many Word application running and I want one of them (specific) on the top of the Z-order, it's allways the same instance of word that come on top. I looked their window handle and there all different. Example : (doc1) (doc2) (doc3) If I want doc3, it's doc1 that will prompted on top. A Work around is that if a press the alt key after the issue operation, the right instance of word come on top of the Z-Order. Some of functions that I tryed to do that operation: ::SetActiveWindow( oSelectedApp.GetWindow() ); ::SetForegroundWindow( oSelectedApp.GetWindow() ); ::ShowWindow( oSelectedApp.GetWindow(), SW_SHOW ); ::SetWindowPos( oSelectedApp.GetWindow(), HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW ); I seen this problem only for Microsoft Word application. Sébastien Nadeau Software Developper

    N 1 Reply Last reply
    0
    • N nadzzz

      Hi everyoone, I made a function that bring any window of any application to top. But I have a issue with the Microsoft Word application. When I have many Word application running and I want one of them (specific) on the top of the Z-order, it's allways the same instance of word that come on top. I looked their window handle and there all different. Example : (doc1) (doc2) (doc3) If I want doc3, it's doc1 that will prompted on top. A Work around is that if a press the alt key after the issue operation, the right instance of word come on top of the Z-Order. Some of functions that I tryed to do that operation: ::SetActiveWindow( oSelectedApp.GetWindow() ); ::SetForegroundWindow( oSelectedApp.GetWindow() ); ::ShowWindow( oSelectedApp.GetWindow(), SW_SHOW ); ::SetWindowPos( oSelectedApp.GetWindow(), HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW ); I seen this problem only for Microsoft Word application. Sébastien Nadeau Software Developper

      N Offline
      N Offline
      nadzzz
      wrote on last edited by
      #2

      Microsoft as the property that many application is launch by the same process. Only one process "WINWORD.exe" but many instance of word in the Task Manager application list.

      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