0

I work with Siemens WinCC and it offers the possibility to run simple VBS code. I have managed to open a folder selection window through "BrowseForFolder" but this window is below the SCADA that executes it, which is also executed full screen and should not allow the user going to the desktop (so, go to there and press the folder selection window icon is not an option). Any way to open this window always on top?.

Thankyou for your help.

Dim oFolder, BrowseForFolder
On Error Resume Next 

Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0,MsjInfo,0,0)
     
  If (oFolder Is Nothing) Then
    BrowseForFolder = Empty
  Else 
    BrowseForFolder = oFolder.Self.Path
  End If
SpNav
  • 1
  • Does this answer your question? [Running an hta above all windows](https://stackoverflow.com/a/25795744) – user692942 Sep 07 '22 at 14:45
  • You are not specifying an hWnd, the first parameter. Pass in the hWnd of the containing app. – Lundt Sep 07 '22 at 19:53
  • *Dialog boxes and message boxes are owned windows by default. An application specifies the owner window when calling a function that creates a dialog box or message box.* https://learn.microsoft.com/en-us/windows/win32/winmsg/window-features#owned-windows – Lundt Sep 07 '22 at 20:08
  • @user692942 Your link has nothing to do with this question. The questioner is NOT passing an hwnd to browseforfolder. In Windows dialogs are owned by the main windows. Therefore to work as expected you must pass the hwnd in. Passing an hwnd of 0 means the desktop is the owner. That means the window is treated the same as any application eg notepad. – Lundt Sep 07 '22 at 20:23
  • Thank you both. I'll see if your information helps with my problem!. – SpNav Sep 08 '22 at 06:16
  • @HovercraftFullOfEels Note – Lundt Sep 08 '22 at 09:28
  • @SotiriosDelimanolis Note – Lundt Sep 08 '22 at 09:28

0 Answers0