Jump to content

Recommended Posts

Posted (edited)

By the magnitude of?

Dont think so, you get the same message if you don't have that X.

The event -3 ($GUI_EVENT_CLOSE) will be created with ALT+F4 in this code.

Local $gui = GUICreate(@ScriptName, 135, 0, @DesktopWidth - 135 - 65, _
             -4, $WS_DLGFRAME, _
            $WS_EX_TOPMOST);$WS_DLGFRAME; + $WS_EX_TOOLWINDOW
    GUISetState(@SW_SHOW)
while 1
    switch GuiGetMsg()
        case 0
            sleep(0) ;give up your cpu time slot
        case -3 ;Your asked to close your window/application
            exit
    endswitch
wend
Live and learn. I thought GUIGetMsg() only applied to GUICtrls created in the script

BTW You don't happen to know the control identifier for the "?" button when its used in the GUI do you?

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted

Don't think I have that one --> ? Is it a XP thing?

Do you meen F1 to open a help file?

I think you have to minitor that by using GuiRegisterMsg with WM_HELP (0x0053). Hav not tried thought. :whistle:

Posted

Don't think I have that one --> ? Is it a XP thing?

Do you meen F1 to open a help file?

I think you have to minitor that by using GuiRegisterMsg with WM_HELP (0x0053). Hav not tried thought. :whistle:

No, I know how to use F1.

One of the GUI Styles allows you to include the "What's This?" (Round icon with "?" in the center) button on the title bar but I've never been able to find out how to make it work in AutoIt. Would be great for context sensitive help functions.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted (edited)

Thanx for your help & actyually Im going to use this code, since the other one was bad, since buttons on the GUI2 were not working, well now all works, even the tray menu it was pretty logical actyally:

@ Uten im going to study your posted code tomorrow, wont be able to think outside the box today, too tired today, need my beauty sleep :whistle:

#include <GuiConstants.au3>

$mainwindow = GUICreate("Rater", 300, 100, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$OK = GUICtrlCreateButton("OK", 120, 50, 55, 23)   ;Button OK (left, top , width , height )
$Checkbox = GUICtrlCreateCheckbox ("Also add to list", 60, 10, 200, 20)

;~ Fail Meny START
;~ ---------------------------------------------------------------------------------------------------------
$filemenu = GUICtrlCreateMenu ("&File")
$exititem = GUICtrlCreateMenuitem ("Exit",$filemenu)
$options_menu = GUICtrlCreateMenu ("Options")
$Search_options_Item= GUICtrlCreateMenuitem ("search options",$options_menu)
$Pass_options_Item= GUICtrlCreateMenuitem ("Pass options",$options_menu)
;~ Fail Meny End
;~ ****************************************************************************************************
GUISetState()


;~ Tray MENU
;~ ---------------------------------------------------------------------------------------------------------
$Maximize     = TrayCreateItem("Maximize")
TrayCreateItem("")
$exititem       = TrayCreateItem("Exit")
TraySetState()

$Window_PAss_options = GUICreate("pass Options", 400, 100) ; GUI Window_Search_options
$Button_1B = GUICtrlCreateButton("Check", 10, 20, 140, 40)

$Window_Search_options = GUICreate("Search Options", 400, 100) ; GUI Window_Search_options
$Button_1A = GUICtrlCreateButton("Check", 10, 20, 140, 40)
GUISetState(@SW_HIDE)

Opt("TrayMenuMode",1)   ; Default tray menu items (Script Paused/Exit) will not be shown
While 1
    $msg = GUIGetMsg()
    $msg1 = TrayGetMsg() ; Get trau message
Switch $msg
    Case $OK
        If GUICtrlRead($Checkbox) = $GUI_CHECKED Then ; If Checkbox is selected & pess ok
        MsgBox(0, " ", "Good")
    EndIf
EndSwitch
    
    Select
;~  Tray meny Set on action
;~ ---------------------------------------------------------------------------------------------------------  
    Case $msg1 = $Maximize
        GUISetState(@SW_SHOW,$mainwindow)
        GUISetState(@SW_restore,$mainwindow)
    Case $msg1 = $exititem
        Exit
        
        Case $msg = $exititem Or $msg = $GUI_EVENT_CLOSE
            $Hwnd = WinGetHandle('')
            If $Hwnd = $mainwindow Then                         ;maingui - exit
                 Exit
            ElseIf $Hwnd = $Window_Search_options Then      ; If closed search options window
                 GUISetState(@SW_HIDE,$Window_Search_options)   ; Hide it
                 GUISetState(@SW_DISABLE,$Window_Search_options); & Disable it, may be good for PC usage (maybe )
             
             ElseIf $Hwnd = $Window_PAss_options Then
                 GUISetState(@SW_HIDE,$Window_PAss_options)
             EndIf
;~ Menu $Item_Events
        Case $msg = $Search_options_Item
            GUISetState(@SW_ENABLE,$Window_Search_options)  ; Enable search options window
            GUISetState(@SW_SHOW, $Window_Search_options)   ; & Show it
            
        Case $msg = $Pass_options_Item
            GUISetState(@SW_SHOW, $Window_PAss_options)

        Case $msg = $Button_1A
            MsgBox(0, " ", "Good")
        Case $msg = $Button_1B
            MsgBox(0, " ", "Good")
        
        Case Else
           ;;;
    EndSelect
WEnd
Exit
Edited by chie
Posted

Thanx for your help & actyually Im going to use this code, since the other one was bad, since buttons on the GUI2 were not working, well now all works:

@ GEOSoft im going to study your posted code tomorrow, wont be able to think outside the box today, too tired today, need my beauty sleep :whistle:

Try it whenever you fell like it I could post an actual working peice of code when I get back on my main system. I also seem to remember that I was using ContinueLoop instead of return as I posted earlier. That makes sense because I have already destroyed the second GUI and turned $Msg back to the first. You can get really trick using multi GUI's. I played with one app where I could call 3 different GUI's from the main and each of those could call any of the others so the trik was in getting the handle of the open GUI and then making sure that you GUISwitched to that one.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted

Now I know what your thinking about.

Sorry, don't know how to add it to AutoIt.

Using the extended style $WS_EX_CONTEXTHELP (0x00000400 ) will give you the control but I can't figure out how to make it work. It's more a matter of getting the time to work up a script that will return the message number when I lick on it.

DON'T try it with

GUISetState()

While 1

$Msg = GUIGetMsg()

MsgBox(4096"TEST", $Msg)

Wend

You will spend a lot of time closing MsgBoxes :whistle:

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted

No, I know how to use F1.

One of the GUI Styles allows you to include the "What's This?" (Round icon with "?" in the center) button on the title bar but I've never been able to find out how to make it work in AutoIt. Would be great for context sensitive help functions.

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AForm1", 633, 447, 193, 115, BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $DS_CONTEXTHELP), $WS_EX_CONTEXTHELP)
$Button1 = GUICtrlCreateButton("Ok", 248, 376, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

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
×
×
  • Create New...