Jump to content

Impossible Task


this-is-me
 Share

Recommended Posts

I have one of those patented "need obscure functionality" situations. (jk for Jon)

For those who will try to help me on this one, I hope you have Windows XP. For those who have Windows XP Home and not Pro, then to get the following script to work you may have to go to the control panel>users, click on change the way users log on, and uncheck use the welcome screen.

Here's the situation: I need to "add" a control to the Windows XP Shutdown box. The way I plan to do that is to have a borderless window appear "on top" of the shutdown dialog when it comes up. I have this functionality worked out using this script:

#include <guiconstants.au3>
While 1
    If WinExists("Shut Down Windows") Then
        $hndl = WinGetHandle("Shut Down Windows")
        $x = GUICreate("test", 500, 300, -1, -1, $WS_POPUP, -1, $hndl)
        GUISetState(@SW_SHOWNOACTIVATE)
        Sleep(50000)
    EndIf
Wend

The problem is that when the window recieves focus, the shutdown dialog immediately disappears. Is there a way by window styles or by dllcall to make a window that does not recieve focus (non-activatable)?

Who else would I be?
Link to comment
Share on other sites

EDIT: I found a solution:

#include <guiconstants.au3>
$WS_EX_NOACTIVATE = 0x08000000
While 1
    If WinExists("Shut Down Windows") Then
        $hndl = WinGetHandle("Shut Down Windows")
        $x = GUICreate("test", 500, 300, -1, -1, $WS_POPUP, $WS_EX_NOACTIVATE)
        GUISetState(@SW_SHOWNOACTIVATE)
        WinSetOnTop($x, "", 1)
        Sleep(50000)
    EndIf
Wend
Edited by this-is-me
Who else would I be?
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...