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. Visual Basic
  4. Active Window

Active Window

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
2 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.
  • S Offline
    S Offline
    szevy_suez
    wrote on last edited by
    #1

    Hi, Is there a way to make a certain application as the active window at certain instance? For example, I want to make another application(such as print etc) as the active window while my application(vb project) is running. Also, is there a way to return the focus to my application for example by a click of certain keystrokes or button? I'm not sure what it is called, but its like controlling the input focus so that it belongs to different application at different instance. I hope you understand what I mean.

    D 1 Reply Last reply
    0
    • S szevy_suez

      Hi, Is there a way to make a certain application as the active window at certain instance? For example, I want to make another application(such as print etc) as the active window while my application(vb project) is running. Also, is there a way to return the focus to my application for example by a click of certain keystrokes or button? I'm not sure what it is called, but its like controlling the input focus so that it belongs to different application at different instance. I hope you understand what I mean.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Kind of. I know where you're going with this ... SendKeys. You can change the active application using VB6's AppActive function. All you need to do is give it the window title that it needs to find. The problem is, you can guarantee it's going to stay there between the time you call AppActivate and SendKeys get's done sending its information. Once your done, to get the focus back to your own app, all you do is call SetFocus on the control on your form that you want the focus sent to. Focus can change at any time, even while you, or SendKeys, is typing in a control. It's maddening when a background service just insists on popping up a warning dialog, or someone has a IM window open, like Yahoo Messenger, and a message comes in, stealing the focus from yours or any other application! Dave Kreskowiak Microsoft MVP - Visual Basic

      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