GetModuleHandle

win32api/getmodha.txt 19-Apr-00
http://members.xoom.com/n_s_wong
http://www.angelfire.com/ns/nswong

_DLL FUNC GetModuleHandle(pszModule AS PSZ) ;
  AS DWORD PASCAL:KERNEL32.GetModuleHandleA#238

I just tested by running Try.exe first, then follow by
Test.exe. Even though Try.exe still running, but Test.exe
cannot detect it.

Try.exe //Result =="ptrModule!=NULL_PTR"
-------
PROCEDURE Start()
  LOCAL ptrModule AS PTR, cMessage AS STRING
  ptrModule:=GetModuleHandle(String2Psz("Try.exe"))
  cMessage:=IIf(ptrModule==NULL_PTR,"ptrModule==NULL_PTR",;
    "ptrModule!=NULL_PTR")
  MessageBox(NULL,String2Psz(cMessage),;
    String2Psz("Try.exe"),0)
RETURN

Test.exe //Result =="ptrModule==NULL_PTR"
--------
PROCEDURE Start()
  LOCAL ptrModule AS PTR, cMessage AS STRING
  ptrModule:=GetModuleHandle(String2Psz("Try.exe"))
  cMessage:=IIf(ptrModule==NULL_PTR,"ptrModule==NULL_PTR",;
    "ptrModule!=NULL_PTR")
  MessageBox(NULL,String2Psz(cMessage),;
    String2Psz("Test.exe"),0)
RETURN

