Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/18/2017 in all areas

  1. You need to remove the code that disabled it and add an event for the close #include <misc.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <GUIMenu.au3> Opt("GUIOnEventMode", 1) Global $gui Func _Main() $gui = GUICreate("hidecard", 100, 100, @DesktopWidth - (700 + 100), @DesktopHeight - (700 + 100), -1, $WS_EX_TOOLWINDOW) GUISetOnEvent($GUI_EVENT_CLOSE, 'button2') $button1 = GUICtrlCreateButton("stop", 5, 65, 40, 20) GUICtrlSetOnEvent(-1, "Button1") $button2 = GUICtrlCreateButton("Off", 50, 65, 40, 20) GUICtrlSetOnEvent(-1, "Button2") ; disable close button ;~ $hMenu = _GUICtrlMenu_GetSystemMenu($gui) ;~ _GUICtrlMenu_EnableMenuItem($hMenu, $SC_CLOSE, $MF_GRAYED, 0) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 200, "long", 0x00040008); slide-in WinSetOnTop($gui, "", 1) ; it's better to use the window hwnd, it's safer and faster than using the window title TraySetState() GUISetState() EndFunc _Main() Func button2() Exit EndFunc Func button1() GUISetState(@SW_HIDE, $gui) Sleep(5000) ; 5000 miliseconds = 5 secs GUISetState(@SW_SHOW, $gui) EndFunc While 1 Sleep(10) WEnd
    1 point
  2. ...another one (just for fun) not very within the AutoIt realm. It relies on Javascript. (pheraps it can be optimized using the ScriptControl & Javascript, but I'm not skilled with it.) Global $oIE, $ohJS _JS_Environment() ; setup the Javascript environment to be used within AutoIt Global $oEntity = $ohJS.he ; create a reference to the Javascript Entity encode/decode engine. ; See here: https://github.com/mathiasbynens/he/blob/master/README.md ; Example of use Local $string = "Uncle Tom&#039;s Cabin is a novel written by Harriet Beecher Stowe" & @CRLF & _ "Uncle Tom&apos;s Cabin is a novel written by Harriet Beecher Stowe" & @CRLF & _ "Hello this is a &spades; and this is a &equiv; or a &gamma; and a &Atilde; or &iacute;" MsgBox(0, "Debug he.js", $oEntity.decode($string)) ; https://dev.w3.org/html5/html-author/charref $string = "&#x1D538;&#x1D566;&#x1D565;&#x1D560;&#x1D540;&#x1D565; &#x0260E; &spades; &clubs; &hearts; &diams; &female; &male;" & @CRLF & _ "&#x02554;&boxH;&boxH;&boxH;&boxH;&#x02557;" & @CRLF & _ "&boxVR;&boxH;&boxH;&boxH;&boxH;&boxVL;" & @CRLF & _ "&#x0255A;&boxH;&boxH;&boxH;&boxH;&boxUL;" MsgBox(0, "Debug he.js", $oEntity.decode($string)) Func _JS_Environment() ; setup Javascript engine with also embeded the "entity" library ; This is a robust HTML entity encoder/decoder written in JavaScript. (see here: https://github.com/mathiasbynens/he) Local $sJScript = BinaryToString(InetRead("https://raw.githubusercontent.com/mathiasbynens/he/master/he.js")) ; *** create a minimal 'html' page listing for the browser Local $sHTML = "<HTML><HEAD>" & @CRLF $sHTML &= "<script>" & @CRLF ; Javascripts goes here ; $sHTML &= '"use strict";' & @CRLF ; $sHTML &= 'var JSglobal = (1,eval)("this");' & @CRLF ; the 'global' variable get a handle to the javascript global object $sHTML &= $sJScript & @CRLF ; #include <he.js> ; include the entity library $sHTML &= "</script>" & @CRLF $sHTML &= "</HEAD></HTML>" & @CRLF ; html closing tags ; *** end of html page listing $oIE = ObjCreate("Shell.Explorer.2") ; a BrowserControl engine GUICreate("", 10, 10, @DesktopWidth + 10, @DesktopHeight + 10) ; place the gui out of screen GUICtrlCreateObj($oIE, 0, 0, 10, 10) ; this render $oIE usable GUISetState(@SW_HIDE) ; hide GUI $oIE.navigate('about:blank') While Not String($oIE.readyState) = 'complete' ; wait for about:blank Sleep(100) WEnd $oIE.document.Write($sHTML) ; inject lising directly to the HTML document: $oIE.document.close() ; close the write stream $oIE.document.execCommand("Refresh") ; this waits till the document is ready to be used (portion of code from IE.au3) While Not (String($oIE.readyState) = "complete" Or $oIE.readyState = 4) Sleep(100) WEnd While Not (String($oIE.document.readyState) = "complete" Or $oIE.document.readyState = 4) Sleep(100) WEnd ; https://msdn.microsoft.com/en-us/library/52f50e9t(v=vs.94).aspx $ohJS = $oIE.document.parentwindow.JSglobal ; $ohJS is a reference to the javascript Global Obj ; ---- now the javascript engine can be used in our AutoIt script using the $ohJS reference ---- EndFunc ;==>_JS_Environment
    1 point
  3. * locked due to unresponsiveness in the other thread you posted under a different account. Both accounts will be incapable of posting until you send me a PM and explain what happened here. Jos
    1 point
  4. benners

    Button click, need help

    This changes the text to on or off on each click. If you want stuff to run just add it in the "if then else" part #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=f:\cabal.kxf $Practice = GUICreate("Practice", 278, 848, 0, 7, $GUI_DOCKSIZE) GUISetBkColor(0x000000) WinSetTrans($Practice, "", 190) $Exit = GUICtrlCreateButton("Exit", 188, 8, 75, 25) $On = GUICtrlCreateButton("On", 8, 8, 75, 25) GUICtrlSetBkColor($On, 0xffff00) GUICtrlCreateInput("", 82, 10, 30, 21) $Enter = GUICtrlCreateButton("Enter", 8, 70, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Exit Exit Case $On If GUICtrlRead($On) = 'On' Then GUICtrlSetData($On, 'Off') Else GUICtrlSetData($On, 'On') EndIf EndSwitch WEnd
    1 point
  5. 2017-Jun-18, Changelog v10 > v11 Fixed - Error in Report thumbnails cached in DB Fixed - Single quote ' in filenames led to errors in report Fixed - Win XP compatibility Updated - Improved file and duplicates search speed Updated - Lots of other small bug fixes and style changes Updated - SQLite Dll to 3.19.3 Updated - MediaInfo Dll to 0.7.96 Updated - TrID Definitions to version 2017 Jun 15 Source and Executable are available at http://www.funk.eu Best Regards Updated first Post... Enjoy ...
    1 point
×
×
  • Create New...