I just had the same problem and found a workaround bymyself.
Maybe know you or anyone else could be still interested in.
So,what I did was basically:
Add a module with an API function to setthe found window in foreground:
Public Declare Ansi Function SetForegroundWindow Lib "user32.dll" _
Alias "SetForegroundWindow" (ByVal hwnd As IntPtr) As Boolean
Then, I added a timer to my form, set to 1/4 second - just to look if there's a Window wich has that specific Caption ("Password Richiesta"). You must change that string to your language localization, i.e.: "Required Password".
The code inside the timer is:
Private Sub tmrCheck_Tick(ByVal sender As Object, ByVal e As EventArgs) _
Dim hwnd As IntPtr = Window_FindPartialTitle("Password Richiesta")
If hwnd <> IntPtr.Zero Then
Which uses the method:
Private Function Window_FindPartialTitle(ByVal partialTitle As String) _
For Each p As Process In Process.GetProcesses()
If p.MainWindowTitle.IndexOf(partialTitle, 0, StringComparison.CurrentCultureIgnoreCase) > -1 Then
The rest of my code doesn't do much: Shows the files inside the zip and Unzips them to a specified folder.
Hope that someone will find this workaround helpful.