Check out gamehandle.cpp, that contains a handle to the game dll. Although I'm not positive that this is what you are after and I'd be more inclined to believe that the handle you require would be for the client.dll. Because the loading of the client.dll is performed by the engine dll whatever reference there exists already to the client dll handle isn't exposed to us. However, I can say with confidence that the name of the module itself is "client.dll" so you can probably use '::GetModule' to find the HMODULE for that. I can't see why not at least. Hope I've been of some help here.

----- Original Message ----- From: <[email protected]>
To: <[email protected]>
Sent: Wednesday, August 25, 2010 5:00 AM
Subject: hlcoders Digest, Vol 30, Issue 14


Send hlcoders mailing list submissions to
[email protected]

To subscribe or unsubscribe via the World Wide Web, visit
http://list.valvesoftware.com/mailman/listinfo/hlcoders
or, via email, send a message with subject or body 'help' to
[email protected]

You can reach the person managing the list at
[email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of hlcoders digest..."


Today's Topics:

  1. Checking for game window focus (Jonathan White)
  2. Re: Checking for game window focus (Tom Edwards)


----------------------------------------------------------------------

Message: 1
Date: Tue, 24 Aug 2010 07:15:44 -0400
From: Jonathan White <[email protected]>
Subject: [hlcoders] Checking for game window focus
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

Hi everyone,

I implemented FMOD in our mod about a month or so ago and it has been
wonderful (after completely rewriting that abysmal wrapper that is on the
VDC, I will post an update on that later I promise). Anyway, FMOD is great, however, it keeps playing sounds/music even when the game is "out of focus," be it alt-tabbed down or simply when playing in a window and you are typing
into firefox for example.

So my question is, is there any easy (read non-hackish) way to detect
whether the game window has focus or not? I am thinking of a function that
only gets called when the window has captured the mouse of the user (I think
i just answered my own question...) but anyway I am just looking for this
elusive entry point to where I can pause/resume my FMOD manager.

P.S. - I am well aware of Win32 functions to do this stuff, but 99.9% of
them require exposure to the underlying win32 framework of the code, of
which, we do not have.

Thanks,
Jon (Killer Monkey)


------------------------------

Message: 2
Date: Tue, 24 Aug 2010 12:53:31 +0100
From: Tom Edwards <[email protected]>
Subject: Re: [hlcoders] Checking for game window focus
To: Discussion of Half-Life Programming
<[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

 There's a function somewhere that captures or releases the mouse based
on whether the window is active.

On 24/08/2010 12:15, Jonathan White wrote:
Hi everyone,

I implemented FMOD in our mod about a month or so ago and it has been
wonderful (after completely rewriting that abysmal wrapper that is on the
VDC, I will post an update on that later I promise). Anyway, FMOD is great, however, it keeps playing sounds/music even when the game is "out of focus," be it alt-tabbed down or simply when playing in a window and you are typing
into firefox for example.

So my question is, is there any easy (read non-hackish) way to detect
whether the game window has focus or not? I am thinking of a function that only gets called when the window has captured the mouse of the user (I think
i just answered my own question...) but anyway I am just looking for this
elusive entry point to where I can pause/resume my FMOD manager.

P.S. - I am well aware of Win32 functions to do this stuff, but 99.9% of
them require exposure to the underlying win32 framework of the code, of
which, we do not have.

Thanks,
Jon (Killer Monkey)
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders





------------------------------

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



End of hlcoders Digest, Vol 30, Issue 14
****************************************




_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to