wait-for close of logwin

I would like to run Prolint from our own application (not through desktop.w).
Actually, our application will start a new progress-session with propath and db's prepared and with a startup-procedure which runs Prolint.
What would be the best way to program the "wait-for close of logwin"? So I can quit the progress-session (without getting an editor).

I now first start the logwin persistent and wait-for close of it, but when I go to the desktop (btn_desktop), close the logwin and then close the desktop. I get an error that the handle of the wait-for is no longer valid, and a restart of the procedure.

So how would I programm this?

As a workaround I have now added a procedure to logwin.w to disable the desktop-button which an external procedure can run.