Jump to content

Kiosk mode question: how to make taskbar visible?


qwert
 Share

Recommended Posts

I have an application that operates in kiosk mode, so that the Shell_TrayWnd is not normally visible (although it is running, of course). Basically, the application runs "on top of" all other windows. However, I occasionally need to bring the taskbar to the front. I've tried running a script with each of the following three commands without success:

ControlShow("Classname=Shell_TrayWnd", "", "Shell_TrayWnd)
WinSetOnTop("Classname=Shell_TrayWnd", "", 1)
WinSetState("Classname=Shell_TrayWnd", "", 1)
While the script executes, the taskbar is visible, but the moment the script ends, the taskbar disappears and only the kiosk application remains on the screen. I've added a GetWinHandle just to confirm that I'm addressing the correct control. I've looked at other examples on the forum and can't understand what is different for my case. Is there another control that needs to be set as well?

Any help will be appreciated.

Update: I added a WinActivate step to give the taskbar focus -- so it stays on the screen after the script ends. But it disappears when the application window is clicked on. What is now missing, it would seem, is a command to lock the taskbar. Would anyone happen to know how to do that?

Edited by qwert
Link to comment
Share on other sites

When you have more windows with OnTop atribute only last one is really OnTop over others OnTop windows.

So try to set up OnTop on TaskBar as last (first set OnTop to OFF and then set OnTop to ON)

WinSetOnTop("Classname=Shell_TrayWnd", "", 0)
WinSetOnTop("Classname=Shell_TrayWnd", "", 1)
;ControlShow("Classname=Shell_TrayWnd", "", "Shell_TrayWnd)
;WinSetState("Classname=Shell_TrayWnd", "", 1)
Link to comment
Share on other sites

When you have more windows with OnTop atribute only last one is really OnTop over others OnTop windows.

So try to set up OnTop on TaskBar as last (first set OnTop to OFF and then set OnTop to ON)

Thanks for the response. I tried what you suggested, but the taskbar still disappears when the application gains focus with the first mouse click. Some type of lock must be required. Any ideas?

Update: Upon inspecting the styles of Shell_TrayWnd I found that it is, in fact, a child window -- but of what parent? So it must be the parent that needs to be set On Top.

Edited by qwert
Link to comment
Share on other sites

Thanks for the response. I tried what you suggested, but the taskbar still disappears when the application gains focus with the first mouse click. Some type of lock must be required. Any ideas?

Update: Upon inspecting the styles of Shell_TrayWnd I found that it is, in fact, a child window -- but of what parent? So it must be the parent that needs to be set On Top.

is it possible to resize the kiosk window so it doesn't cover the taskbar as long as you need access, then resize it back to fullscreen when you're done? If you're dealing with two "always on top" windows, I don't think it's possible to have one be "always, always on top" (that is, above other always on top windows when they have focus)...at least I've never seen one (even task manager).

Other than that, have your script check the window that's currently got focus, and if it's the kiosk program, re-activate the taskbar. This would require your script NOT to exit until you're done needing access to the taskbar.

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

If you're dealing with two "always on top" windows, I don't think it's possible to have one be "always, always on top" (that is, above other always on top windows when they have focus)...at least I've never seen one (even task manager).

You make a good point. Although I don't what to have to resize the application, I'll look at adjusting its OnTop status so the taskbar prevails. Thanks for the suggestions.

Link to comment
Share on other sites

I think I've discovered the root problem.

The kiosk application is running as a Popup window (i.e., style setting includes @WS_POPUP). It is probably the case that, internally, windows places a popup above everything else, so there won't be a way to make the taskbar continually visible. I'll have to reconsider the window resize method suggested earlier.

Update: I have achieved what I intended by sizing the kiosk application window ("popup" style). But I am left with these two perplexing conditions:

One: The kiosk window can be longer than the top of the taskbar by 20 pixels or so -- as long as it does not reach the bottom of the screen, in which case taskbar will disappear. (Is there a "rule" for this somewhere?)

Two: I have another small application that sets itself "always on top" -- and it can successfully reside on top of the kiosk application. So can the Auto3Info application. This means my assumption about popups being processed in some special way is not valid.

This leads me back to my earlier question: what window setting can result in the taskbar always being on top? (i.e., just like Auto3Info) Anyone have any ideas?

Edited by qwert
Link to comment
Share on other sites

Hi, Have you tried using win api call SetWinPos to set the attribute to the kiosk sotware Z order?

Func Topmost($hWnd)
    ;$hWnd = handle to window
    ;$HWND_TOPMOST = -1
    ;$SWP_NOMOVE + $SWP_NOSIZE + $SWP_SHOWWINDOW = 0x43
    DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hWnd, "hwnd", -1, "int", 0,  "int", 0, _
                                                                    "int", 0, "int", 0, "int", 0x43)
EndFunc

Func NotTopmost($hWnd)
    ;$hWnd = handle to window
    ;$HWND_NOTOPMOST  = -2
    ;$SWP_NOMOVE +$SWP_NOSIZE +$SWP_SHOWWINDOW = 0x43
    DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hWnd, "hwnd", -2, "int", 0,  "int", 0, _
                                                                    "int", 0, "int", 0, "int", 0x43)
EndFunc
You can find the _WinAPI_SetWindowPos() in the udf section of WinAPI Management section of the help file.

You could also maybe look at _WinAPI_GetWindowLong() and _WinAPI_SetWindowLong() in combination with the above function to get around your kiosk software behaving as you'd like with your taskbar.

Cheers

Link to comment
Share on other sites

Hi, Have you tried using win api call SetWinPos ...

Thanks for the response. My search did lead me (finally) to a note on the support.microsoft.com site that contained the following VBS code to show/hide taskbar:

Const TOGGLE_HIDEWINDOW = &H80

Const TOGGLE_UNHIDEWINDOW = &H40

Function HideTaskbar()

handleW1 = FindWindowA("Shell_traywnd", "")

Call SetWindowPos(handleW1, 0, 0, 0, 0, 0, TOGGLE_HIDEWINDOW)

End Function

Function UnhideTaskbar()

Call SetWindowPos(handleW1, 0, 0, 0, 0, 0, TOGGLE_UNHIDEWINDOW)

End Function

I've duplicated it in AutoIt3 and it appears to work just fine. I'll integrate it with the kiosk application tomorrow and hope to be able to toggle the task bar, as needed, from inside that application.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...