1. #1
    Scarab Lord Djinni's Avatar
    10+ Year Old Account
    Join Date
    May 2009
    Location
    West Sussex, UK
    Posts
    4,232

    How to fool a program into thinking its the active window

    How can I fool a program into thinking it's the active window?

    OS: Win 7 Pro 64-bit
    Programs of interest: VMWare Player, Plants vs Zombies

    To clarify I mean this function:
    Active Window
    An active window is the top-level window of the application with which the user is currently working. To allow the user to easily identify the active window, the system places it at the top of the z-order and changes the color of its title bar and border to the system-defined active window colors. Only a top-level window can be an active window. When the user is working with a child window, the system activates the top-level parent window associated with the child window.
    Only one top-level window in the system is active at a time. The user activates a top-level window by clicking it (or one of its child windows), or by using the ALT+ESC or ALT+TAB key combination. An application activates a top-level window by calling the SetActiveWindow function. Other functions can cause the system to activate a different top-level window, including SetWindowPos, DeferWindowPos, SetWindowPlacement, and DestroyWindow. Although an application can activate a different top-level window at any time, to avoid confusing the user, it should do so only in response to a user action. An application uses the GetActiveWindow function to retrieve a handle to the active window.
    When the activation changes from a top-level window of one application to the top-level window of another, the system sends a WM_ACTIVATEAPP message to both applications, notifying them of the change. When the activation changes to a different top-level window in the same application, the system sends both windows a WM_ACTIVATE message.
    http://msdn.microsoft.com/en-us/libr...5).aspx#active

    If possible I'd rather not disable the function completely, it seems pretty darn useful. Just want to fool these two programs into thinking they are always active. (being ontop isn't a problem as they can be used on a different screen.)
    Last edited by Djinni; 2011-11-22 at 08:35 AM.

  2. #2
    As far as I know, you can't. Active Window is a keystone in the Windows OS functionality. I'm guessing this leads back into your virtual PC for your second screen, and I'm thinking that while you're running Windows you're going to be S.O.O.L.
    5800X | XFX 7900XTX | Prime X570 Pro | 32GB | 990Pro + SN850 2TB | Define 7

  3. #3
    Scarab Lord Djinni's Avatar
    10+ Year Old Account
    Join Date
    May 2009
    Location
    West Sussex, UK
    Posts
    4,232
    Quote Originally Posted by FlawlessSoul View Post
    As far as I know, you can't. Active Window is a keystone in the Windows OS functionality. I'm guessing this leads back into your virtual PC for your second screen, and I'm thinking that while you're running Windows you're going to be S.O.O.L.
    It did occur to me that it could solve that issue too :P (hence the multitude of edit's on the original post) But no... PvZ is starting to annoy me :P Since when doing the mini-game "Last Stand" I don't really need to pay much attention. And I like browsing the web while playing games.... hence running just about every game in windowed mode.

  4. #4
    So you need to get PvZ as active window so it doesn't pause?
    5800X | XFX 7900XTX | Prime X570 Pro | 32GB | 990Pro + SN850 2TB | Define 7

  5. #5
    Scarab Lord Djinni's Avatar
    10+ Year Old Account
    Join Date
    May 2009
    Location
    West Sussex, UK
    Posts
    4,232
    Plants vs. Zombies
    And all PopCap Games pause when they are no longer the active window apparently.
    As far as "Game Hacks" go... it's not exactly rated, synced online, extremely competitive, or anything like that :P Can't see it having too many "Safeguards" preventing an injection.

    And yeah h+ that's what I need.
    By the way what is "S.O.O.L"?

  6. #6
    Deleted
    Quote Originally Posted by Djinni View Post
    And all PopCap Games pause when they are no longer the active window apparently.
    As far as "Game Hacks" go... it's not exactly rated, synced online, extremely competitive, or anything like that :P Can't see it having too many "Safeguards" preventing an injection.

    And yeah h+ that's what I need.
    By the way what is "S.O.O.L"?
    Shit out of luck.

  7. #7

    You can't

    the easiest way to achieve this would be to hack the game so that it doesn't have this type of behavior. They might have a registry somewhere that does this, but from Window's perspective, it's one of those things that is OS behavior.

    As a reference, I am a developper on a product that runs into this a lot, and we have been forced to conform to windows, and not the other way around.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •