Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7502849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:01:02+00:00 2026-05-29T21:01:02+00:00

Not very sure how to explain it in a clear way. Basicaly, the thing

  • 0

Not very sure how to explain it in a clear way. Basicaly, the thing is that I’m looking for a method to change a current active window ( Self-produced def., hope it’ll be understandable enough ) – window, where the text is directly typed right now. Whooh.

What have I allready discovered is msdn help and SetFocus() or SetActiveWindow(), but it doesn’t solve my problem ( or, what is also possible, I’m just using it in a wrong way ).

Simply:

HWND Dest = GetFocus();
... //Some moving around on the 'alt-tab level' :-|
SetFocus(Dest); 

Doesn’t set the Dest window active again.
Please, excuse for the newbie questions, hope it won’t take much time from you. Thanx!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:01:06+00:00Added an answer on May 29, 2026 at 9:01 pm

    SetFocus() does not bring a window to the top. It just sets the keyboard focus.

    SetActiveWindow() on the other hand brings the specific window on top, but only if the application that calls it is also the application that owns it. ( according to the documentation).

    When you say you did try SetActiveWindow() what do you mean? How did it fail? What results did it produce?

    Another function you can try is SetForegroundWindow() in case you want to activate a window belonging to another application but this has its problems as you see from below (directly from the documentation):

    The system restricts which processes can set the foreground window. A
    process can set the foreground window only if one of the following
    conditions is true:

    • The process is the foreground process.
    • The process was started by the foreground process.
    • The process received the last input event.
    • There is no foreground process.
    • The foreground process is being debugged.
    • The foreground is not locked (see LockSetForegroundWindow).
    • The foreground lock time-out has expired (see SPI_GETFOREGROUNDLOCKTIMEOUT in SystemParametersInfo).
    • No menus are active.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The title may not seem very clear - was not sure how to explain
I am very very new to C/C++ and not sure what the method is
I am not very sure with the use of this [current context] in jquery.What
Sorry if the title is not very clear. I was not sure about the
This is a very odd one and I'm not sure how to proceed. Basically,
I am not very familiar with the way of creating a daemon in Python,
Sorry the title is not very clear. This is a follow up to my
I'm not very expert on how processors work, but one might imagine that it
Sorry for the not very descriptive question title. I'm not very sure how to
Hey guys, i'm not sure if was able to explain the at the title,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.