Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/02/2021 in all areas

  1. Hello, this could help you. #include <GuiConstants.au3> #include <WinAPISysWin.au3> #include <GuiMenu.au3> Main() Func Main() Local $hWnd, $iStyle, $hMenu, $aWinPos Run("notepad") $hWnd = WinWait("[Class:Notepad]", "") Sleep(50) ;~ Retrieves the handle of the menu assigned to the given window $hMenu = _GUICtrlMenu_GetMenu($hWnd) ;~ Deletes menu items from the specified menu For $i = _GUICtrlMenu_GetItemCount ($hMenu) - 1 To 0 Step -1 _GUICtrlMenu_RemoveMenu($hMenu, $i) Next ;~ Retrieves style about the specified window $iStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) ;~ Remove title bar $iStyle = BitXOR($iStyle, $WS_POPUPWINDOW) _WinAPI_SetWindowLong($hWnd, $GWL_STYLE, $iStyle) ;~ Refresh window style $aWinPos = WinGetPos($hWnd) WinMove($hWnd, "", $aWinPos[0], $aWinPos[1], $aWinPos[2] + 1) Return 0 EndFunc
    3 points
  2. p4sCh

    SSH UDF

    Hello everyone, I've created a UDF for basic communication with SSH servers. I know there is already such a UDF, but I wasn't satisfied with it for my purpose, so I created a new one. This UDF also acts as a wrapper for the plink executable. Its essential functions are _SSHConnect, _SSHSend, _SSHRecv and _SSHCloseSocket. It does support multiple simultaneous connections and aims to be pretty robust. Feel free to share your opinions Two of the included examples use a slightly modified version of Vintage Terminal by @Chimp Download The download includes ssh.au3 (UDF), plink.exe (necessary), vintage terminal and code examples: Version 1.0.1 - fixed rare _SSHConnect bug where "ssh-host-key prompt" was not answered SSH UDF 1.0.1.zip
    1 point
  3. Hello, AutoIT is my first programming language. However, It's been a long long time from the last minute I used AutoIT. Today, I'm very happy to see that this language is still used by many developers. I want to introduce 3 games I developed in AutoIT more than 5 years ago. - Minichess game: https://github.com/vietanhdev/minichess - Line98: https://github.com/vietanhdev/line98 - TicTacToe: https://github.com/vietanhdev/tic-tac-toe Thank you for creating such a friendly language! And also hope that it can thrive in the future!
    1 point
  4. Look for the "fold.on.open" setting in the SciTE4AutoIt3 Help File under the SciTEDocumentation topic.
    1 point
  5. @Chimp I just added JSglobal as example, you can call moment directly like in your example for that I added Hello function to denote you can call function without eval. Saludos
    1 point
  6. Hi @Danyfirex, you are right, thanks for your debugging. On my pc it worked because that registry key was already set, and so I didn't realize that without that key it doesn't work. while instead using the "browser control" ObjCreate ("Shell.Explorer.2"), it is not necessary to set that registry key, but it is sufficient to set the following directive in the <head> section of the html source: <meta http-equiv="X-UA Compatible" content="IE=11" /> I think that since the "htmlfile" object doesn't render web pages, it doesn't take into account the content = "IE = 11" directive but instead the key value is needed edit: so setting that registry key also at the beginning of my script, it works regularly, without the need to create the variable var JSglobal = (1, eval) ("this"); in the html source and without having to use the javascript eval method.
    1 point
  7. @Chimp You're code does not work for me. So I did a mod. _Example() Func _Example() _SetBroswerEmulation() Local $o_Obj = __HTMLFILEObjCreate() $o_Obj.write('<script src="https://momentjs.com/downloads/moment.min.js"></script>') $o_Obj.write('<script>var JSglobal = (1,eval)("this");</script>') $o_Obj.write('<script>function Hello(arg){return "Hello " + arg;}</script>') Local $oJs=$o_Obj.parentwindow.JSglobal MsgBox(0, "",$oJs.eval("moment().format('MMMM Do YYYY, h:mm:ss a');")) MsgBox(0, "",$oJs.Hello("Danyfirex")) EndFunc ;==>__Example_2 Func _SetBroswerEmulation() Local $sName=@AutoItExe Local $aSplit=StringSplit($sName,"\",1) $sName=$aSplit[$aSplit[0]] RegWrite("HKCU\Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION",$sName,"REG_DWORD",0x2AF9) EndFunc Func __HTMLFILEObjCreate() Local $Object = 0 If IsObj($Object) Then $Object = 0 $Object = ObjCreate("htmlfile") Return $Object EndFunc ;==>__HTMLFILEObjCreate Saludos
    1 point
  8. That is perfect, thank you! I've also been trying it with the DOSBox-X emulator, which seems to rebuild its window when it opens. I've got it working by waiting for the window to appear the first time, then waiting for a second, and then getting the handle of the window by title, after it's been rebuilt. It works perfectly. Thank you again!
    1 point
  9. Didn't think of that, assumed no one would reach the limit, however with that being said, probably just putting the InputBox inside a loop should perform the same task.
    1 point
  10. 1 point
  11. Are you doing something like this? #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <string.au3> #include <array.au3> CreateHtmlPage() Example() Exit Func Example() Local $hGUIMain = GUICreate("Event Test") Local $oIE = ObjCreate("Shell.Explorer.2") Local $hIE = GUICtrlCreateObj($oIE, 0, 0) $oIE.navigate('file:///' & @ScriptDir & '\Page.html') Sleep(1000) ; Give it some time to load the web page ToolTip("") Do ; wait for document Sleep(250) $oDocument = $oIE.document Until IsObj($oDocument) Local $ohJS = $oIE.document.parentwindow.JSglobal MsgBox(0, "", $ohJS.Eval("moment().format('MMMM Do YYYY, h:mm:ss a');")) $oIE = 0 EndFunc ;==>Example Func CreateHtmlPage() Local $sStart = @LF & "#cs;HTML" Local $sEnd = "#ce;HTML" & @CR Local $aArray = _StringBetween(FileRead(@ScriptFullPath), $sStart, $sEnd) Local $sPage = @ScriptDir & '\Page.html' Local $hFile = FileOpen($sPage, 2) ; $FO_OVERWRITE (2) = Write mode (erase previous contents) FileWrite($hFile, $aArray[0]) FileFlush($hFile) FileClose($hFile) EndFunc ;==>CreateHtmlPage #cs;HTML <!DOCTYPE HTML> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <script type="text/javascript"> var JSglobal = (1,eval)("this"); </script> <script src="https://momentjs.com/downloads/moment-with-locales.min.js"></script> </head> <body> </body> </html> #ce;HTML ; or you're doing in a different way? Saludos
    1 point
×
×
  • Create New...