Jump to content

Making always on top gui


Recommended Posts

hi,

i m trying to make a script that detects removable drive and a gui at the botton right(just above the sys tray). if it detects a removable drive it will pop up that box. It will have no quit, min,max buttons and the bar. I want to display picture in the box too. The box and image size r 150x30

here is a script i've been working on.

while 1

    sleep(500)

    if winactive("Shut Down Windows","")=1 then  detect(); the title of the last window which allow to restart, shutdown ... (french in my case)

WEnd

func detect()

   

   

    $alarme=0

    $listsupport=""

   

    $tab_remov=DriveGetDrive ( "REMOVABLE" ); list all removable devices

    If @error<>1 Then

        For $cpt=1 To $tab_remov[0]            $status=DriveStatus($tab_remov[$cpt])

            If $status="READY" Then

                $alarme=1

                $listsupport=$listsupport&$tab_remov[$cpt]&@CRLF; store the drive where the device is present

            EndIf

        Next

    EndIf

    if $alarme=1 Then

        runwait(@comspec&" /c "&chr(7))

        SplashImageOn("Warning !","splash.bmp",300,200); display a picture

        sleep(1000)

        SplashOff()

        MsgBox(16,"Support(s) oublié(s) !!","Attention au moins support a été oublié:"&@CRLF&$listsupport); list all media forgotten

EndIf

   

EndFunc

this one displays a picture at shut down when there is a removable disk attached

Please help me, Thx :(

Link to comment
Share on other sites

hi,

i m trying to make a script that detects removable drive and a gui at the botton right(just above the sys tray). if it detects a removable drive it will pop up that box. It will have no quit, min,max buttons and the bar. I want to display picture in the box too. The box and image size r 150x30

here is a script i've been working on.

this one displays a picture at shut down when there is a removable disk attached

Please help me, Thx :(

<{POST_SNAPBACK}>

If you're just using messageboxes: 262144 MsgBox has top-most attribute set 0x40000

Option 16+262144 ... or in hex: 0x40010

Msgbox(0x40010,"Title","Text")

Per the GUIConstants file, the topmost attribute in an AutoIt GUI is set by this bit:

Global Const $WS_EX_TOPMOST = 0x00000008

So, add that in to your Extended style during your GUI creation.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

He means something this...

#include <GUIConstants.au3>

GUICreate("Your title", -1, -1, -1, -1, -1, $WS_EX_TOPMOST)
GUISetState (@SW_SHOW)

While 1
    $msg = GUIGetMsg() 
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

That creates a plain GUI window with nothing in it, but it will be the top most window. The "-1" just mean the default settings, but notice the Extended Style Parametre is set to $WS_EX_TOPMOST.

GUICreate ( "title" [, width [, height [, left [, top [, style [, exStyle [, parent]]]]]]] )
Edited by Burrup

qq

Link to comment
Share on other sites

RTM politly said Read The Manual

from help file

GUICreate ( "title" [, width [, height [, left [, top [, style [, exStyle [, parent]]]]]]] )

Parameters

title The title of the dialog box.

width [optional] The width of the window.

height [optional] The height of the window.

left [optional] The left side of the dialog box. By default (-1), the window is centered. If defined, top must also be defined.

top [optional] The top of the dialog box. Default (-1) is centered

style [optional] defines the style of the window. See GUI Control Styles Appendix.

Use -1 for the default style which includes a combination of $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU styles.

Some styles are always included: $WS_CLIPSIBLINGS, and $WS_SYSMENU if $WS_MAXIMIZEBOX or $WS_SIZEBOX is specified.

exStyle [optional] defines the extended style of the window. See the Extended Style Table below. -1 is the default.

parent [optional] The handle of another previously created window - this new window then becomes a child of that window.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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...