@Nitzer, Esta bien que te un valor distinto el retorno de la funcion te paso un ejemplo
Código COBOL:
MOVE SPACES TO mPath.
MOVE "Text" OF CmText1 TO mPath.
CALL "FindFirstChangeNotificationA" WITH STDCALL USING BY CONTENT mPath
BY VALUE POW-FALSE
BY VALUE FILE_OR_DETODO *>(127) ES LA SUMA DE LOS FILTROS QUE QUIERO CHEQUEAR
RETURNING Handle.
DISPLAY "Handle" , Handle.
if Handle not = INVALID_HANDLE_VALUE then *>INVALID_HANDLE_VALUE = -1
MOVE POW-TRUE TO "Active" OF CmTimer1 *> ACTIVO EL TIMER PARA MIRAR EL DIRECTORIO
end-if.
luego tenes que llamar a la funcion de espera esto lo estas haciendo ?
Código COBOL:
MOVE ZEROS TO retorno-Watch.
CALL "WaitForSingleObject" WITH STDCALL USING
BY VALUE Handle
BY VALUE Intervalo
RETURNING retorno-Watch
IF retorno-Watch NOT = ZEROS
DISPLAY "retorno-Watch 1 :" , retorno-Watch
END-IF.
Una vez satisfecha la espera, la aplicación puede responder a esta condición y continuar monitoreando el directorio llamando a la función
FindNextChangeNotification y la función de espera correspondiente. Cuando el identificador ya no es necesario, se puede cerrar mediante la función
FindCloseChangeNotification .