Matt
Mon Feb 06 08:32:41 CST 2006
Jugoslav Dujic wrote:
> yogpjosh@gmail.com wrote:
> | Hello Alll,
> | I am learning windows programming and getting confused more and more..
> | here is my latest confusion...
> | What is the relation between processId (which we come to know from the
> | task manager) and hInstance (which is one of the parameter passed in
> | the winmain function) of a program?
> |
> | Or there isn't any relation at all? if yes..why? as both give us the
> | unique number related to a running program..
>
> To summarize:
> HINSTANCE = HMODULE is the "module handle". Although a handle, generally,
> is an opaque thingo, in this case it physically represents the address
> in process's address space where a module (.exe or .dll) is loaded. (Not
> that you should rely on that piece of data).
According to this article by Raymond Chen you can rely on it:
http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx
Matt