Restored from previous forum. Originally posted by ricardo.
Marlov makes me a question about how to get the handle of the window that calls some dll.
Maybe there is an easier way, that mine:
Code: Select all
Global Id
Procedure EnumWindowsProc(hFind, lParam)
Shared Id
Hnd = GetCurrentProcessId_()
Valor.i
GetWindowThreadProcessId_(hFind,@Valor)
If Valor = Hnd
Id = hFind
EndIf
ProcedureReturn 1
EndProcedure
ProcedureDLL GetHandle()
Shared Id
Hnd = GetCurrentProcessId_()
EnumWindows_(@EnumWindowsProc(), 0)
MessageRequester("Handle of the calling window",Str(Id),0)
ProcedureReturn 1
EndProcedure
Just call the GetHandle procedure from an application.
Best Regards
Ricardo
Dont cry for me Argentina...