Jump to content

Pls! Little help with a script


DataJack
 Share

Recommended Posts

Hi guys and gurus,

I'm pretty new to AutoIt, love it.

I hope it's the right forum to post this!

I'd like some help with a script tho'. Well first, you'll probably tell me if it is possible.

So here's the deal:

I've got some app (Remote Camera viewing software) being run by a script already, some field gets filled also. I'd like to run it fullscreen (That's no problem, there's even a shortcut F11)... Here's the problem tho'. I'm running all this on a touchscreen so there's no way out once in fullscreen mode. Would it be possible to create 2 buttons (pictures preferably, like not in a form(window)), always on top, which would minimize back and/or close the app? Basically, I'd need to create a minimize and close button on top right corner of the screen.

Is it possible?

How bad of a script would it be?

Thanks, your help will be greatly appreciated!!

Link to comment
Share on other sites

  • Moderators

DataJack,

First, welcome to the Autoit forums. :)

Try running this and see if it works. Some apps run with TOPMOST themselves and so overlay the AutoIT GUI. There might be some ways around this - so it would not necessarily be a show-stopper:

#include <WindowsConstants.au3>

$hGUI = GUICreate("InputBox Move Focus Demo", 160, 30, @DesktopWidth - 160, 0, $WS_POPUP, $WS_EX_TOPMOST)

$hButton_Min = GUICtrlCreateButton("Minimise", 0, 0, 80, 30)
$hButton_Exit = GUICtrlCreateButton("Exit", 80, 0, 80, 30)

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $hButton_Min
            ; Send()  ; Whatever key you need to minimise the app
        Case $hButton_Exit
            ; Send()  ; Whatever key you need to close the app
            Exit
    EndSwitch
WEnd

The key will be if you can see the buttons once you have full-screened your app.

M23

Edit: Do you actually need buttons? Would HotKeys be as useful?

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Hi guys and gurus,

I'm pretty new to AutoIt, love it.

I hope it's the right forum to post this!

I'd like some help with a script tho'. Well first, you'll probably tell me if it is possible.

So here's the deal:

I've got some app (Remote Camera viewing software) being run by a script already, some field gets filled also. I'd like to run it fullscreen (That's no problem, there's even a shortcut F11)... Here's the problem tho'. I'm running all this on a touchscreen so there's no way out once in fullscreen mode. Would it be possible to create 2 buttons (pictures preferably, like not in a form(window)), always on top, which would minimize back and/or close the app? Basically, I'd need to create a minimize and close button on top right corner of the screen.

Is it possible?

How bad of a script would it be?

Thanks, your help will be greatly appreciated!!

I am also a newbie, so i can't answer very good, but i think it isn't possible.

but you can make a little gui that contains 2 buttons. like this

#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>

Opt("MustDeclareVars",1)

Function1()

Func Function1()
    Local $Button1,$Button2,$Button3,$Msg
    
    GUICreate("Form1",200,50,@DesktopWidth -200,0,$WS_POPUP)
    ;You can replace this with images, the same thing happen
    $Button1 = GUICtrlCreateButton("Minimize",0,0,100,25) ;You can make the buttons bigger for the touchscreen
    $Button2 = GUICtrlCreateButton("Close",100,0,100,25)
    $Button3 = GUICtrlCreateButton("Close window",0,25,200,25)  
    
    GUISetState()
    
    Do
        GUISetState() ;Set always the window on top
        $Msg = GUIGetMsg()
        If $Msg = $Button1 Then
            ;command to minimize the program
        ElseIf $Msg = $Button2 Then
            ;command to close the program
        ElseIf $Msg = $Button3 Then
            Exit
        EndIf
    Until $Msg = $GUI_EVENT_CLOSE
EndFunc
PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.
Link to comment
Share on other sites

Wow, thanks guys!

I'm trying that as I speak.. well.. type.. Anyway.. I give it a try and give you the news!

(Yes I did needed buttons, as I'm working with touchscreens (no keyboard) and thus there is not a lot hot"keys" I can use!)

Edited by DataJack
Link to comment
Share on other sites

  • 3 weeks later...

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