Leaderboard
Popular Content
Showing content with the highest reputation on 02/10/2021 in all areas
-
This is an example to navigate and added all above features: - Open DevTools - Execute Scripts - Get_Page #AutoIt3Wrapper_Au3Check_Parameters=-d -w- 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_UseX64=y Opt( "MustDeclareVars", 1 ) #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPICom.au3> #include <WinAPI.au3> #include <Array.au3> Global $hGui, $iTop = 40 #include "..\Includes\WV2Interfaces.au3" HotKeySet("^+I", "DevTools") ; CTRL + SHIFT + I to open DevTools WebView2() Func WebView2() $hGui = GUICreate( "WebView2 Sample", 1200, 900, -1, -1, $WS_OVERLAPPEDWINDOW ) Local $idButton_Back = GUICtrlCreateButton("Back", 10, 10, 70, 25) Local $idButton_Forward = GUICtrlCreateButton("Forward", 90, 10, 70, 25) Local $idButton_Home = GUICtrlCreateButton("Home", 170, 10, 70, 25) Local $idButton_Go = GUICtrlCreateButton("Go", 1140, 10, 45, 25) Local $idInput = GUICtrlCreateInput("", 250, 10, 850, 25) GUICtrlSetData(-1, "https://www.bing.com") _WinAPI_CoInitialize( $COINIT_APARTMENTTHREADED ) CoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerCreate() ConsoleWrite( "$pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler = " & $pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler & @CRLF & @CRLF ) CoreWebView2CreateCoreWebView2ControllerCompletedHandlerCreate() ConsoleWrite( "$pCoreWebView2CreateCoreWebView2ControllerCompletedHandler = " & $pCoreWebView2CreateCoreWebView2ControllerCompletedHandler & @CRLF & @CRLF ) Local $hWebView2Loader = DllOpen( @AutoItX64 ? "WebView2Loader-x64.dll" : "WebView2Loader-x86.dll" ) Local $aRet = DllCall( $hWebView2Loader, "long", "CreateCoreWebView2EnvironmentWithOptions", "wstr", "", "wstr", "", _ "ptr", NULL, "ptr", $pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler ) If @error Or $aRet[0] Then Return ConsoleWrite( "CreateCoreWebView2EnvironmentWithOptions ERR" & @CRLF ) ConsoleWrite( "CreateCoreWebView2EnvironmentWithOptions OK" & @CRLF & @CRLF ) GUISetState( @SW_SHOW ) ; HomePage Local $aArray_URL[1] = ["http://www.google.com"] Local $iIndex = 0 ; Loop While 1 Switch GUIGetMsg() Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESIZED, $GUI_EVENT_RESTORE Local $tRect = _WinAPI_GetClientRect( $hGui ) DllStructsetData($tRECT, "Top", $iTop) $oCoreWebView2Controller.put_Bounds( $tRect ) Case $idButton_Go $oCoreWebView2.Navigate(GUICtrlRead($idInput)) _ArrayAdd($aArray_URL,GUICtrlRead($idInput)) $iIndex += 1 ;~ _ArrayDisplay($aArray_URL,"Go") Case $idButton_Back If $iIndex > 0 Then $iIndex -= 1 Else $iIndex = 0 EndIf $oCoreWebView2.Navigate($aArray_URL[$iIndex]) $oCoreWebView2.ExecuteScript("alert('Pressed Back');", NULL) ;~ _ArrayDisplay($aArray_URL,"Back") Case $idButton_Forward If $iIndex < _ArrayMaxIndex($aArray_URL)+1 Then $iIndex +=1 EndIf $oCoreWebView2.Navigate($aArray_URL[$iIndex]) $oCoreWebView2.ExecuteScript("alert('Pressed Forward');", NULL) ;~ _ArrayDisplay($aArray_URL,"FW") Case $idButton_Home $oCoreWebView2.Navigate($aArray_URL[0]) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd CoreWebView2CreateCoreWebView2ControllerCompletedHandlerDelete() CoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerDelete() DllClose( $hWebView2Loader ) EndFunc Func CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke( $pSelf, $long, $ptr ) ; Ret: long Par: long;ptr* ConsoleWrite( "CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke" & @CRLF ) $oCoreWebView2Environment = ObjCreateInterface( $ptr, $sIID_ICoreWebView2Environment, $dtag_ICoreWebView2Environment ) ConsoleWrite( "IsObj( $oCoreWebView2Environment ) = " & IsObj( $oCoreWebView2Environment ) & @CRLF & @CRLF ) $oCoreWebView2Environment.CreateCoreWebView2Controller( $hGui, $pCoreWebView2CreateCoreWebView2ControllerCompletedHandler ) Return 0 #forceref $pSelf, $long EndFunc Func CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke( $pSelf, $long, $ptr ) ; Ret: long Par: long;ptr* ConsoleWrite( "CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke" & @CRLF ) $oCoreWebView2Controller = ObjCreateInterface( $ptr, $sIID_ICoreWebView2Controller, $dtag_ICoreWebView2Controller ) ConsoleWrite( "IsObj( $oCoreWebView2Controller ) = " & IsObj( $oCoreWebView2Controller ) & @CRLF ) $oCoreWebView2Controller.AddRef() $oCoreWebView2Controller.get_CoreWebView2( $pCoreWebView2 ) $oCoreWebView2 = ObjCreateInterface( $pCoreWebView2, $sIID_ICoreWebView2, $dtag_ICoreWebView2 ) ConsoleWrite( "IsObj( $oCoreWebView2 ) = " & IsObj( $oCoreWebView2 ) & @CRLF & @CRLF ) Local $tRect = _WinAPI_GetClientRect( $hGui ) DllStructsetData($tRECT, "Top", $iTop) $oCoreWebView2Controller.put_Bounds( $tRect ) ;~ Start Page ;~ $oCoreWebView2.Navigate( "https://www.google.com/" ) $oCoreWebView2.NavigateToString(_GetPage()) Return 0 #forceref $pSelf, $long EndFunc Func DevTools() $oCoreWebView2.OpenDevToolsWindow() EndFunc Func _GetPage() Local $sPageSource = "" $sPageSource &= "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">" & @CRLF $sPageSource &= "<HTML><HEAD><TITLE>L E D Panel Script</TITLE>" & @CRLF $sPageSource &= "<META http-equiv=Content-Type content=""text/html; charset=windows-1252"">" & @CRLF $sPageSource &= "<STYLE type=text/css>" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "body{" & @CRLF $sPageSource &= "background-color:black;" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "</STYLE>" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "</HEAD>" & @CRLF $sPageSource &= "<BODY onload=""LEDinit()"">" & @CRLF $sPageSource &= "<img src=""https://www.autoitscript.com/forum/cdn/images/logo_autoit_210x72.svg"" width=""100"" height=""35"" style=""position: absolute; top: 5px; left: 200px;"">" & @CRLF $sPageSource &= "<SCRIPT language=JavaScript>" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "//""L.E.D. Panel"" Script by Richard Maloney © 2002" & @CRLF $sPageSource &= "//For Custom effects, email Richard (ottawo@rogers.com)" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "//____________________CONFIGURATION AREA_____________________" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "// THIS LED SCRIPT TAKES UP 200 pixels HORIZONTAL and 28 pixels VERTICAL -Have Fun :-)" & @CRLF $sPageSource &= "// YOUR MESSAGE GOES ON NEXT 4 LINES DOWN." & @CRLF $sPageSource &= "// ALLOWABLE CHARACTERS ARE: A-Z, Period, space, comma, numerals, question mark and 'message codes'." & @CRLF $sPageSource &= "// THE 4 MESSAGE CODES:" & @CRLF $sPageSource &= "// @=PAUSE FOR 3 SECONDS, #=FLASH FOR 3 SECONDS, ^=SCROLL UP EFFECT, _=SUN EFFECT, $=SPLIT EFFECT" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "//EXAMPLE: var message=""_ Dynamic^^ Drive! # For the best dhtml scripts... www.dynamic.drive.com "";" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "var message=""HI EVERYONE@ LARSJ HAS DONE A VERY GOOD JOB# WEBVIEW2^^ A POWERFUL TOOL !!!@$@ A NEW SUN HAS RISEN@_ "";" & @CRLF $sPageSource &= "var LEDonColor='Red'; //color of the LEDs when they are on" & @CRLF $sPageSource &= "var LEDoffColor='#7D0605'; //color of the LEDs when they are off" & @CRLF $sPageSource &= "startXPos=10; //start of horizontal position eg. startXPos=20; places the leds 20 pixels from left" & @CRLF $sPageSource &= "startYPos=10; //start of vertical position" & @CRLF $sPageSource &= "//____________________END CONFIGURATION AREA__________________" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "var IE=(document.all) ? true:false; var NS=(document.layers) ? true:false; var W3C=((document.getElementById) && (!IE)) ? true:false;" & @CRLF $sPageSource &= "var d=document; if (window.offscreenBuffering) window.offscreenBuffering = true;" & @CRLF $sPageSource &= "function getCSS(id) {" & @CRLF $sPageSource &= " if (IE) return d.all[id] //IE" & @CRLF $sPageSource &= " else if (NS) return d.layers[id] //NS4" & @CRLF $sPageSource &= " else return d.getElementById(id)//W3C" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "var alphabet=new Array(44);" & @CRLF $sPageSource &= "alphabet[0]=new Array(""0111111"",""1001000"",""1001000"",""1001000"",""0111111""); alphabet[1]=new Array(""1111111"",""1001001"",""1001001"",""1001001"",""0110110"");//B" & @CRLF $sPageSource &= "alphabet[2]=new Array(""0111110"",""1000001"",""1000001"",""1000001"",""0100010""); alphabet[3]=new Array(""1111111"",""1000001"",""1000001"",""1000001"",""0111110"");//D" & @CRLF $sPageSource &= "alphabet[4]=new Array(""1111111"",""1001001"",""1001001"",""1001001""); alphabet[5]=new Array(""1111111"",""1001000"",""1001000"",""1001000"");//F" & @CRLF $sPageSource &= "alphabet[6]=new Array(""0111110"",""1000001"",""1000001"",""1001001"",""0101110""); alphabet[7]=new Array(""1111111"",""0001000"",""0001000"",""0001000"",""1111111"");//H" & @CRLF $sPageSource &= "alphabet[8]=new Array(""1000001"",""1111111"",""1000001""); alphabet[9]=new Array(""0000110"",""0000001"",""0000001"",""0000001"",""1111110"");//J" & @CRLF $sPageSource &= "alphabet[10]=new Array(""1111111"",""0001000"",""0010100"",""0100010"",""1000001""); alphabet[11]=new Array(""1111111"",""0000001"",""0000001"",""0000001"");//L" & @CRLF $sPageSource &= "alphabet[12]=new Array(""1111111"",""0010000"",""0001000"",""0010000"",""1111111""); alphabet[13]=new Array(""1111111"",""0010000"",""0001000"",""0000100"",""1111111"");//N" & @CRLF $sPageSource &= "alphabet[14]=new Array(""0111110"",""1000001"",""1000001"",""1000001"",""0111110""); alphabet[15]=new Array(""1111111"",""1001000"",""1001000"",""1001000"",""0110000"");//P" & @CRLF $sPageSource &= "alphabet[16]=new Array(""0111110"",""1000001"",""1000001"",""1000011"",""0111111""); alphabet[17]=new Array(""1111111"",""1001000"",""1001100"",""1001010"",""0110001"");//R" & @CRLF $sPageSource &= "alphabet[18]=new Array(""0110010"",""1001001"",""1001001"",""1001001"",""0100110""); alphabet[19]=new Array(""1000000"",""1000000"",""1111111"",""1000000"",""1000000"");//T" & @CRLF $sPageSource &= "alphabet[20]=new Array(""1111110"",""0000001"",""0000001"",""0000001"",""1111110""); alphabet[21]=new Array(""1110000"",""0001100"",""0000011"",""0001100"",""1110000"");//V" & @CRLF $sPageSource &= "alphabet[22]=new Array(""1111110"",""0000001"",""0000010"",""0001100"",""0000010"",""0000001"",""1111110""); alphabet[23]=new Array(""1100011"",""0010100"",""0001000"",""0010100"",""1100011"");//X" & @CRLF $sPageSource &= "alphabet[24]=new Array(""1100000"",""0010000"",""0001111"",""0010000"",""1100000""); alphabet[25]=new Array(""1000011"",""1000101"",""1001001"",""1010001"",""1100001"");//Z" & @CRLF $sPageSource &= "alphabet[26]=new Array(""0000000"",""0000000"",""0000000"",""0000000""); alphabet[27]=new Array(""0000000"",""0000001"",""0000000"",""0000000"",""0000000"");//PERIOD" & @CRLF $sPageSource &= "alphabet[28]=new Array(""0000000"",""0000000"",""1111101"",""0000000"",""0000000"");//!" & @CRLF $sPageSource &= "alphabet[29]=new Array(""0100001"",""1111111"",""0000001""); alphabet[30]=new Array(""0100011"",""1000101"",""1001001"",""1001001"",""0110001"");//2" & @CRLF $sPageSource &= "alphabet[31]=new Array(""0100010"",""1001001"",""1001001"",""1001001"",""0110110""); alphabet[32]=new Array(""0001000"",""0011000"",""0101000"",""1111111"",""0001000"");//4" & @CRLF $sPageSource &= "alphabet[33]=new Array(""1111001"",""1001001"",""1001001"",""1001001"",""1000110""); alphabet[34]=new Array(""0111110"",""1001001"",""1001001"",""1001001"",""0100110"");//6" & @CRLF $sPageSource &= "alphabet[35]=new Array(""1000011"",""1000100"",""1001000"",""1110000""); alphabet[36]=new Array(""0110110"",""1001001"",""1001001"",""1001001"",""0110110"");//8" & @CRLF $sPageSource &= "alphabet[37]=new Array(""0110010"",""1001001"",""1001001"",""1001001"",""0111110""); alphabet[38]=new Array(""0000001"",""0000010"",""0000000"");//COMMA" & @CRLF $sPageSource &= "alphabet[39]=new Array(""XXXXXXX"");//PAUSE ( @ )" & @CRLF $sPageSource &= "alphabet[40]=new Array(""YYYYYYY"");//FLASH ( # )" & @CRLF $sPageSource &= "alphabet[41]=new Array(""DDDDDDD"");//SCROLL UP EFFECT ( ^ )" & @CRLF $sPageSource &= "alphabet[42]=new Array(""SSSSSSS"");//SUN EFFECT ( _ )" & @CRLF $sPageSource &= "alphabet[43]=new Array(""0100000"",""1000000"",""1001101"",""1001000"",""0110000"");//?" & @CRLF $sPageSource &= "alphabet[44]=new Array(""QQQQQQQ"");//SPLIT EFFECT ( $ )" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "message=message.toUpperCase(); //make message uppercase" & @CRLF $sPageSource &= "var messageArray=new Array(); //make messageArray-an array of the letters in the message" & @CRLF $sPageSource &= "var columnCount=0; //variable to count columns in messageArray.length" & @CRLF $sPageSource &= "for (i=0; i<message.length; i++){ //iterate through the characters in the message" & @CRLF $sPageSource &= " letterNum=message.charCodeAt(i); //assign proper letter code (alphabet array)" & @CRLF $sPageSource &= " if ((letterNum>=65) && (letterNum<=90)) temp=letterNum-65; //letters" & @CRLF $sPageSource &= " else if (letterNum==46) temp=27; //." & @CRLF $sPageSource &= " else if (letterNum==32) temp=26; //space" & @CRLF $sPageSource &= " else if (letterNum==33) temp=28; //!" & @CRLF $sPageSource &= " else if ((letterNum>=49) && (letterNum<=57)) temp=letterNum-20; //[1-9]" & @CRLF $sPageSource &= " else if (letterNum==48) temp=14; //zero" & @CRLF $sPageSource &= " else if (letterNum==63) temp=43; //?" & @CRLF $sPageSource &= " else if (letterNum==44) temp=38; //," & @CRLF $sPageSource &= " else if (letterNum==64) temp=39; //pause" & @CRLF $sPageSource &= " else if (letterNum==35) temp=40; //flash effect" & @CRLF $sPageSource &= " else if (letterNum==94) temp=41; //scroll up effect" & @CRLF $sPageSource &= " else if (letterNum==95) temp=42; //sunrise effect" & @CRLF $sPageSource &= " else if (letterNum==36) temp=44; //split effect" & @CRLF $sPageSource &= " else continue;" & @CRLF $sPageSource &= " for (ii=0; ii<alphabet[temp].length;ii++){ messageArray[columnCount]=alphabet[temp][ii];columnCount++;}" & @CRLF $sPageSource &= " if ((temp!=39) && (temp!=40) && (temp!=41)) {messageArray[columnCount]=""0000000"";columnCount++;}" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "//make 'led screen' with block 0-49 on row 1, block 50-99 on row 2, block 100-149 on row 3, etc.." & @CRLF $sPageSource &= "var b='';" & @CRLF $sPageSource &= "for (var i=0; i<350; i++){//columns 50 columns x 7 rows" & @CRLF $sPageSource &= " rowPos=0+3*(i>49)+3*(i>99)+3*(i>149)+3*(i>199)+3*(i>249)+3*(i>299);" & @CRLF $sPageSource &= " colPos=0+150*(i>49)+150*(i>99)+150*(i>149)+150*(i>199)+150*(i>249)+150*(i>299);" & @CRLF $sPageSource &= " b+= (NS) ? '<LAYER NAME=""block' + i + '"" LEFT=""' + (startXPos+i*3-colPos) + '"" TOP=""' + (startYPos+rowPos) + '"" VISIBILITY=""show"" WIDTH=""2"" HEIGHT=""2"" BGCOLOR=""' + LEDoffColor + '""></LAYER>' : '<div id=""block' + i + '"" style=""position:absolute; left:' + (startXPos+i*3-colPos) + 'px; top:' + (startYPos+rowPos) + 'px; background-color:' + LEDoffColor +'; height: 2px; width: 2px;font-size:2px;""></div>';" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "document.write(b);" & @CRLF $sPageSource &= "var columnCounter=0; //keep track of postion of messageArray" & @CRLF $sPageSource &= "var bb=new Array(); //store particular LED's dom element here" & @CRLF $sPageSource &= " if (NS) { for (var i=0; i<350; i++) { bb[i]=getCSS(""block""+i)}}" & @CRLF $sPageSource &= " else {for (var i=0; i<350; i++){ bb[i]=getCSS(""block""+i).style;}}" & @CRLF $sPageSource &= "var isOn=new Array();for (var i=0; i<350; i++){ isOn[i]=0;} //keep track on on/off status of particular LED" & @CRLF $sPageSource &= "onArray=new Array(); var onCount=0; //array size counter" & @CRLF $sPageSource &= "function scroll(){" & @CRLF $sPageSource &= " onCount=0;" & @CRLF $sPageSource &= " if (NS) { for (var i=0; i<301; i+=50){ if (isOn[i]==1) { bb[i].bgColor=LEDoffColor; isOn[i]=0;} for (var ii=1; ii<50; ii+=7){" & @CRLF $sPageSource &= " temp=i+ii;temp1=temp+1;temp2=temp+2;temp3=temp+3;temp4=temp+4;temp5=temp+5;temp6=temp+6;" & @CRLF $sPageSource &= " if (isOn[temp]==1) {bb[temp].bgColor=LEDoffColor; isOn[temp]=0; bb[temp-1].bgColor=LEDonColor; isOn[temp-1]=1;}" & @CRLF $sPageSource &= " if (isOn[temp1]==1) {bb[temp1].bgColor=LEDoffColor; isOn[temp1]=0; bb[temp].bgColor=LEDonColor; isOn[temp]=1;}" & @CRLF $sPageSource &= " if (isOn[temp2]==1) {bb[temp2].bgColor=LEDoffColor; isOn[temp2]=0; bb[temp+1].bgColor=LEDonColor; isOn[temp+1]=1;}" & @CRLF $sPageSource &= " if (isOn[temp3]==1) {bb[temp3].bgColor=LEDoffColor; isOn[temp3]=0; bb[temp2].bgColor=LEDonColor; isOn[temp2]=1;}" & @CRLF $sPageSource &= " if (isOn[temp4]==1) {bb[temp4].bgColor=LEDoffColor; isOn[temp4]=0; bb[temp3].bgColor=LEDonColor; isOn[temp3]=1;}" & @CRLF $sPageSource &= " if (isOn[temp5]==1) {bb[temp5].bgColor=LEDoffColor; isOn[temp5]=0; bb[temp4].bgColor=LEDonColor; isOn[temp4]=1;}" & @CRLF $sPageSource &= " if (isOn[temp6]==1) {bb[temp6].bgColor=LEDoffColor; isOn[temp6]=0; bb[temp5].bgColor=LEDonColor; isOn[temp5]=1;}" & @CRLF $sPageSource &= " }}}" & @CRLF $sPageSource &= " else { for (var i=0; i<301; i+=50){ if (isOn[i]==1) { bb[i].backgroundColor=LEDoffColor; isOn[i]=0;} for (var ii=1; ii<50; ii+=7){" & @CRLF $sPageSource &= " temp=i+ii;temp1=temp+1;temp2=temp+2;temp3=temp+3;temp4=temp+4;temp5=temp+5;temp6=temp+6;" & @CRLF $sPageSource &= " if (isOn[temp]==1) {bb[temp].backgroundColor=LEDoffColor; isOn[temp]=0; bb[temp-1].backgroundColor=LEDonColor; isOn[temp-1]=1;}" & @CRLF $sPageSource &= " if (isOn[temp1]==1) {bb[temp1].backgroundColor=LEDoffColor; isOn[temp1]=0; bb[temp].backgroundColor=LEDonColor; isOn[temp]=1;}" & @CRLF $sPageSource &= " if (isOn[temp2]==1) {bb[temp2].backgroundColor=LEDoffColor; isOn[temp2]=0; bb[temp+1].backgroundColor=LEDonColor; isOn[temp+1]=1;}" & @CRLF $sPageSource &= " if (isOn[temp3]==1) {bb[temp3].backgroundColor=LEDoffColor; isOn[temp3]=0; bb[temp2].backgroundColor=LEDonColor; isOn[temp2]=1;}" & @CRLF $sPageSource &= " if (isOn[temp4]==1) {bb[temp4].backgroundColor=LEDoffColor; isOn[temp4]=0; bb[temp3].backgroundColor=LEDonColor; isOn[temp3]=1;}" & @CRLF $sPageSource &= " if (isOn[temp5]==1) {bb[temp5].backgroundColor=LEDoffColor; isOn[temp5]=0; bb[temp4].backgroundColor=LEDonColor; isOn[temp4]=1;}" & @CRLF $sPageSource &= " if (isOn[temp6]==1) {bb[temp6].backgroundColor=LEDoffColor; isOn[temp6]=0; bb[temp5].backgroundColor=LEDonColor; isOn[temp5]=1;}" & @CRLF $sPageSource &= " }}}" & @CRLF $sPageSource &= " temp=messageArray[columnCounter]; flag=temp.charAt(0);//GET NEW COLUMN" & @CRLF $sPageSource &= " if (temp.charAt(1)==""1"") {isOn[99]=1;} if (temp.charAt(2)==""1"") {isOn[149]=1} if (temp.charAt(3)==""1"") {isOn[199]=1}" & @CRLF $sPageSource &= " if (temp.charAt(4)==""1"") {isOn[249]=1} if (temp.charAt(5)==""1"") {isOn[299]=1} if (temp.charAt(6)==""1"") {isOn[349]=1}" & @CRLF $sPageSource &= " if (flag==""0"") {} else if (flag==""1"") {isOn[49]=1;} else if (flag==""X"") {pauseScroll();} else if (flag==""Y"") {flashScroll();}" & @CRLF $sPageSource &= " else if (flag==""D"") {dropEffect();} else if (flag==""S"") {sunRiseEffect();} else if (flag==""Q"") {splitEffect();}" & @CRLF $sPageSource &= " columnCounter++; if(columnCounter==columnCount) columnCounter=0;" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "//______________pause effect________________" & @CRLF $sPageSource &= "function pauseScroll(){ clearInterval(loop); setTimeout(""LEDinit()"",3000);}" & @CRLF $sPageSource &= "//______________onArray Section_____________" & @CRLF $sPageSource &= "onArray=new Array(); var onCount=0; //array size counter" & @CRLF $sPageSource &= "function makeOnArray(){ clearInterval(loop); onCount=0; for (var i=0; i<700; i++){if (isOn[i]==1) {onArray[onCount]=i; onCount++;};}//make onArray of 'on' LEDS" & @CRLF $sPageSource &= "}//_________________________________" & @CRLF $sPageSource &= "//_______________flash effect_______________" & @CRLF $sPageSource &= "var flashCount=0;" & @CRLF $sPageSource &= "function flashScroll(){ makeOnArray(); flashCount=0; if (NS) {setTimeout(""flashItNS()"",250);} else {setTimeout(""flashIt()"",250);}}" & @CRLF $sPageSource &= "function flashItNS(){ flashCount++;" & @CRLF $sPageSource &= " if (flashCount<14) {" & @CRLF $sPageSource &= " if (flashCount % 2 == 0){ for (var i=0; i<onCount; i++){ isOn[onArray[i]]=0;bb[onArray[i]].bgColor=LEDoffColor;}}" & @CRLF $sPageSource &= " else {for (var i=0; i<onCount; i++){isOn[onArray[i]]=1;bb[onArray[i]].bgColor=LEDonColor;}}" & @CRLF $sPageSource &= " setTimeout(""flashItNS()"",250);" & @CRLF $sPageSource &= " }" & @CRLF $sPageSource &= " else {flashCount=0; setTimeout(""LEDinit()"",250);}" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "function flashIt(){ flashCount++;" & @CRLF $sPageSource &= " if (flashCount<14) {" & @CRLF $sPageSource &= " if (flashCount % 2 == 0){ for (var i=0; i<onCount; i++){ isOn[onArray[i]]=0;bb[onArray[i]].backgroundColor=LEDoffColor;}}" & @CRLF $sPageSource &= " else {for (var i=0; i<onCount; i++){isOn[onArray[i]]=1;bb[onArray[i]].backgroundColor=LEDonColor;}}" & @CRLF $sPageSource &= " setTimeout(""flashIt()"",250);" & @CRLF $sPageSource &= " }" & @CRLF $sPageSource &= " else {flashCount=0; setTimeout(""LEDinit()"",250);}" & @CRLF $sPageSource &= "}//_________________________________" & @CRLF $sPageSource &= "//____________scroll up effect______________" & @CRLF $sPageSource &= "dropArray=new Array();" & @CRLF $sPageSource &= "function dropEffect(){makeOnArray(); for (var i=0; i<onCount; i++){ dropArray[i]=onArray[i]; } if (NS) {dropItNS();} else {dropIt();}}" & @CRLF $sPageSource &= "var dropCount=0;" & @CRLF $sPageSource &= "function dropItNS(){" & @CRLF $sPageSource &= " if (dropCount<7){for (var i=0; i<onCount; i++){ bb[dropArray[i]].bgColor=LEDoffColor; }" & @CRLF $sPageSource &= " for (var i=0; i<onCount; i++){ temp=dropArray[i]; temp-=50;if (temp<0) temp+=350;bb[temp].bgColor=LEDonColor; dropArray[i]=temp;}" & @CRLF $sPageSource &= " dropCount++; setTimeout(""dropItNS()"",100);" & @CRLF $sPageSource &= " } else {dropCount=0;setTimeout(""LEDinit()"",100);}" & @CRLF $sPageSource &= "}//_________________________________" & @CRLF $sPageSource &= "function dropIt(){" & @CRLF $sPageSource &= " if (dropCount<7){ for (var i=0; i<onCount; i++){ bb[dropArray[i]].backgroundColor=LEDoffColor; }" & @CRLF $sPageSource &= " for (var i=0; i<onCount; i++){ temp=dropArray[i]; temp-=50; if (temp<0) temp+=350; bb[temp].backgroundColor=LEDonColor; dropArray[i]=temp;}" & @CRLF $sPageSource &= " dropCount++; setTimeout(""dropIt()"",100);" & @CRLF $sPageSource &= " } else {dropCount=0;setTimeout(""LEDinit()"",100);}" & @CRLF $sPageSource &= "}//_________________________________" & @CRLF $sPageSource &= "//____________sunrise effect________________" & @CRLF $sPageSource &= "sunRiseCounter=0;sunRiseArray=new Array();" & @CRLF $sPageSource &= "sunRiseArray[0]=new Array(50,101,102,103,154,155,156,207,208,259,260,261,212,163,164,115,116,117,168,169,170,221,222,223,274,275,276,227,228,179,180,131,132,83,134,135,186,187,238,239,240,241,292,293,344,295,296,247,198);//Hills" & @CRLF $sPageSource &= "sunRiseArray[1]=new Array(224,225,226); sunRiseArray[2]=new Array(174,175,176,177); sunRiseArray[3]=new Array(173,124,125,126,127,128,178); sunRiseArray[4]=new Array(172,123,74,75,76,77,129); sunRiseArray[5]=new Array(171,122,73,24,25,26,27,78,79,130);" & @CRLF $sPageSource &= "function sunRiseEffect() { makeOnArray(); for (var i=0; i<onCount; i++){ isOn[onArray[i]]=0; if (!NS) {bb[onArray[i]].backgroundColor=LEDoffColor;} else {bb[onArray[i]].bgColor=LEDoffColor;}}" & @CRLF $sPageSource &= " setTimeout(""riseEffectUp()"",1000);}" & @CRLF $sPageSource &= "function riseEffectUp() {" & @CRLF $sPageSource &= " if (!NS) { for (var ii=0; ii<sunRiseArray[sunRiseCounter].length; ii++) {isOn[sunRiseArray[sunRiseCounter][ii]]=1;bb[sunRiseArray[sunRiseCounter][ii]].backgroundColor=LEDonColor;}}" & @CRLF $sPageSource &= " else {for (var ii=0; ii<sunRiseArray[sunRiseCounter].length; ii++) {isOn[sunRiseArray[sunRiseCounter][ii]]=1;bb[sunRiseArray[sunRiseCounter][ii]].bgColor=LEDonColor;}}" & @CRLF $sPageSource &= " sunRiseCounter++; if (sunRiseCounter>5) {sunRiseCounter=5;setTimeout(""riseEffectDown()"",2000);} else {setTimeout(""riseEffectUp()"",250);}}" & @CRLF $sPageSource &= "function riseEffectDown() {" & @CRLF $sPageSource &= " if (!NS) {for (var ii=0; ii<sunRiseArray[sunRiseCounter].length; ii++) {isOn[sunRiseArray[sunRiseCounter][ii]]=0;bb[sunRiseArray[sunRiseCounter][ii]].backgroundColor=LEDoffColor;}}" & @CRLF $sPageSource &= " else {for (var ii=0; ii<sunRiseArray[sunRiseCounter].length; ii++) {isOn[sunRiseArray[sunRiseCounter][ii]]=0;bb[sunRiseArray[sunRiseCounter][ii]].bgColor=LEDoffColor;}}" & @CRLF $sPageSource &= " sunRiseCounter--; if (sunRiseCounter<1) {sunRiseCounter=0;setTimeout(""LEDinit()"",1500);}" & @CRLF $sPageSource &= " else {setTimeout(""riseEffectDown()"",250);}" & @CRLF $sPageSource &= "}//____________________________________" & @CRLF $sPageSource &= "//____________split scroll effect___________" & @CRLF $sPageSource &= "var splitCount=0;" & @CRLF $sPageSource &= "function splitEffect() { makeOnArray(); for (var i=0; i<onCount; i++) { dropArray[i]=onArray[i]; }" & @CRLF $sPageSource &= " if (NS) {setTimeout(""splitNS()"",55);} else if (IE) {setTimeout(""splitIt()"",55);} else {setTimeout(""splitIt()"",100);}" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "function splitIt(){ for (i=0;i<onCount;i++){ temp=dropArray[i];" & @CRLF $sPageSource &= " if (temp<150) { if (temp==100) {bb[temp].backgroundColor=LEDoffColor; temp=149; bb[temp-1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==50) {bb[temp].backgroundColor=LEDoffColor; temp=99; bb[temp-1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==0) {bb[temp].backgroundColor=LEDoffColor; temp=49; bb[temp-1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else {bb[temp].backgroundColor=LEDoffColor; bb[temp-1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " dropArray[i]=temp-1; }" & @CRLF $sPageSource &= " else { if (temp==199) {bb[temp].backgroundColor=LEDoffColor; temp=200; bb[temp+1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==349) {bb[temp].backgroundColor=LEDoffColor; temp=300; bb[temp+1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==299) {bb[temp].backgroundColor=LEDoffColor; temp=250; bb[temp+1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==249) {bb[temp].backgroundColor=LEDoffColor; temp=200; bb[temp+1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else {bb[temp].backgroundColor=LEDoffColor; bb[temp+1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " dropArray[i]=temp+1; }" & @CRLF $sPageSource &= " } splitCount++; if (splitCount<49) {if (IE) {setTimeout(""splitIt()"",55);} else {setTimeout(""splitIt()"",100);} } else {splitCount=0; LEDinit();}" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "function splitNS(){" & @CRLF $sPageSource &= " for (i=0;i<onCount;i++){ temp=dropArray[i];" & @CRLF $sPageSource &= " if (temp<150) { if (temp==100) {bb[temp].bgColor=LEDoffColor; temp=149; bb[temp-1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==50) {bb[temp].bgColor=LEDoffColor; temp=99; bb[temp-1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==0) {bb[temp].bgColor=LEDoffColor; temp=49; bb[temp-1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else {bb[temp].bgColor=LEDoffColor; bb[temp-1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " dropArray[i]=temp-1; }" & @CRLF $sPageSource &= " else { if (temp==199) {bb[temp].bgColor=LEDoffColor; temp=200; bb[temp+1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==349) {bb[temp].bgColor=LEDoffColor; temp=300; bb[temp+1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==299) {bb[temp].bgColor=LEDoffColor; temp=250; bb[temp+1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==249) {bb[temp].bgColor=LEDoffColor; temp=200; bb[temp+1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else {bb[temp].bgColor=LEDoffColor; bb[temp+1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " dropArray[i]=temp+1; }" & @CRLF $sPageSource &= " } splitCount++; if (splitCount<49) {setTimeout(""splitNS()"",55);} else {splitCount=0; LEDinit();}" & @CRLF $sPageSource &= "}//___________________________________" & @CRLF $sPageSource &= "function LEDinit(){if (NS) {loop=setInterval(""scroll()"",55);} else if (IE){loop=setInterval(""scroll()"",55);} else {loop=setInterval(""scroll()"",100);}}" & @CRLF $sPageSource &= "</SCRIPT>" & @CRLF $sPageSource &= "</BODY></HTML>" & @CRLF Return $sPageSource EndFunc ;==>_GetPage Navigation is not 100% yet but it a good start for all of them who want to dive deeper into it. Correction : Navigation3 points
-
Deeplink image on GUI
pixelsearch and one other reacted to Nine for a topic
An even better way, without file : #include <GUIConstantsEx.au3> #include <InetConstants.au3> #include <StaticConstants.au3> #include <SendMessage.au3> #include <GDIPlus.au3> $dImage = InetRead ("https://fleet.siemens-healthineers.com/static/images/02_11060815_NL.jpg", $INET_FORCERELOAD) _GDIPlus_Startup() $hImage = _GDIPlus_BitmapCreateFromMemory($dImage) $hImageRez = _GDIPlus_ImageResize($hImage, 100, 80) _GDIPlus_ImageDispose($hImage) $hGUI = GUICreate("Test") $idPic = GUICtrlCreatePic("", 10, 10, 100, 80) $hBitMap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImageRez) _GDIPlus_ImageDispose($hImageRez) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($idPic), $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap)) _WinAPI_DeleteObject($hBitmap) _GDIPlus_Shutdown() GUISetState() While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd2 points -
When using the ObjCreateInterface() function, filling in method and property parameter types in the description tag string is the most time consuming job. The method and property names can be copied directly from the header file, WebView2.h, but the parameter types must be translated to corresponding AutoIt types. Therefore, in WV2Interfaces.au3 I've only filled in parameter types for the methods and properties that are actually used in the code. Since I've not used $oCoreWebView2.ExecuteScript() the parameter types are not filled in. Replace at the top of WV2Interfaces.au3 "ExecuteScript hresult();" with "ExecuteScript hresult(wstr;ptr);" Then replace in the code above Case $Button1 $oCoreWebView2.ExecuteScript("alert('Hello');") with Case $Button1 $oCoreWebView2.ExecuteScript("alert('Hello');", NULL) Sleep(3000) $oCoreWebView2.NavigateToString(_GetPage()) or similar.2 points
-
just doing some "random" (a bit messy) tests to get familiar, modifying the scripts of the examples; I placed a mini WebView on the GUI and tried to stress the "NavigateToString" method by passing an old html source for fun. I also placed a button on the GUI to try to use "ExecuteScript", but obviously it shouldn't be used this way, in fact the script fails. Anyone have an example of how to use "ExecuteScript"? More than trying to mimic a browser, I'm interested in being able to interact with the page content in the WebView. Thanks in advance to anyone who wants to help #AutoIt3Wrapper_Au3Check_Parameters=-d -w- 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_UseX64=y Opt("MustDeclareVars", 1) #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPICom.au3> #include <WinAPI.au3> Global $hGui ; Project includes #include "..\Includes\WV2Interfaces.au3" WebView2() Func WebView2() ; Create WebView2 GUI $hGui = GUICreate("WebView2 Sample", 350, 100, -1, -1, $WS_OVERLAPPEDWINDOW) Local $Button1 = GUICtrlCreateButton("ExecuteScript", 5, 60, 170, 35) ; Initialize COM _WinAPI_CoInitialize($COINIT_APARTMENTTHREADED) ; Create callback interface and functions CoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerCreate(True) ; Forces CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke() below to be executed ; Create callback interface and functions CoreWebView2CreateCoreWebView2ControllerCompletedHandlerCreate(True) ; Create callback interface and functions CoreWebView2NavigationStartingEventHandlerCreate(True) ; DllCall CreateCoreWebView2EnvironmentWithOptions Local $hWebView2Loader = DllOpen(@AutoItX64 ? "WebView2Loader-x64.dll" : "WebView2Loader-x86.dll") Local $aRet = DllCall($hWebView2Loader, "long", "CreateCoreWebView2EnvironmentWithOptions", "wstr", "", "wstr", "", _ "ptr", Null, "ptr", $pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler) If @error Or $aRet[0] Then Return ConsoleWrite("CreateCoreWebView2EnvironmentWithOptions ERR" & @CRLF) ConsoleWrite("CreateCoreWebView2EnvironmentWithOptions OK" & @CRLF & @CRLF) ; Show WebView2 GUI GUISetState(@SW_SHOW) ; Loop While 1 Switch GUIGetMsg() #cs Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESIZED, $GUI_EVENT_RESTORE Local $tRect = _WinAPI_GetClientRect($hGui) $oCoreWebView2Controller.put_Bounds($tRect) #ce Case $Button1 $oCoreWebView2.ExecuteScript("alert('Hello');") Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Cleanup CoreWebView2CreateCoreWebView2ControllerCompletedHandlerDelete() CoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerDelete() DllClose($hWebView2Loader) EndFunc ;==>WebView2 ; Copied from WV2Interfaces.au3 ; Executed automatically when the callback interface is created Func CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke($pSelf, $long, $ptr) ; Ret: long Par: long;ptr* ConsoleWrite("CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke" & @CRLF) ; Create CoreWebView2Environment object $oCoreWebView2Environment = ObjCreateInterface($ptr, $sIID_ICoreWebView2Environment, $dtag_ICoreWebView2Environment) ConsoleWrite("IsObj( $oCoreWebView2Environment ) = " & IsObj($oCoreWebView2Environment) & @CRLF & @CRLF) ; Set $pCoreWebView2CreateCoreWebView2ControllerCompletedHandler callback pointer for the WebView2 GUI $oCoreWebView2Environment.CreateCoreWebView2Controller($hGui, $pCoreWebView2CreateCoreWebView2ControllerCompletedHandler) ; Forces CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke() below to be executed Return 0 ; S_OK = 0x00000000 #forceref $pSelf, $long EndFunc ;==>CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke ; Copied from WV2Interfaces.au3 ; Executed as a consequence of $oCoreWebView2Environment.CreateCoreWebView2Controller() above Func CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke($pSelf, $long, $ptr) ; Ret: long Par: long;ptr* ConsoleWrite("CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke" & @CRLF) ; Create CoreWebView2Controller object $oCoreWebView2Controller = ObjCreateInterface($ptr, $sIID_ICoreWebView2Controller, $dtag_ICoreWebView2Controller) ConsoleWrite("IsObj( $oCoreWebView2Controller ) = " & IsObj($oCoreWebView2Controller) & @CRLF) $oCoreWebView2Controller.AddRef() ; Prevent the object from being deleted when the function ends ; Set bounds for the CoreWebView2 object ; Local $tRect = _WinAPI_GetClientRect($hGui) ; $oCoreWebView2Controller.put_Bounds($tRect) Local $tagMyRECT = DllStructCreate($tagRECT) DllStructSetData($tagMyRECT, "Left", 5) ; left DllStructSetData($tagMyRECT, "Top", 5) ; top DllStructSetData($tagMyRECT, "Right", 345) ; right DllStructSetData($tagMyRECT, "Bottom", 50) ; bottom $oCoreWebView2Controller.put_Bounds($tagMyRECT) ; Create CoreWebView2 object $oCoreWebView2Controller.get_CoreWebView2($pCoreWebView2) $oCoreWebView2 = ObjCreateInterface($pCoreWebView2, $sIID_ICoreWebView2, $dtag_ICoreWebView2) ConsoleWrite("IsObj( $oCoreWebView2 ) = " & IsObj($oCoreWebView2) & @CRLF & @CRLF) ; Add NavigationStarting event handler Local $tEventRegistrationToken = DllStructCreate("uint64") $oCoreWebView2.add_NavigationStarting($pCoreWebView2NavigationStartingEventHandler, $tEventRegistrationToken) ConsoleWrite("DllStructGetData( $tEventRegistrationToken, 1 ) = " & DllStructGetData($tEventRegistrationToken, 1) & @CRLF & @CRLF) ; Forces CoreWebView2NavigationStartingEventHandler_Invoke() below to be executed ; Navigate to web page $oCoreWebView2.Navigate("about:blank") ; file:///" & @ScriptDir & "/index.html") Return 0 ; S_OK = 0x00000000 #forceref $pSelf, $long EndFunc ;==>CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke ; Copied from WV2Interfaces.au3 ; Executed as a consequence of $oCoreWebView2.add_NavigationStarting() above Func CoreWebView2NavigationStartingEventHandler_Invoke($pSelf, $ptr1, $ptr2) ; Ret: long Par: ptr*;ptr* ConsoleWrite("CoreWebView2NavigationStartingEventHandler_Invoke()" & @CRLF) ; Create CoreWebView2NavigationStartingEventArgs object $oCoreWebView2NavigationStartingEventArgs = ObjCreateInterface($ptr2, $sIID_ICoreWebView2NavigationStartingEventArgs, $dtag_ICoreWebView2NavigationStartingEventArgs) ConsoleWrite("IsObj( $oCoreWebView2NavigationStartingEventArgs ) = " & IsObj($oCoreWebView2NavigationStartingEventArgs) & @CRLF & @CRLF) $oCoreWebView2NavigationStartingEventArgs.AddRef() ; Prevent the object from being deleted when the function ends ; Get navigation information Local $bIsUserInitiated, $bIsRedirected $oCoreWebView2NavigationStartingEventArgs.get_IsUserInitiated($bIsUserInitiated) $oCoreWebView2NavigationStartingEventArgs.get_IsRedirected($bIsRedirected) ; Confirm navigation If $bIsUserInitiated And Not $bIsRedirected Then #cs Local $sUri $oCoreWebView2NavigationStartingEventArgs.get_Uri($sUri) If MsgBox($MB_YESNO + $MB_ICONWARNING, "Navigation warning", "You are about to navigate to: " & $sUri & @CRLF & @CRLF & "Do you want to continue?") = $IDNO Then $oCoreWebView2NavigationStartingEventArgs.put_Cancel(True) $oCoreWebView2.NavigateToString("<h1>Navigation Canceled</h1><p>You chose to cancel navigation to the following URL: " & $sUri & "</p>" ) EndIf #ce $oCoreWebView2.NavigateToString(_GetPage()) EndIf Return 0 ; S_OK = 0x00000000 #forceref $pSelf, $ptr1, $ptr2 EndFunc ;==>CoreWebView2NavigationStartingEventHandler_Invoke Func _GetPage() Local $sPageSource = "" $sPageSource &= "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">" & @CRLF $sPageSource &= "<HTML><HEAD><TITLE>L E D Panel Script</TITLE>" & @CRLF $sPageSource &= "<META http-equiv=Content-Type content=""text/html; charset=windows-1252"">" & @CRLF $sPageSource &= "<STYLE type=text/css>" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "body{" & @CRLF $sPageSource &= "background-color:black;" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "</STYLE>" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "</HEAD>" & @CRLF $sPageSource &= "<BODY onload=""LEDinit()"">" & @CRLF $sPageSource &= "<img src=""https://www.autoitscript.com/forum/cdn/images/logo_autoit_210x72.svg"" width=""100"" height=""35"" style=""position: absolute; top: 5px; left: 200px;"">" & @CRLF $sPageSource &= "<SCRIPT language=JavaScript>" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "//""L.E.D. Panel"" Script by Richard Maloney © 2002" & @CRLF $sPageSource &= "//For Custom effects, email Richard (ottawo@rogers.com)" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "//____________________CONFIGURATION AREA_____________________" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "// THIS LED SCRIPT TAKES UP 200 pixels HORIZONTAL and 28 pixels VERTICAL -Have Fun :-)" & @CRLF $sPageSource &= "// YOUR MESSAGE GOES ON NEXT 4 LINES DOWN." & @CRLF $sPageSource &= "// ALLOWABLE CHARACTERS ARE: A-Z, Period, space, comma, numerals, question mark and 'message codes'." & @CRLF $sPageSource &= "// THE 4 MESSAGE CODES:" & @CRLF $sPageSource &= "// @=PAUSE FOR 3 SECONDS, #=FLASH FOR 3 SECONDS, ^=SCROLL UP EFFECT, _=SUN EFFECT, $=SPLIT EFFECT" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "//EXAMPLE: var message=""_ Dynamic^^ Drive! # For the best dhtml scripts... www.dynamic.drive.com "";" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "var message=""HI EVERYONE@ LARSJ HAS DONE A VERY GOOD JOB# WEBVIEW2^^ A POWERFUL TOOL !!!@$@ A NEW SUN HAS RISEN@_ "";" & @CRLF $sPageSource &= "var LEDonColor='Red'; //color of the LEDs when they are on" & @CRLF $sPageSource &= "var LEDoffColor='#7D0605'; //color of the LEDs when they are off" & @CRLF $sPageSource &= "startXPos=10; //start of horizontal position eg. startXPos=20; places the leds 20 pixels from left" & @CRLF $sPageSource &= "startYPos=10; //start of vertical position" & @CRLF $sPageSource &= "//____________________END CONFIGURATION AREA__________________" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "var IE=(document.all) ? true:false; var NS=(document.layers) ? true:false; var W3C=((document.getElementById) && (!IE)) ? true:false;" & @CRLF $sPageSource &= "var d=document; if (window.offscreenBuffering) window.offscreenBuffering = true;" & @CRLF $sPageSource &= "function getCSS(id) {" & @CRLF $sPageSource &= " if (IE) return d.all[id] //IE" & @CRLF $sPageSource &= " else if (NS) return d.layers[id] //NS4" & @CRLF $sPageSource &= " else return d.getElementById(id)//W3C" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "var alphabet=new Array(44);" & @CRLF $sPageSource &= "alphabet[0]=new Array(""0111111"",""1001000"",""1001000"",""1001000"",""0111111""); alphabet[1]=new Array(""1111111"",""1001001"",""1001001"",""1001001"",""0110110"");//B" & @CRLF $sPageSource &= "alphabet[2]=new Array(""0111110"",""1000001"",""1000001"",""1000001"",""0100010""); alphabet[3]=new Array(""1111111"",""1000001"",""1000001"",""1000001"",""0111110"");//D" & @CRLF $sPageSource &= "alphabet[4]=new Array(""1111111"",""1001001"",""1001001"",""1001001""); alphabet[5]=new Array(""1111111"",""1001000"",""1001000"",""1001000"");//F" & @CRLF $sPageSource &= "alphabet[6]=new Array(""0111110"",""1000001"",""1000001"",""1001001"",""0101110""); alphabet[7]=new Array(""1111111"",""0001000"",""0001000"",""0001000"",""1111111"");//H" & @CRLF $sPageSource &= "alphabet[8]=new Array(""1000001"",""1111111"",""1000001""); alphabet[9]=new Array(""0000110"",""0000001"",""0000001"",""0000001"",""1111110"");//J" & @CRLF $sPageSource &= "alphabet[10]=new Array(""1111111"",""0001000"",""0010100"",""0100010"",""1000001""); alphabet[11]=new Array(""1111111"",""0000001"",""0000001"",""0000001"");//L" & @CRLF $sPageSource &= "alphabet[12]=new Array(""1111111"",""0010000"",""0001000"",""0010000"",""1111111""); alphabet[13]=new Array(""1111111"",""0010000"",""0001000"",""0000100"",""1111111"");//N" & @CRLF $sPageSource &= "alphabet[14]=new Array(""0111110"",""1000001"",""1000001"",""1000001"",""0111110""); alphabet[15]=new Array(""1111111"",""1001000"",""1001000"",""1001000"",""0110000"");//P" & @CRLF $sPageSource &= "alphabet[16]=new Array(""0111110"",""1000001"",""1000001"",""1000011"",""0111111""); alphabet[17]=new Array(""1111111"",""1001000"",""1001100"",""1001010"",""0110001"");//R" & @CRLF $sPageSource &= "alphabet[18]=new Array(""0110010"",""1001001"",""1001001"",""1001001"",""0100110""); alphabet[19]=new Array(""1000000"",""1000000"",""1111111"",""1000000"",""1000000"");//T" & @CRLF $sPageSource &= "alphabet[20]=new Array(""1111110"",""0000001"",""0000001"",""0000001"",""1111110""); alphabet[21]=new Array(""1110000"",""0001100"",""0000011"",""0001100"",""1110000"");//V" & @CRLF $sPageSource &= "alphabet[22]=new Array(""1111110"",""0000001"",""0000010"",""0001100"",""0000010"",""0000001"",""1111110""); alphabet[23]=new Array(""1100011"",""0010100"",""0001000"",""0010100"",""1100011"");//X" & @CRLF $sPageSource &= "alphabet[24]=new Array(""1100000"",""0010000"",""0001111"",""0010000"",""1100000""); alphabet[25]=new Array(""1000011"",""1000101"",""1001001"",""1010001"",""1100001"");//Z" & @CRLF $sPageSource &= "alphabet[26]=new Array(""0000000"",""0000000"",""0000000"",""0000000""); alphabet[27]=new Array(""0000000"",""0000001"",""0000000"",""0000000"",""0000000"");//PERIOD" & @CRLF $sPageSource &= "alphabet[28]=new Array(""0000000"",""0000000"",""1111101"",""0000000"",""0000000"");//!" & @CRLF $sPageSource &= "alphabet[29]=new Array(""0100001"",""1111111"",""0000001""); alphabet[30]=new Array(""0100011"",""1000101"",""1001001"",""1001001"",""0110001"");//2" & @CRLF $sPageSource &= "alphabet[31]=new Array(""0100010"",""1001001"",""1001001"",""1001001"",""0110110""); alphabet[32]=new Array(""0001000"",""0011000"",""0101000"",""1111111"",""0001000"");//4" & @CRLF $sPageSource &= "alphabet[33]=new Array(""1111001"",""1001001"",""1001001"",""1001001"",""1000110""); alphabet[34]=new Array(""0111110"",""1001001"",""1001001"",""1001001"",""0100110"");//6" & @CRLF $sPageSource &= "alphabet[35]=new Array(""1000011"",""1000100"",""1001000"",""1110000""); alphabet[36]=new Array(""0110110"",""1001001"",""1001001"",""1001001"",""0110110"");//8" & @CRLF $sPageSource &= "alphabet[37]=new Array(""0110010"",""1001001"",""1001001"",""1001001"",""0111110""); alphabet[38]=new Array(""0000001"",""0000010"",""0000000"");//COMMA" & @CRLF $sPageSource &= "alphabet[39]=new Array(""XXXXXXX"");//PAUSE ( @ )" & @CRLF $sPageSource &= "alphabet[40]=new Array(""YYYYYYY"");//FLASH ( # )" & @CRLF $sPageSource &= "alphabet[41]=new Array(""DDDDDDD"");//SCROLL UP EFFECT ( ^ )" & @CRLF $sPageSource &= "alphabet[42]=new Array(""SSSSSSS"");//SUN EFFECT ( _ )" & @CRLF $sPageSource &= "alphabet[43]=new Array(""0100000"",""1000000"",""1001101"",""1001000"",""0110000"");//?" & @CRLF $sPageSource &= "alphabet[44]=new Array(""QQQQQQQ"");//SPLIT EFFECT ( $ )" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "message=message.toUpperCase(); //make message uppercase" & @CRLF $sPageSource &= "var messageArray=new Array(); //make messageArray-an array of the letters in the message" & @CRLF $sPageSource &= "var columnCount=0; //variable to count columns in messageArray.length" & @CRLF $sPageSource &= "for (i=0; i<message.length; i++){ //iterate through the characters in the message" & @CRLF $sPageSource &= " letterNum=message.charCodeAt(i); //assign proper letter code (alphabet array)" & @CRLF $sPageSource &= " if ((letterNum>=65) && (letterNum<=90)) temp=letterNum-65; //letters" & @CRLF $sPageSource &= " else if (letterNum==46) temp=27; //." & @CRLF $sPageSource &= " else if (letterNum==32) temp=26; //space" & @CRLF $sPageSource &= " else if (letterNum==33) temp=28; //!" & @CRLF $sPageSource &= " else if ((letterNum>=49) && (letterNum<=57)) temp=letterNum-20; //[1-9]" & @CRLF $sPageSource &= " else if (letterNum==48) temp=14; //zero" & @CRLF $sPageSource &= " else if (letterNum==63) temp=43; //?" & @CRLF $sPageSource &= " else if (letterNum==44) temp=38; //," & @CRLF $sPageSource &= " else if (letterNum==64) temp=39; //pause" & @CRLF $sPageSource &= " else if (letterNum==35) temp=40; //flash effect" & @CRLF $sPageSource &= " else if (letterNum==94) temp=41; //scroll up effect" & @CRLF $sPageSource &= " else if (letterNum==95) temp=42; //sunrise effect" & @CRLF $sPageSource &= " else if (letterNum==36) temp=44; //split effect" & @CRLF $sPageSource &= " else continue;" & @CRLF $sPageSource &= " for (ii=0; ii<alphabet[temp].length;ii++){ messageArray[columnCount]=alphabet[temp][ii];columnCount++;}" & @CRLF $sPageSource &= " if ((temp!=39) && (temp!=40) && (temp!=41)) {messageArray[columnCount]=""0000000"";columnCount++;}" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "//make 'led screen' with block 0-49 on row 1, block 50-99 on row 2, block 100-149 on row 3, etc.." & @CRLF $sPageSource &= "var b='';" & @CRLF $sPageSource &= "for (var i=0; i<350; i++){//columns 50 columns x 7 rows" & @CRLF $sPageSource &= " rowPos=0+3*(i>49)+3*(i>99)+3*(i>149)+3*(i>199)+3*(i>249)+3*(i>299);" & @CRLF $sPageSource &= " colPos=0+150*(i>49)+150*(i>99)+150*(i>149)+150*(i>199)+150*(i>249)+150*(i>299);" & @CRLF $sPageSource &= " b+= (NS) ? '<LAYER NAME=""block' + i + '"" LEFT=""' + (startXPos+i*3-colPos) + '"" TOP=""' + (startYPos+rowPos) + '"" VISIBILITY=""show"" WIDTH=""2"" HEIGHT=""2"" BGCOLOR=""' + LEDoffColor + '""></LAYER>' : '<div id=""block' + i + '"" style=""position:absolute; left:' + (startXPos+i*3-colPos) + 'px; top:' + (startYPos+rowPos) + 'px; background-color:' + LEDoffColor +'; height: 2px; width: 2px;font-size:2px;""></div>';" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "document.write(b);" & @CRLF $sPageSource &= "var columnCounter=0; //keep track of postion of messageArray" & @CRLF $sPageSource &= "var bb=new Array(); //store particular LED's dom element here" & @CRLF $sPageSource &= " if (NS) { for (var i=0; i<350; i++) { bb[i]=getCSS(""block""+i)}}" & @CRLF $sPageSource &= " else {for (var i=0; i<350; i++){ bb[i]=getCSS(""block""+i).style;}}" & @CRLF $sPageSource &= "var isOn=new Array();for (var i=0; i<350; i++){ isOn[i]=0;} //keep track on on/off status of particular LED" & @CRLF $sPageSource &= "onArray=new Array(); var onCount=0; //array size counter" & @CRLF $sPageSource &= "function scroll(){" & @CRLF $sPageSource &= " onCount=0;" & @CRLF $sPageSource &= " if (NS) { for (var i=0; i<301; i+=50){ if (isOn[i]==1) { bb[i].bgColor=LEDoffColor; isOn[i]=0;} for (var ii=1; ii<50; ii+=7){" & @CRLF $sPageSource &= " temp=i+ii;temp1=temp+1;temp2=temp+2;temp3=temp+3;temp4=temp+4;temp5=temp+5;temp6=temp+6;" & @CRLF $sPageSource &= " if (isOn[temp]==1) {bb[temp].bgColor=LEDoffColor; isOn[temp]=0; bb[temp-1].bgColor=LEDonColor; isOn[temp-1]=1;}" & @CRLF $sPageSource &= " if (isOn[temp1]==1) {bb[temp1].bgColor=LEDoffColor; isOn[temp1]=0; bb[temp].bgColor=LEDonColor; isOn[temp]=1;}" & @CRLF $sPageSource &= " if (isOn[temp2]==1) {bb[temp2].bgColor=LEDoffColor; isOn[temp2]=0; bb[temp+1].bgColor=LEDonColor; isOn[temp+1]=1;}" & @CRLF $sPageSource &= " if (isOn[temp3]==1) {bb[temp3].bgColor=LEDoffColor; isOn[temp3]=0; bb[temp2].bgColor=LEDonColor; isOn[temp2]=1;}" & @CRLF $sPageSource &= " if (isOn[temp4]==1) {bb[temp4].bgColor=LEDoffColor; isOn[temp4]=0; bb[temp3].bgColor=LEDonColor; isOn[temp3]=1;}" & @CRLF $sPageSource &= " if (isOn[temp5]==1) {bb[temp5].bgColor=LEDoffColor; isOn[temp5]=0; bb[temp4].bgColor=LEDonColor; isOn[temp4]=1;}" & @CRLF $sPageSource &= " if (isOn[temp6]==1) {bb[temp6].bgColor=LEDoffColor; isOn[temp6]=0; bb[temp5].bgColor=LEDonColor; isOn[temp5]=1;}" & @CRLF $sPageSource &= " }}}" & @CRLF $sPageSource &= " else { for (var i=0; i<301; i+=50){ if (isOn[i]==1) { bb[i].backgroundColor=LEDoffColor; isOn[i]=0;} for (var ii=1; ii<50; ii+=7){" & @CRLF $sPageSource &= " temp=i+ii;temp1=temp+1;temp2=temp+2;temp3=temp+3;temp4=temp+4;temp5=temp+5;temp6=temp+6;" & @CRLF $sPageSource &= " if (isOn[temp]==1) {bb[temp].backgroundColor=LEDoffColor; isOn[temp]=0; bb[temp-1].backgroundColor=LEDonColor; isOn[temp-1]=1;}" & @CRLF $sPageSource &= " if (isOn[temp1]==1) {bb[temp1].backgroundColor=LEDoffColor; isOn[temp1]=0; bb[temp].backgroundColor=LEDonColor; isOn[temp]=1;}" & @CRLF $sPageSource &= " if (isOn[temp2]==1) {bb[temp2].backgroundColor=LEDoffColor; isOn[temp2]=0; bb[temp+1].backgroundColor=LEDonColor; isOn[temp+1]=1;}" & @CRLF $sPageSource &= " if (isOn[temp3]==1) {bb[temp3].backgroundColor=LEDoffColor; isOn[temp3]=0; bb[temp2].backgroundColor=LEDonColor; isOn[temp2]=1;}" & @CRLF $sPageSource &= " if (isOn[temp4]==1) {bb[temp4].backgroundColor=LEDoffColor; isOn[temp4]=0; bb[temp3].backgroundColor=LEDonColor; isOn[temp3]=1;}" & @CRLF $sPageSource &= " if (isOn[temp5]==1) {bb[temp5].backgroundColor=LEDoffColor; isOn[temp5]=0; bb[temp4].backgroundColor=LEDonColor; isOn[temp4]=1;}" & @CRLF $sPageSource &= " if (isOn[temp6]==1) {bb[temp6].backgroundColor=LEDoffColor; isOn[temp6]=0; bb[temp5].backgroundColor=LEDonColor; isOn[temp5]=1;}" & @CRLF $sPageSource &= " }}}" & @CRLF $sPageSource &= " temp=messageArray[columnCounter]; flag=temp.charAt(0);//GET NEW COLUMN" & @CRLF $sPageSource &= " if (temp.charAt(1)==""1"") {isOn[99]=1;} if (temp.charAt(2)==""1"") {isOn[149]=1} if (temp.charAt(3)==""1"") {isOn[199]=1}" & @CRLF $sPageSource &= " if (temp.charAt(4)==""1"") {isOn[249]=1} if (temp.charAt(5)==""1"") {isOn[299]=1} if (temp.charAt(6)==""1"") {isOn[349]=1}" & @CRLF $sPageSource &= " if (flag==""0"") {} else if (flag==""1"") {isOn[49]=1;} else if (flag==""X"") {pauseScroll();} else if (flag==""Y"") {flashScroll();}" & @CRLF $sPageSource &= " else if (flag==""D"") {dropEffect();} else if (flag==""S"") {sunRiseEffect();} else if (flag==""Q"") {splitEffect();}" & @CRLF $sPageSource &= " columnCounter++; if(columnCounter==columnCount) columnCounter=0;" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "//______________pause effect________________" & @CRLF $sPageSource &= "function pauseScroll(){ clearInterval(loop); setTimeout(""LEDinit()"",3000);}" & @CRLF $sPageSource &= "//______________onArray Section_____________" & @CRLF $sPageSource &= "onArray=new Array(); var onCount=0; //array size counter" & @CRLF $sPageSource &= "function makeOnArray(){ clearInterval(loop); onCount=0; for (var i=0; i<700; i++){if (isOn[i]==1) {onArray[onCount]=i; onCount++;};}//make onArray of 'on' LEDS" & @CRLF $sPageSource &= "}//_________________________________" & @CRLF $sPageSource &= "//_______________flash effect_______________" & @CRLF $sPageSource &= "var flashCount=0;" & @CRLF $sPageSource &= "function flashScroll(){ makeOnArray(); flashCount=0; if (NS) {setTimeout(""flashItNS()"",250);} else {setTimeout(""flashIt()"",250);}}" & @CRLF $sPageSource &= "function flashItNS(){ flashCount++;" & @CRLF $sPageSource &= " if (flashCount<14) {" & @CRLF $sPageSource &= " if (flashCount % 2 == 0){ for (var i=0; i<onCount; i++){ isOn[onArray[i]]=0;bb[onArray[i]].bgColor=LEDoffColor;}}" & @CRLF $sPageSource &= " else {for (var i=0; i<onCount; i++){isOn[onArray[i]]=1;bb[onArray[i]].bgColor=LEDonColor;}}" & @CRLF $sPageSource &= " setTimeout(""flashItNS()"",250);" & @CRLF $sPageSource &= " }" & @CRLF $sPageSource &= " else {flashCount=0; setTimeout(""LEDinit()"",250);}" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "function flashIt(){ flashCount++;" & @CRLF $sPageSource &= " if (flashCount<14) {" & @CRLF $sPageSource &= " if (flashCount % 2 == 0){ for (var i=0; i<onCount; i++){ isOn[onArray[i]]=0;bb[onArray[i]].backgroundColor=LEDoffColor;}}" & @CRLF $sPageSource &= " else {for (var i=0; i<onCount; i++){isOn[onArray[i]]=1;bb[onArray[i]].backgroundColor=LEDonColor;}}" & @CRLF $sPageSource &= " setTimeout(""flashIt()"",250);" & @CRLF $sPageSource &= " }" & @CRLF $sPageSource &= " else {flashCount=0; setTimeout(""LEDinit()"",250);}" & @CRLF $sPageSource &= "}//_________________________________" & @CRLF $sPageSource &= "//____________scroll up effect______________" & @CRLF $sPageSource &= "dropArray=new Array();" & @CRLF $sPageSource &= "function dropEffect(){makeOnArray(); for (var i=0; i<onCount; i++){ dropArray[i]=onArray[i]; } if (NS) {dropItNS();} else {dropIt();}}" & @CRLF $sPageSource &= "var dropCount=0;" & @CRLF $sPageSource &= "function dropItNS(){" & @CRLF $sPageSource &= " if (dropCount<7){for (var i=0; i<onCount; i++){ bb[dropArray[i]].bgColor=LEDoffColor; }" & @CRLF $sPageSource &= " for (var i=0; i<onCount; i++){ temp=dropArray[i]; temp-=50;if (temp<0) temp+=350;bb[temp].bgColor=LEDonColor; dropArray[i]=temp;}" & @CRLF $sPageSource &= " dropCount++; setTimeout(""dropItNS()"",100);" & @CRLF $sPageSource &= " } else {dropCount=0;setTimeout(""LEDinit()"",100);}" & @CRLF $sPageSource &= "}//_________________________________" & @CRLF $sPageSource &= "function dropIt(){" & @CRLF $sPageSource &= " if (dropCount<7){ for (var i=0; i<onCount; i++){ bb[dropArray[i]].backgroundColor=LEDoffColor; }" & @CRLF $sPageSource &= " for (var i=0; i<onCount; i++){ temp=dropArray[i]; temp-=50; if (temp<0) temp+=350; bb[temp].backgroundColor=LEDonColor; dropArray[i]=temp;}" & @CRLF $sPageSource &= " dropCount++; setTimeout(""dropIt()"",100);" & @CRLF $sPageSource &= " } else {dropCount=0;setTimeout(""LEDinit()"",100);}" & @CRLF $sPageSource &= "}//_________________________________" & @CRLF $sPageSource &= "//____________sunrise effect________________" & @CRLF $sPageSource &= "sunRiseCounter=0;sunRiseArray=new Array();" & @CRLF $sPageSource &= "sunRiseArray[0]=new Array(50,101,102,103,154,155,156,207,208,259,260,261,212,163,164,115,116,117,168,169,170,221,222,223,274,275,276,227,228,179,180,131,132,83,134,135,186,187,238,239,240,241,292,293,344,295,296,247,198);//Hills" & @CRLF $sPageSource &= "sunRiseArray[1]=new Array(224,225,226); sunRiseArray[2]=new Array(174,175,176,177); sunRiseArray[3]=new Array(173,124,125,126,127,128,178); sunRiseArray[4]=new Array(172,123,74,75,76,77,129); sunRiseArray[5]=new Array(171,122,73,24,25,26,27,78,79,130);" & @CRLF $sPageSource &= "function sunRiseEffect() { makeOnArray(); for (var i=0; i<onCount; i++){ isOn[onArray[i]]=0; if (!NS) {bb[onArray[i]].backgroundColor=LEDoffColor;} else {bb[onArray[i]].bgColor=LEDoffColor;}}" & @CRLF $sPageSource &= " setTimeout(""riseEffectUp()"",1000);}" & @CRLF $sPageSource &= "function riseEffectUp() {" & @CRLF $sPageSource &= " if (!NS) { for (var ii=0; ii<sunRiseArray[sunRiseCounter].length; ii++) {isOn[sunRiseArray[sunRiseCounter][ii]]=1;bb[sunRiseArray[sunRiseCounter][ii]].backgroundColor=LEDonColor;}}" & @CRLF $sPageSource &= " else {for (var ii=0; ii<sunRiseArray[sunRiseCounter].length; ii++) {isOn[sunRiseArray[sunRiseCounter][ii]]=1;bb[sunRiseArray[sunRiseCounter][ii]].bgColor=LEDonColor;}}" & @CRLF $sPageSource &= " sunRiseCounter++; if (sunRiseCounter>5) {sunRiseCounter=5;setTimeout(""riseEffectDown()"",2000);} else {setTimeout(""riseEffectUp()"",250);}}" & @CRLF $sPageSource &= "function riseEffectDown() {" & @CRLF $sPageSource &= " if (!NS) {for (var ii=0; ii<sunRiseArray[sunRiseCounter].length; ii++) {isOn[sunRiseArray[sunRiseCounter][ii]]=0;bb[sunRiseArray[sunRiseCounter][ii]].backgroundColor=LEDoffColor;}}" & @CRLF $sPageSource &= " else {for (var ii=0; ii<sunRiseArray[sunRiseCounter].length; ii++) {isOn[sunRiseArray[sunRiseCounter][ii]]=0;bb[sunRiseArray[sunRiseCounter][ii]].bgColor=LEDoffColor;}}" & @CRLF $sPageSource &= " sunRiseCounter--; if (sunRiseCounter<1) {sunRiseCounter=0;setTimeout(""LEDinit()"",1500);}" & @CRLF $sPageSource &= " else {setTimeout(""riseEffectDown()"",250);}" & @CRLF $sPageSource &= "}//____________________________________" & @CRLF $sPageSource &= "//____________split scroll effect___________" & @CRLF $sPageSource &= "var splitCount=0;" & @CRLF $sPageSource &= "function splitEffect() { makeOnArray(); for (var i=0; i<onCount; i++) { dropArray[i]=onArray[i]; }" & @CRLF $sPageSource &= " if (NS) {setTimeout(""splitNS()"",55);} else if (IE) {setTimeout(""splitIt()"",55);} else {setTimeout(""splitIt()"",100);}" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "function splitIt(){ for (i=0;i<onCount;i++){ temp=dropArray[i];" & @CRLF $sPageSource &= " if (temp<150) { if (temp==100) {bb[temp].backgroundColor=LEDoffColor; temp=149; bb[temp-1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==50) {bb[temp].backgroundColor=LEDoffColor; temp=99; bb[temp-1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==0) {bb[temp].backgroundColor=LEDoffColor; temp=49; bb[temp-1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else {bb[temp].backgroundColor=LEDoffColor; bb[temp-1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " dropArray[i]=temp-1; }" & @CRLF $sPageSource &= " else { if (temp==199) {bb[temp].backgroundColor=LEDoffColor; temp=200; bb[temp+1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==349) {bb[temp].backgroundColor=LEDoffColor; temp=300; bb[temp+1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==299) {bb[temp].backgroundColor=LEDoffColor; temp=250; bb[temp+1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==249) {bb[temp].backgroundColor=LEDoffColor; temp=200; bb[temp+1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else {bb[temp].backgroundColor=LEDoffColor; bb[temp+1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " dropArray[i]=temp+1; }" & @CRLF $sPageSource &= " } splitCount++; if (splitCount<49) {if (IE) {setTimeout(""splitIt()"",55);} else {setTimeout(""splitIt()"",100);} } else {splitCount=0; LEDinit();}" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "function splitNS(){" & @CRLF $sPageSource &= " for (i=0;i<onCount;i++){ temp=dropArray[i];" & @CRLF $sPageSource &= " if (temp<150) { if (temp==100) {bb[temp].bgColor=LEDoffColor; temp=149; bb[temp-1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==50) {bb[temp].bgColor=LEDoffColor; temp=99; bb[temp-1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==0) {bb[temp].bgColor=LEDoffColor; temp=49; bb[temp-1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else {bb[temp].bgColor=LEDoffColor; bb[temp-1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " dropArray[i]=temp-1; }" & @CRLF $sPageSource &= " else { if (temp==199) {bb[temp].bgColor=LEDoffColor; temp=200; bb[temp+1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==349) {bb[temp].bgColor=LEDoffColor; temp=300; bb[temp+1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==299) {bb[temp].bgColor=LEDoffColor; temp=250; bb[temp+1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else if (temp==249) {bb[temp].bgColor=LEDoffColor; temp=200; bb[temp+1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else {bb[temp].bgColor=LEDoffColor; bb[temp+1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " dropArray[i]=temp+1; }" & @CRLF $sPageSource &= " } splitCount++; if (splitCount<49) {setTimeout(""splitNS()"",55);} else {splitCount=0; LEDinit();}" & @CRLF $sPageSource &= "}//___________________________________" & @CRLF $sPageSource &= "function LEDinit(){if (NS) {loop=setInterval(""scroll()"",55);} else if (IE){loop=setInterval(""scroll()"",55);} else {loop=setInterval(""scroll()"",100);}}" & @CRLF $sPageSource &= "</SCRIPT>" & @CRLF $sPageSource &= "</BODY></HTML>" & @CRLF Return $sPageSource EndFunc ;==>_GetPage2 points
-
Hi guys, here is a small dll wrapper I made geared at making YOLOv3 (Joseph Redmon, Ali Farhadi) more accessible to AutoIt users. Homepage of YOLO: https://pjreddie.com/darknet/yolo/ Technical overview: You only look once (YOLO) is a state-of-the-art, real-time object detection system. On a Pascal Titan X it processes images at 30 FPS and has a mAP of 57.9% on COCO test-dev. (from https://pjreddie.com/darknet/yolo/) Screenshots: Features: This UDF currently supports recognizing objects in images passed in as a HBITMAP Below is a complete list of the functions currently available in this library: ; #CURRENT# ===================================================================================================================== ;_AutoYolo3_GetLastError ;_AutoYolo3_GetObjInHBitmap ;_AutoYolo3_GetVersion ;_AutoYolo3_SetConfig ;_AutoYolo3_YoloTest ; =============================================================================================================================== The _AutoYolo3_GetObjInHBitmap function returns a 2D Array of detected objects as illustrated below: Examples: Example1: basic_example.au3 #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <AutoYOLO3.au3> #include <GDIPlus.au3> ConsoleWrite("Using autoyolo version:" & _AutoYolo3_GetVersion() & @CRLF) _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir&"\people-2557408_1920.jpg") Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage, 0x00000000) Local $aRes = _AutoYolo3_GetObjInHBitmap($hHBITMAP) _ArrayDisplay($aRes) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() Example 2: gui_example.au3 #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_AU3Check_Parameters=-w 1 -w 2 -w 3 -w 4 -w 5 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <AutoYOLO3.au3> #include <GDIPlus.au3> ConsoleWrite("Using autoyolo version:" & _AutoYolo3_GetVersion() & @CRLF) _GUIExample1() Func _GUIExample1() _GDIPlus_Startup() Local $iPicW=609 Local $iPicH=385 #Region ### START Koda GUI section ### Form= GUICreate(@ScriptName&" - Object Detection with AutoIt!", 625, 506) GUISetFont(14, 400, 0, "Calibri") Local $Button1 = GUICtrlCreateButton("browse", 472, 8, 145, 33) Local $Input1 = GUICtrlCreateInput(@ScriptDir & "\scooter-5180947_1920.jpg", 8, 8, 457, 31) Local $Button2 = GUICtrlCreateButton("detect objects!", 228, 448, 169, 49) Local $Pic1 = GUICtrlCreatePic("", 8, 48, $iPicW, $iPicH, $SS_BITMAP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $hImage = _LoadImage($Input1, $Pic1, 0, $iPicW,$iPicH) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 GUICtrlSetData($Input1, FileOpenDialog("Please select image", @ScriptDir, "All (*.*)")) $hImage = _LoadImage($Input1, $Pic1, $hImage, $iPicW,$iPicH) Case $Button2 GUICtrlSetState($Button2, $GUI_DISABLE) GUICtrlSetData($Button2, "working..") Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage, 0x00000000) Local $aRes = _AutoYolo3_GetObjInHBitmap($hHBITMAP) ;_ArrayDisplay($aRes) If @error Then Local $iErr = @error Local $asDllErrors[6] = ["No error", "unable to use the DLL file", "unknown ""return type""", """function"" not found in the DLL file", "bad number of parameters", "bad parameter"] If $iErr < 6 Then MsgBox(32, @ScriptName, "DLL Error, " & $asDllErrors[$iErr]) Else MsgBox(32, @ScriptName, "DLL Error, " & _AutoYolo3_GetLastError()) EndIf ElseIf _AutoYolo3_GetLastError() <> "" Then MsgBox(32, @ScriptName, _AutoYolo3_GetLastError()) Else ;nice thick green boxes Local $hPen = _GDIPlus_PenCreate(0xFF00FF00, 2, 2) Local $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000) Local $hFormat = _GDIPlus_StringFormatCreate() Local $hFamily = _GDIPlus_FontFamilyCreate("Calibri") Local $hFont = _GDIPlus_FontCreate($hFamily, 12, 0) Local $tLayout = _GDIPlus_RectFCreate(140, 110, 100, 20) Local $hBrushBack = _GDIPlus_BrushCreateSolid(0x7FFFFFFF) ;color format AARRGGBB (hex) $hGraphics = _GDIPlus_ImageGetGraphicsContext($hImage) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;sets the graphics object rendering quality (antialiasing) For $i = 1 To $aRes[0][0] ; Draw a frame around the object _GDIPlus_GraphicsDrawRect($hGraphics, $aRes[$i][2], $aRes[$i][3] , ($aRes[$i][4] - $aRes[$i][2]) , ($aRes[$i][5] - $aRes[$i][3]) , $hPen) ; Label it $sLabel = $aRes[$i][0] & " " & StringLeft($aRes[$i][1], 6) $tLayout = _GDIPlus_RectFCreate($aRes[$i][2] , $aRes[$i][3] , 200, 20) $iBackLen = 0 If (StringLen($sLabel) * 8) > $iBackLen Then $iBackLen = StringLen($sLabel) * 8 EndIf _GDIPlus_GraphicsFillRect($hGraphics, $aRes[$i][2] , $aRes[$i][3], $iBackLen, 20, $hBrushBack) _GDIPlus_GraphicsDrawStringEx($hGraphics, $sLabel, $hFont, $tLayout, $hFormat, $hBrush) Next $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage, 0x00000000) GUICtrlSendMsg($Pic1, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBITMAP) _GDIPlus_PenDispose($hPen) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrush) _GDIPlus_BrushDispose($hBrushBack) _GDIPlus_GraphicsDispose($hGraphics) EndIf GUICtrlSetData($Button2, "detect objects!") GUICtrlSetState($Button2, $GUI_ENABLE) EndSwitch WEnd If $hImage <> 0 Then _GDIPlus_ImageDispose($hImage) EndIf _GDIPlus_Shutdown() EndFunc ;==>_GUIExample1 Func _LoadImage($Input1, $Pic1, $hImage, $iPicW, $iPicH) If $hImage <> 0 Then _GDIPlus_ImageDispose($hImage) EndIf Local $sImagePath = GUICtrlRead($Input1) $hImage = _GDIPlus_ImageLoadFromFile($sImagePath) Local $iWidth = _GDIPlus_ImageGetWidth($hImage) Local $iHeight = _GDIPlus_ImageGetHeight($hImage) Local $sFactor = 1 If $iWidth > $iPicW Then $sFactor = $iPicW / $iWidth EndIf If $iHeight > $iPicH And ($iHeight * $sFactor) > $iPicH Then $sFactor = $iPicH / $iHeight EndIf $iHeight = $iHeight * $sFactor $iWidth = $iWidth * $sFactor $hResizedImage = _GDIPlus_ImageResize($hImage, $iWidth, $iHeight) _GDIPlus_BitmapDispose($hImage) Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hResizedImage, 0x00000000) GUICtrlSendMsg($Pic1, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBITMAP) Return $hResizedImage EndFunc ;==>_LoadImage Requirements: Windows x64, AutoIt x64 Microsoft Visual C++ 2015-2019 Redistributable (x64) - https://aka.ms/vs/16/release/vc_redist.x64.exe OpenCV binaries - https://sourceforge.net/projects/opencvlibrary/files/4.3.0/opencv-4.3.0-vc14_vc15.exe/download Quickstart: Ensure you are running Windows x64, AutoIt x64 Install Microsoft Visual C++ 2015-2019 Redistributable (x64) if not already installed - https://aka.ms/vs/16/release/vc_redist.x64.exe Create your project directory anywhere, for this example we use C:\projectdir\ Download OpenCV - https://sourceforge.net/projects/opencvlibrary/files/4.3.0/opencv-4.3.0-vc14_vc15.exe/download Unpack OpenCV anywhere and copy opencv_videoio_ffmpeg430_64.dll, opencv_world430.dll to C:\projectdir\ Download trained weights, classes, config files Weights file: Save as C:\projectdir\yolo\yolov3.weights - https://pjreddie.com/media/files/yolov3.weights Classes file: Save as C:\projectdir\yolo\yolov3.txt - https://github.com/pjreddie/darknet/blob/master/data/coco.names https://raw.githubusercontent.com/zishor/yolo-python-rtsp/master/cfg/yolov3.txt NEW Config file: Save as C:\projectdir\yolo\yolov3.cfg - https://github.com/pjreddie/darknet/blob/master/cfg/yolov3.cfg https://raw.githubusercontent.com/zishor/yolo-python-rtsp/master/cfg/yolov3.cfg NEW Unpack autoyolo1.1.zip from downloads below to your project dir So your project directory should look like: C:\projectdir\ │ autoyolo.dll │ AutoYOLO3.au3 │ basic_example.au3 │ gui_example.au3 │ opencv_videoio_ffmpeg430_64.dll │ opencv_world430.dll │ people-2557408_1920.jpg │ scooter-5180947_1920.jpg │ └───yolo yolov3.cfg yolov3.txt yolov3.weights You are done! Try running one of the examples! Download: LAST UPDATED: 06-JUN-2020 autoyolo1.1.zip 785 KB Credits: YOLOv3: An Incremental Improvement - Joseph Redmon, Ali Farhad https://pjreddie.com/yolo/ https://www.learnopencv.com/deep-learning-based-object-detection-using-yolov3-with-opencv-python-c/ zishor for alternative config and classes (https://github.com/zishor/yolo-python-rtsp) MIT License FAQ: I get error "Cannot use dll" Ensure that you are running script as x64, that you have Microsoft Visual C++ 2015-2019 Redistributable (x64) installed, and that the following files are in the @ScriptDir: autoyolo.dll, opencv_videoio_ffmpeg430_64.dll, opencv_world430.dll I get a crash when clicking detect Try using the NEW config and classes links above All feedback is welcome -smartee1 point
-
The Running Object Table (ROT) is a system global table where objects can register themselves. This makes the objects accessible in processes other than the process where the object was created. IRunningObjectTable and related interfaces provides access to register and maintain objects in the ROT. ThreadsOther threads related to ROT objects: Non-blocking data display functions IPC Techniques through ROT Objects AutoIt and Perl integration through ROT objects Access AutoIt by trancexx is about executing AutoIt commands in other programming languages. The AutoIt command is executed by calling a Call method of the ROT object. The example is based on the AutoItObject UDF. Posts (2021-01-03)This is a list of the most interesting posts below: Usage section with typical examples of the use of ROT objects with the following subsections: Passing array between AutoIt programs Passing array between AutoIt and VBScript Passing data through ROT Objects Executing Object Methods through VBScript VBScript (2021-01-03)VBScript is used as a consistent programming language to demonstrate the ROT technique for communicating between AutoIt and other languages. This is a list of the VBScript posts: Passing array between AutoIt and VBScript (in middle of post) Executing Object Methods through VBScript BasicRegister an objectExamples\1) Basic\0) ROT_RegisterObject.au3 #include <Array.au3> #include "..\..\Includes\IRunningObjectTable.au3" Example() Func Example() Local $sNameId = "DataTransferObject" & ROT_CreateGUID() Local $iHandle = ROT_RegisterObject( Default, $sNameId ) ; Default => Object = Dictionary object If Not $iHandle Then Return ConsoleWrite( "ROT_RegisterObject ERR" & @CRLF ) ConsoleWrite( "ROT_RegisterObject OK" & @CRLF ) Local $aROT_List = ROT_Enumerate() _ArrayDisplay( $aROT_List, "ROT_RegisterObject" ) EndFunc Output in _ArrayDisplay looks like this: DataTransferObject-{05DCB964-FD4B-40EC-A95A-999491347D20} $sNameId (similar to ProgID) is the identification of the ROT object and is used in the ObjGet() function to access the object in this way: Local $oDataTransferObject = ObjGet( "DataTransferObject-{05DCB964-FD4B-40EC-A95A-999491347D20}" ) ROT_CreateGUID() is used to make $sNameId unique. See below. ROT_RegisterObject() is the function that registers the object in the ROT. The Dictionary object is the actual object that is registered in the ROT. The Add method allows you to add a new key/item pair to the object. The key is often a string. The item property can be any COM compatible data type which includes most AutoIt data types. An exception is the DllStruct type which must be converted to a compatible type. Because many different data types can be used in the item property and the item can be identified through a key, the Dictionary object is generally applicable for many different purposes. More information about registering objects in the ROT can be found in this Microsoft documentation. ROT_Enumerate() enumerate the objects, that are registered in the ROT. The program that registers an object in the ROT plays the role of server. One or more programs that access the ROT object with the ObjGet() function play the role of clients. The ROT object is only available as long as the server program is running or until the server program deletes the object with the ROT_Revoke() function. You can find examples of using the functions in Examples\1) Basic\. ROT objects (2020-07-11)The Dictionary object is the default object in the ROT_RegisterObject() function. The object that's passed to this function is the actual object that's registered in the ROT. The Dictionary object works fine when passing data between AutoIt scripts, between AutoIt and VBScript, and between AutoIt and Perl. However, situations may easily arise where it can be an advantage to pass data with a very simple object with just a single property. There are several options for creating such a simple object. This can be done through C# and VB.NET code, as demonstrated in Using C# and VB Code in AutoIt through .NET Framework. And it can be done through the AutoItObject UDF. Examples\4) ROT Objects\ contains examples for creating the ROT object in these three ways. Client.au3 is the same script in all examples: #include <Array.au3> Example() Func Example() Local $sNameId = "DataTransfer" Local $oDataTransfer = ObjGet( $sNameId ) Local $aArray = $oDataTransfer.Item _ArrayDisplay( $aArray ) EndFunc Create object with C# code CSharp\Server.au3: #include "..\..\..\Includes\IRunningObjectTable.au3" #include "..\DotNetAll.au3" Example() Func Example() Local $aArray[1000][10] For $i = 0 To 1000 - 1 For $j = 0 To 10 - 1 $aArray[$i][$j] = $i & "/" & $j Next Next Local $oNetCode = DotNet_LoadCScode( FileRead( "Object.cs" ), "System.dll" ) Local $oCSObject = DotNet_CreateObject( $oNetCode, "CSObjClass" ) $oCSObject.Item = $aArray Local $sNameId = "DataTransfer" ROT_RegisterObject( Ptr( $oCSObject ), $sNameId ) RunWait( @AutoItExe & " /AutoIt3ExecuteScript " & "Client.au3" ) EndFunc CSharp\Object.cs: using System; public class CSObjClass { public object Item { get; set; } } Create object with VB.NET code VB.NET\Server.au3: #include "..\..\..\Includes\IRunningObjectTable.au3" #include "..\DotNetAll.au3" Example() Func Example() Local $aArray[1000][10] For $i = 0 To 1000 - 1 For $j = 0 To 10 - 1 $aArray[$i][$j] = $i & "/" & $j Next Next Local $oNetCode = DotNet_LoadVBcode( FileRead( "Object.vb" ), "System.dll" ) Local $oVBObject = DotNet_CreateObject( $oNetCode, "VBObjClass" ) $oVBObject.Item = $aArray Local $sNameId = "DataTransfer" ROT_RegisterObject( Ptr( $oVBObject ), $sNameId ) RunWait( @AutoItExe & " /AutoIt3ExecuteScript " & "Client.au3" ) EndFunc VB.NET\Object.vb: Imports System Public Class VBObjClass Public Property Item As Object End Class In AutoIt/Perl integration, the very first attempts were performed with the VB.NET object. Check for recognition of the ROT object with this Client.pl script (copied from the AutoIt/Perl example) : use strict; use Win32::OLE; my $oObj = Win32::OLE->GetObject( "DataTransfer" ); Win32::OLE->EnumAllObjects( sub { my $Object = shift; my $Class = Win32::OLE->QueryObjectType( $Object ); printf "Object = %s, Class = %s\n", $Object, $Class; } ); Gave the following output: Object = Win32::OLE=HASH(0x72a51c), Class = _VBObjClass ; VB.NET object Object = Win32::OLE=HASH(0x71b5a8), Class = IDictionary ; Dictionary object Create object with AutoItObject AutoItObject\Server.au3: #include "..\..\..\Includes\IRunningObjectTable.au3" #include "AutoitObject.au3" Example() Func Example() Local $aArray[1000][10] For $i = 0 To 1000 - 1 For $j = 0 To 10 - 1 $aArray[$i][$j] = $i & "/" & $j Next Next _AutoItObject_StartUp() Local $oObject = NewObject(), $sNameId = "DataTransfer" ROT_RegisterObject( Ptr( $oObject ), $sNameId ) Local $oDataTransfer = ObjGet( $sNameId ) $oDataTransfer.Item = $aArray RunWait( @AutoItExe & " /AutoIt3ExecuteScript " & "Client.au3" ) _AutoItObject_Shutdown() EndFunc Func NewObject() Local $oClassObject = _AutoItObject_Class() $oClassObject.AddProperty( "Item" ) Return $oClassObject.Object EndFunc Unique objectsWhen using ROT objects in real code, there is a particular question that needs to be addressed. The question is how to make sure that $sNameId, which clients use to access the object with the ObjGet() function, actually identifies a unique object. Running a server program twice in succession can easily create two ROT objects with the same $sNameId. But how do you actually access the ROT object that was created first and the ROT object that was created last? The answer to the question is to make sure that $sNameId also becomes unique so that you can distinguish between the two objects. To that end, the ROT_CreateGUID() function is created (copy of _WinAPI_CreateGUID()). The function can ensure a unique $sNameId as shown in the example above. The problem and solution is demonstrated in Examples\1) Basic\2) Multiple ROT objects.au3. Time stampsUsing the NoteChangeTime() and GetTimeOfLastChange() methods of the IRunningObjectTable interface, you can set and get timestamps on a ROT object. But these timestamps do not seem particularly useful. Therefore, the methods are not implemented. The UDFThe IRunningObjectTable UDF, Includes\IRunningObjectTable.au3, is a very small UDF with less than 150 lines of code: #include-once ; --- Interface definitions --- Global Const $sIID_IRunningObjectTable = "{00000010-0000-0000-C000-000000000046}" Global Const $dtag_IRunningObjectTable = _ "Register hresult(dword;ptr;ptr;dword*);" & _ "Revoke hresult(dword);" & _ "IsRunning hresult(ptr);" & _ "GetObject hresult(ptr;ptr*);" & _ "NoteChangeTime hresult(dword;struct*);" & _ "GetTimeOfLastChange hresult(ptr;ptr*);" & _ "EnumRunning hresult(ptr*);" Global Const $ROTFLAGS_REGISTRATIONKEEPSALIVE = 0x1 Global Const $ROTFLAGS_ALLOWANYCLIENT = 0x2 Global Const $sIID_IEnumMoniker = "{00000102-0000-0000-C000-000000000046}" Global Const $dtag_IEnumMoniker = _ "Next hresult(ulong;ptr*;ulong*);" & _ "Skip hresult(ulong);" & _ "Reset hresult();" & _ "Clone hresult(ptr*);" Global Const $sIID_IPersist = "{0000010C-0000-0000-C000-000000000046}" Global Const $dtag_IPersist = _ "GetClassID hresult(ptr*);" Global Const $sIID_IPersistStream = "{00000109-0000-0000-C000-000000000046}" Global Const $dtag_IPersistStream = $dtag_IPersist & _ "IsDirty hresult();" & _ "Load hresult(ptr);" & _ "Save hresult(ptr;bool);" & _ "GetSizeMax hresult(uint*);" Global Const $sIID_IMoniker = "{0000000F-0000-0000-C000-000000000046}" Global Const $dtag_IMoniker = $dtag_IPersistStream & _ "BindToObject hresult();" & _ "BindToStorage hresult();" & _ "Reduce hresult();" & _ "ComposeWith hresult();" & _ "Enum hresult();" & _ "IsEqual hresult();" & _ "Hash hresult();" & _ "IsRunning hresult(ptr;ptr;ptr);" & _ "GetTimeOfLastChange hresult(ptr;ptr;ptr);" & _ "Inverse hresult();" & _ "CommonPrefixWith hresult();" & _ "RelativePathTo hresult();" & _ "GetDisplayName hresult(ptr;ptr;wstr*);" & _ "ParseDisplayName hresult();" & _ "IsSystemMoniker hresult(ptr*);" ; --- Windows API functions --- Func ROT_GetRunningObjectTable() Return DllCall( "Ole32.dll", "long", "GetRunningObjectTable", "dword", 0, "ptr*", 0 )[2] EndFunc Func ROT_CreateFileMoniker( $sNameId ) Return DllCall( "Ole32.dll", "long", "CreateFileMoniker", "wstr", $sNameId, "ptr*", 0 )[2] EndFunc Func ROT_CreateBindCtx() Return DllCall( "Ole32.dll", "long", "CreateBindCtx", "dword", 0, "ptr*", 0 )[2] EndFunc ; --- UDF functions --- ; Failure: Returns 0 ; Success: Returns $iHandle ; Registers an object and its identifying moniker in the ROT Func ROT_RegisterObject( $pObject, $sNameId, $iFlags = $ROTFLAGS_REGISTRATIONKEEPSALIVE ) If $pObject = Default Then Local $oDict = ObjCreate( "Scripting.Dictionary" ) $pObject = Ptr( $oDict ) EndIf If Not $pObject Or Not $sNameId Then Return 0 Local $oRunningObjectTable = ObjCreateInterface( ROT_GetRunningObjectTable(), $sIID_IRunningObjectTable, $dtag_IRunningObjectTable ) If Not IsObj( $oRunningObjectTable ) Then Return 0 Local $pMoniker = ROT_CreateFileMoniker( $sNameId ) If Not $pMoniker Then Return 0 Local $iHandle $oRunningObjectTable.Register( $iFlags, $pObject, $pMoniker, $iHandle ) Return $iHandle ? $iHandle : 0 EndFunc ; Returns unique GUID as string ; Copied from _WinAPI_CreateGUID Func ROT_CreateGUID() Local Static $tGUID = DllStructCreate( "struct;ulong Data1;ushort Data2;ushort Data3;byte Data4[8];endstruct" ) DllCall( "Ole32.dll", "long", "CoCreateGuid", "struct*", $tGUID ) Return "-" & DllCall( "Ole32.dll", "int", "StringFromGUID2", "struct*", $tGUID, "wstr", "", "int", 65536 )[2] EndFunc ; Failure: Returns 0 ; Success: Returns $aROT_List ; Enumerates objects and identifying monikers in the ROT Func ROT_Enumerate() Local $oRunningObjectTable = ObjCreateInterface( ROT_GetRunningObjectTable(), $sIID_IRunningObjectTable, $dtag_IRunningObjectTable ) If Not IsObj( $oRunningObjectTable ) Then Return 0 Local $pEnumMoniker $oRunningObjectTable.EnumRunning( $pEnumMoniker ) Local $oEnumMoniker = ObjCreateInterface( $pEnumMoniker, $sIID_IEnumMoniker, $dtag_IEnumMoniker ) If Not IsObj( $oEnumMoniker ) Then Return 0 Local $pMoniker, $oMoniker, $pBindCtx, $sMonikerName, $i = 0 Local $oDict = ObjCreate( "Scripting.Dictionary" ) While( $oEnumMoniker.Next( 1, $pMoniker, NULL ) = 0 ) $pBindCtx = ROT_CreateBindCtx() $oMoniker = ObjCreateInterface( $pMoniker, $sIID_IMoniker, $dtag_IMoniker ) $oMoniker.GetDisplayName( $pBindCtx, NULL, $sMonikerName ) $oDict.Add( "Key" & $i, $sMonikerName ) $i += 1 WEnd Local $aROT_List = $oDict.Items() Return $aROT_List EndFunc ; Failure: Returns 0 ; Success: Returns 1 ; Removes an object and its identifying moniker from the ROT Func ROT_Revoke( $iHandle ) If Not $iHandle Then Return 0 Local $oRunningObjectTable = ObjCreateInterface( ROT_GetRunningObjectTable(), $sIID_IRunningObjectTable, $dtag_IRunningObjectTable ) If Not IsObj( $oRunningObjectTable ) Then Return 0 Return Not $oRunningObjectTable.Revoke( $iHandle ) * 1 EndFunc 7z-fileThe 7z-file contains source code for the UDF and examples. You need AutoIt 3.3.12 or later. Tested on Windows 7 and Windows 10. Comments are welcome. Let me know if there are any issues. IRunningObjectTable.7z1 point
-
Scripting example based on code by ChimpWebView2-4.au3: #AutoIt3Wrapper_Au3Check_Parameters=-d -w- 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_UseX64=y Opt( "MustDeclareVars", 1 ) #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPICom.au3> #include <WinAPI.au3> Global $hGui ; Project includes #include "..\Includes\WV2Interfaces.au3" WebView2() Func WebView2() ; Create WebView2 GUI $hGui = GUICreate( "WebView2 Sample", 600, 300, -1, -1, $WS_OVERLAPPEDWINDOW ) ; Create Button Local $idButton = GUICtrlCreateButton( "ExecuteScript", 10, 250, 170, 40 ) ; Initialize COM _WinAPI_CoInitialize( $COINIT_APARTMENTTHREADED ) ; Create callback interface and functions CoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerCreate( True ) ; Forces CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke() below to be executed ; Create callback interface and functions CoreWebView2CreateCoreWebView2ControllerCompletedHandlerCreate( True ) ; Create callback interface and functions CoreWebView2ExecuteScriptCompletedHandlerCreate( True ) ; DllCall CreateCoreWebView2EnvironmentWithOptions Local $hWebView2Loader = DllOpen( @AutoItX64 ? "WebView2Loader-x64.dll" : "WebView2Loader-x86.dll" ) Local $aRet = DllCall( $hWebView2Loader, "long", "CreateCoreWebView2EnvironmentWithOptions", "wstr", "", "wstr", "", _ "ptr", Null, "ptr", $pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler ) If @error Or $aRet[0] Then Return ConsoleWrite( "CreateCoreWebView2EnvironmentWithOptions ERR" & @CRLF ) ConsoleWrite( "CreateCoreWebView2EnvironmentWithOptions OK" & @CRLF & @CRLF ) ; Show WebView2 GUI GUISetState( @SW_SHOW ) ; Loop While 1 Switch GUIGetMsg() Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESIZED, $GUI_EVENT_RESTORE Local $tRect = _WinAPI_GetClientRect( $hGui ) $oCoreWebView2Controller.put_Bounds( $tRect ) Case $idButton $oCoreWebView2.ExecuteScript( "alert( 'Hello' );", $pCoreWebView2ExecuteScriptCompletedHandler ) ; Forces CoreWebView2ExecuteScriptCompletedHandler_Invoke() below to be executed Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Cleanup CoreWebView2CreateCoreWebView2ControllerCompletedHandlerDelete() CoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerDelete() CoreWebView2ExecuteScriptCompletedHandlerDelete() DllClose( $hWebView2Loader ) EndFunc ; Copied from WV2Interfaces.au3 ; Executed automatically when the callback interface is created Func CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke( $pSelf, $long, $ptr ) ; Ret: long Par: long;ptr* ConsoleWrite( "CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke" & @CRLF ) ; Create CoreWebView2Environment object $oCoreWebView2Environment = ObjCreateInterface( $ptr, $sIID_ICoreWebView2Environment, $dtag_ICoreWebView2Environment ) ConsoleWrite( "IsObj( $oCoreWebView2Environment ) = " & IsObj( $oCoreWebView2Environment ) & @CRLF & @CRLF ) ; Set $pCoreWebView2CreateCoreWebView2ControllerCompletedHandler callback pointer for the WebView2 GUI $oCoreWebView2Environment.CreateCoreWebView2Controller( $hGui, $pCoreWebView2CreateCoreWebView2ControllerCompletedHandler ) ; Forces CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke() below to be executed Return 0 ; S_OK = 0x00000000 #forceref $pSelf, $long EndFunc ; Copied from WV2Interfaces.au3 ; Executed as a consequence of $oCoreWebView2Environment.CreateCoreWebView2Controller() above Func CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke( $pSelf, $long, $ptr ) ; Ret: long Par: long;ptr* ConsoleWrite( "CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke" & @CRLF ) ; Create CoreWebView2Controller object $oCoreWebView2Controller = ObjCreateInterface( $ptr, $sIID_ICoreWebView2Controller, $dtag_ICoreWebView2Controller ) ConsoleWrite( "IsObj( $oCoreWebView2Controller ) = " & IsObj( $oCoreWebView2Controller ) & @CRLF ) $oCoreWebView2Controller.AddRef() ; Prevent the object from being deleted when the function ends ; Set bounds for the CoreWebView2 object Local $tRect = _WinAPI_GetClientRect( $hGui ) $oCoreWebView2Controller.put_Bounds( $tRect ) ; Create CoreWebView2 object $oCoreWebView2Controller.get_CoreWebView2( $pCoreWebView2 ) $oCoreWebView2 = ObjCreateInterface( $pCoreWebView2, $sIID_ICoreWebView2, $dtag_ICoreWebView2 ) ConsoleWrite( "IsObj( $oCoreWebView2 ) = " & IsObj( $oCoreWebView2 ) & @CRLF & @CRLF ) ; Navigate to web page $oCoreWebView2.NavigateToString( _GetPage() ) Return 0 ; S_OK = 0x00000000 #forceref $pSelf, $long EndFunc ; Copied from WV2Interfaces.au3 ; Executed as a consequence of $oCoreWebView2.ExecuteScript() above Func CoreWebView2ExecuteScriptCompletedHandler_Invoke( $pSelf, $long, $wstr ) ; Ret: long Par: long;wstr ConsoleWrite( "CoreWebView2ExecuteScriptCompletedHandler_Invoke()" & @CRLF ) ConsoleWrite( "$long = " & $long & @TAB & "$wstr = " & $wstr & @CRLF & @CRLF ) Return 0 ; S_OK = 0x00000000 #forceref $pSelf EndFunc Func _GetPage() Local $sPageSource = "" $sPageSource &= "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">" & @CRLF $sPageSource &= "<HTML><HEAD><TITLE>L E D Panel Script</TITLE>" & @CRLF $sPageSource &= "<META http-equiv=Content-Type content=""text/html; charset=windows-1252"">" & @CRLF $sPageSource &= "<STYLE type=text/css>" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "body{" & @CRLF $sPageSource &= "background-color:black;" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "</STYLE>" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "</HEAD>" & @CRLF $sPageSource &= "<BODY onload=""LEDinit()"">" & @CRLF $sPageSource &= "<img src=""https://www.autoitscript.com/forum/cdn/images/logo_autoit_210x72.svg"" width=""100"" height=""35"" style=""position: absolute; top: 5px; left: 200px;"">" & @CRLF $sPageSource &= "<SCRIPT language=JavaScript>" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "//""L.E.D. Panel"" Script by Richard Maloney © 2002" & @CRLF $sPageSource &= "//For Custom effects, email Richard ( ottawo@rogers.com )" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "//____________________CONFIGURATION AREA_____________________" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "// THIS LED SCRIPT TAKES UP 200 pixels HORIZONTAL and 28 pixels VERTICAL -Have Fun :- )" & @CRLF $sPageSource &= "// YOUR MESSAGE GOES ON NEXT 4 LINES DOWN." & @CRLF $sPageSource &= "// ALLOWABLE CHARACTERS ARE: A-Z, Period, space, comma, numerals, question mark and 'message codes'." & @CRLF $sPageSource &= "// THE 4 MESSAGE CODES:" & @CRLF $sPageSource &= "// @=PAUSE FOR 3 SECONDS, #=FLASH FOR 3 SECONDS, ^=SCROLL UP EFFECT, _=SUN EFFECT, $=SPLIT EFFECT" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "//EXAMPLE: var message=""_ Dynamic^^ Drive! # For the best dhtml scripts... www.dynamic.drive.com "";" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "var message=""HI EVERYONE@ LARSJ HAS DONE A VERY GOOD JOB# WEBVIEW2^^ A POWERFUL TOOL !!!@$@ A NEW SUN HAS RISEN@_ "";" & @CRLF $sPageSource &= "var LEDonColor='Red'; //color of the LEDs when they are on" & @CRLF $sPageSource &= "var LEDoffColor='#7D0605'; //color of the LEDs when they are off" & @CRLF $sPageSource &= "startXPos=10; //start of horizontal position eg. startXPos=20; places the leds 20 pixels from left" & @CRLF $sPageSource &= "startYPos=10; //start of vertical position" & @CRLF $sPageSource &= "//____________________END CONFIGURATION AREA__________________" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "var IE=( document.all ) ? true:false; var NS=( document.layers ) ? true:false; var W3C=( ( document.getElementById ) && ( !IE ) ) ? true:false;" & @CRLF $sPageSource &= "var d=document; if ( window.offscreenBuffering ) window.offscreenBuffering = true;" & @CRLF $sPageSource &= "function getCSS( id ) {" & @CRLF $sPageSource &= " if ( IE ) return d.all[id] //IE" & @CRLF $sPageSource &= " else if ( NS ) return d.layers[id] //NS4" & @CRLF $sPageSource &= " else return d.getElementById( id )//W3C" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "var alphabet=new Array( 44 );" & @CRLF $sPageSource &= "alphabet[0]=new Array( ""0111111"",""1001000"",""1001000"",""1001000"",""0111111"" ); alphabet[1]=new Array( ""1111111"",""1001001"",""1001001"",""1001001"",""0110110"" );//B" & @CRLF $sPageSource &= "alphabet[2]=new Array( ""0111110"",""1000001"",""1000001"",""1000001"",""0100010"" ); alphabet[3]=new Array( ""1111111"",""1000001"",""1000001"",""1000001"",""0111110"" );//D" & @CRLF $sPageSource &= "alphabet[4]=new Array( ""1111111"",""1001001"",""1001001"",""1001001"" ); alphabet[5]=new Array( ""1111111"",""1001000"",""1001000"",""1001000"" );//F" & @CRLF $sPageSource &= "alphabet[6]=new Array( ""0111110"",""1000001"",""1000001"",""1001001"",""0101110"" ); alphabet[7]=new Array( ""1111111"",""0001000"",""0001000"",""0001000"",""1111111"" );//H" & @CRLF $sPageSource &= "alphabet[8]=new Array( ""1000001"",""1111111"",""1000001"" ); alphabet[9]=new Array( ""0000110"",""0000001"",""0000001"",""0000001"",""1111110"" );//J" & @CRLF $sPageSource &= "alphabet[10]=new Array( ""1111111"",""0001000"",""0010100"",""0100010"",""1000001"" ); alphabet[11]=new Array( ""1111111"",""0000001"",""0000001"",""0000001"" );//L" & @CRLF $sPageSource &= "alphabet[12]=new Array( ""1111111"",""0010000"",""0001000"",""0010000"",""1111111"" ); alphabet[13]=new Array( ""1111111"",""0010000"",""0001000"",""0000100"",""1111111"" );//N" & @CRLF $sPageSource &= "alphabet[14]=new Array( ""0111110"",""1000001"",""1000001"",""1000001"",""0111110"" ); alphabet[15]=new Array( ""1111111"",""1001000"",""1001000"",""1001000"",""0110000"" );//P" & @CRLF $sPageSource &= "alphabet[16]=new Array( ""0111110"",""1000001"",""1000001"",""1000011"",""0111111"" ); alphabet[17]=new Array( ""1111111"",""1001000"",""1001100"",""1001010"",""0110001"" );//R" & @CRLF $sPageSource &= "alphabet[18]=new Array( ""0110010"",""1001001"",""1001001"",""1001001"",""0100110"" ); alphabet[19]=new Array( ""1000000"",""1000000"",""1111111"",""1000000"",""1000000"" );//T" & @CRLF $sPageSource &= "alphabet[20]=new Array( ""1111110"",""0000001"",""0000001"",""0000001"",""1111110"" ); alphabet[21]=new Array( ""1110000"",""0001100"",""0000011"",""0001100"",""1110000"" );//V" & @CRLF $sPageSource &= "alphabet[22]=new Array( ""1111110"",""0000001"",""0000010"",""0001100"",""0000010"",""0000001"",""1111110"" ); alphabet[23]=new Array( ""1100011"",""0010100"",""0001000"",""0010100"",""1100011"" );//X" & @CRLF $sPageSource &= "alphabet[24]=new Array( ""1100000"",""0010000"",""0001111"",""0010000"",""1100000"" ); alphabet[25]=new Array( ""1000011"",""1000101"",""1001001"",""1010001"",""1100001"" );//Z" & @CRLF $sPageSource &= "alphabet[26]=new Array( ""0000000"",""0000000"",""0000000"",""0000000"" ); alphabet[27]=new Array( ""0000000"",""0000001"",""0000000"",""0000000"",""0000000"" );//PERIOD" & @CRLF $sPageSource &= "alphabet[28]=new Array( ""0000000"",""0000000"",""1111101"",""0000000"",""0000000"" );//!" & @CRLF $sPageSource &= "alphabet[29]=new Array( ""0100001"",""1111111"",""0000001"" ); alphabet[30]=new Array( ""0100011"",""1000101"",""1001001"",""1001001"",""0110001"" );//2" & @CRLF $sPageSource &= "alphabet[31]=new Array( ""0100010"",""1001001"",""1001001"",""1001001"",""0110110"" ); alphabet[32]=new Array( ""0001000"",""0011000"",""0101000"",""1111111"",""0001000"" );//4" & @CRLF $sPageSource &= "alphabet[33]=new Array( ""1111001"",""1001001"",""1001001"",""1001001"",""1000110"" ); alphabet[34]=new Array( ""0111110"",""1001001"",""1001001"",""1001001"",""0100110"" );//6" & @CRLF $sPageSource &= "alphabet[35]=new Array( ""1000011"",""1000100"",""1001000"",""1110000"" ); alphabet[36]=new Array( ""0110110"",""1001001"",""1001001"",""1001001"",""0110110"" );//8" & @CRLF $sPageSource &= "alphabet[37]=new Array( ""0110010"",""1001001"",""1001001"",""1001001"",""0111110"" ); alphabet[38]=new Array( ""0000001"",""0000010"",""0000000"" );//COMMA" & @CRLF $sPageSource &= "alphabet[39]=new Array( ""XXXXXXX"" );//PAUSE ( @ )" & @CRLF $sPageSource &= "alphabet[40]=new Array( ""YYYYYYY"" );//FLASH ( # )" & @CRLF $sPageSource &= "alphabet[41]=new Array( ""DDDDDDD"" );//SCROLL UP EFFECT ( ^ )" & @CRLF $sPageSource &= "alphabet[42]=new Array( ""SSSSSSS"" );//SUN EFFECT ( _ )" & @CRLF $sPageSource &= "alphabet[43]=new Array( ""0100000"",""1000000"",""1001101"",""1001000"",""0110000"" );//?" & @CRLF $sPageSource &= "alphabet[44]=new Array( ""QQQQQQQ"" );//SPLIT EFFECT ( $ )" & @CRLF $sPageSource &= "" & @CRLF $sPageSource &= "message=message.toUpperCase(); //make message uppercase" & @CRLF $sPageSource &= "var messageArray=new Array(); //make messageArray-an array of the letters in the message" & @CRLF $sPageSource &= "var columnCount=0; //variable to count columns in messageArray.length" & @CRLF $sPageSource &= "for ( i=0; i<message.length; i++ ){ //iterate through the characters in the message" & @CRLF $sPageSource &= " letterNum=message.charCodeAt( i ); //assign proper letter code ( alphabet array )" & @CRLF $sPageSource &= " if ( ( letterNum>=65 ) && ( letterNum<=90 ) ) temp=letterNum-65; //letters" & @CRLF $sPageSource &= " else if ( letterNum==46 ) temp=27; //." & @CRLF $sPageSource &= " else if ( letterNum==32 ) temp=26; //space" & @CRLF $sPageSource &= " else if ( letterNum==33 ) temp=28; //!" & @CRLF $sPageSource &= " else if ( ( letterNum>=49 ) && ( letterNum<=57 ) ) temp=letterNum-20; //[1-9]" & @CRLF $sPageSource &= " else if ( letterNum==48 ) temp=14; //zero" & @CRLF $sPageSource &= " else if ( letterNum==63 ) temp=43; //?" & @CRLF $sPageSource &= " else if ( letterNum==44 ) temp=38; //," & @CRLF $sPageSource &= " else if ( letterNum==64 ) temp=39; //pause" & @CRLF $sPageSource &= " else if ( letterNum==35 ) temp=40; //flash effect" & @CRLF $sPageSource &= " else if ( letterNum==94 ) temp=41; //scroll up effect" & @CRLF $sPageSource &= " else if ( letterNum==95 ) temp=42; //sunrise effect" & @CRLF $sPageSource &= " else if ( letterNum==36 ) temp=44; //split effect" & @CRLF $sPageSource &= " else continue;" & @CRLF $sPageSource &= " for ( ii=0; ii<alphabet[temp].length;ii++ ){ messageArray[columnCount]=alphabet[temp][ii];columnCount++;}" & @CRLF $sPageSource &= " if ( ( temp!=39 ) && ( temp!=40 ) && ( temp!=41 ) ) {messageArray[columnCount]=""0000000"";columnCount++;}" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "//make 'led screen' with block 0-49 on row 1, block 50-99 on row 2, block 100-149 on row 3, etc.." & @CRLF $sPageSource &= "var b='';" & @CRLF $sPageSource &= "for ( var i=0; i<350; i++ ){//columns 50 columns x 7 rows" & @CRLF $sPageSource &= " rowPos=0+3*( i>49 )+3*( i>99 )+3*( i>149 )+3*( i>199 )+3*( i>249 )+3*( i>299 );" & @CRLF $sPageSource &= " colPos=0+150*( i>49 )+150*( i>99 )+150*( i>149 )+150*( i>199 )+150*( i>249 )+150*( i>299 );" & @CRLF $sPageSource &= " b+= ( NS ) ? '<LAYER NAME=""block' + i + '"" LEFT=""' + ( startXPos+i*3-colPos ) + '"" TOP=""' + ( startYPos+rowPos ) + '"" VISIBILITY=""show"" WIDTH=""2"" HEIGHT=""2"" BGCOLOR=""' + LEDoffColor + '""></LAYER>' : '<div id=""block' + i + '"" style=""position:absolute; left:' + ( startXPos+i*3-colPos ) + 'px; top:' + ( startYPos+rowPos ) + 'px; background-color:' + LEDoffColor +'; height: 2px; width: 2px;font-size:2px;""></div>';" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "document.write( b );" & @CRLF $sPageSource &= "var columnCounter=0; //keep track of postion of messageArray" & @CRLF $sPageSource &= "var bb=new Array(); //store particular LED's dom element here" & @CRLF $sPageSource &= " if ( NS ) { for ( var i=0; i<350; i++ ) { bb[i]=getCSS( ""block""+i )}}" & @CRLF $sPageSource &= " else {for ( var i=0; i<350; i++ ){ bb[i]=getCSS( ""block""+i ).style;}}" & @CRLF $sPageSource &= "var isOn=new Array();for ( var i=0; i<350; i++ ){ isOn[i]=0;} //keep track on on/off status of particular LED" & @CRLF $sPageSource &= "onArray=new Array(); var onCount=0; //array size counter" & @CRLF $sPageSource &= "function scroll(){" & @CRLF $sPageSource &= " onCount=0;" & @CRLF $sPageSource &= " if ( NS ) { for ( var i=0; i<301; i+=50 ){ if ( isOn[i]==1 ) { bb[i].bgColor=LEDoffColor; isOn[i]=0;} for ( var ii=1; ii<50; ii+=7 ){" & @CRLF $sPageSource &= " temp=i+ii;temp1=temp+1;temp2=temp+2;temp3=temp+3;temp4=temp+4;temp5=temp+5;temp6=temp+6;" & @CRLF $sPageSource &= " if ( isOn[temp]==1 ) {bb[temp].bgColor=LEDoffColor; isOn[temp]=0; bb[temp-1].bgColor=LEDonColor; isOn[temp-1]=1;}" & @CRLF $sPageSource &= " if ( isOn[temp1]==1 ) {bb[temp1].bgColor=LEDoffColor; isOn[temp1]=0; bb[temp].bgColor=LEDonColor; isOn[temp]=1;}" & @CRLF $sPageSource &= " if ( isOn[temp2]==1 ) {bb[temp2].bgColor=LEDoffColor; isOn[temp2]=0; bb[temp+1].bgColor=LEDonColor; isOn[temp+1]=1;}" & @CRLF $sPageSource &= " if ( isOn[temp3]==1 ) {bb[temp3].bgColor=LEDoffColor; isOn[temp3]=0; bb[temp2].bgColor=LEDonColor; isOn[temp2]=1;}" & @CRLF $sPageSource &= " if ( isOn[temp4]==1 ) {bb[temp4].bgColor=LEDoffColor; isOn[temp4]=0; bb[temp3].bgColor=LEDonColor; isOn[temp3]=1;}" & @CRLF $sPageSource &= " if ( isOn[temp5]==1 ) {bb[temp5].bgColor=LEDoffColor; isOn[temp5]=0; bb[temp4].bgColor=LEDonColor; isOn[temp4]=1;}" & @CRLF $sPageSource &= " if ( isOn[temp6]==1 ) {bb[temp6].bgColor=LEDoffColor; isOn[temp6]=0; bb[temp5].bgColor=LEDonColor; isOn[temp5]=1;}" & @CRLF $sPageSource &= " }}}" & @CRLF $sPageSource &= " else { for ( var i=0; i<301; i+=50 ){ if ( isOn[i]==1 ) { bb[i].backgroundColor=LEDoffColor; isOn[i]=0;} for ( var ii=1; ii<50; ii+=7 ){" & @CRLF $sPageSource &= " temp=i+ii;temp1=temp+1;temp2=temp+2;temp3=temp+3;temp4=temp+4;temp5=temp+5;temp6=temp+6;" & @CRLF $sPageSource &= " if ( isOn[temp]==1 ) {bb[temp].backgroundColor=LEDoffColor; isOn[temp]=0; bb[temp-1].backgroundColor=LEDonColor; isOn[temp-1]=1;}" & @CRLF $sPageSource &= " if ( isOn[temp1]==1 ) {bb[temp1].backgroundColor=LEDoffColor; isOn[temp1]=0; bb[temp].backgroundColor=LEDonColor; isOn[temp]=1;}" & @CRLF $sPageSource &= " if ( isOn[temp2]==1 ) {bb[temp2].backgroundColor=LEDoffColor; isOn[temp2]=0; bb[temp+1].backgroundColor=LEDonColor; isOn[temp+1]=1;}" & @CRLF $sPageSource &= " if ( isOn[temp3]==1 ) {bb[temp3].backgroundColor=LEDoffColor; isOn[temp3]=0; bb[temp2].backgroundColor=LEDonColor; isOn[temp2]=1;}" & @CRLF $sPageSource &= " if ( isOn[temp4]==1 ) {bb[temp4].backgroundColor=LEDoffColor; isOn[temp4]=0; bb[temp3].backgroundColor=LEDonColor; isOn[temp3]=1;}" & @CRLF $sPageSource &= " if ( isOn[temp5]==1 ) {bb[temp5].backgroundColor=LEDoffColor; isOn[temp5]=0; bb[temp4].backgroundColor=LEDonColor; isOn[temp4]=1;}" & @CRLF $sPageSource &= " if ( isOn[temp6]==1 ) {bb[temp6].backgroundColor=LEDoffColor; isOn[temp6]=0; bb[temp5].backgroundColor=LEDonColor; isOn[temp5]=1;}" & @CRLF $sPageSource &= " }}}" & @CRLF $sPageSource &= " temp=messageArray[columnCounter]; flag=temp.charAt( 0 );//GET NEW COLUMN" & @CRLF $sPageSource &= " if ( temp.charAt( 1 )==""1"" ) {isOn[99]=1;} if ( temp.charAt( 2 )==""1"" ) {isOn[149]=1} if ( temp.charAt( 3 )==""1"" ) {isOn[199]=1}" & @CRLF $sPageSource &= " if ( temp.charAt( 4 )==""1"" ) {isOn[249]=1} if ( temp.charAt( 5 )==""1"" ) {isOn[299]=1} if ( temp.charAt( 6 )==""1"" ) {isOn[349]=1}" & @CRLF $sPageSource &= " if ( flag==""0"" ) {} else if ( flag==""1"" ) {isOn[49]=1;} else if ( flag==""X"" ) {pauseScroll();} else if ( flag==""Y"" ) {flashScroll();}" & @CRLF $sPageSource &= " else if ( flag==""D"" ) {dropEffect();} else if ( flag==""S"" ) {sunRiseEffect();} else if ( flag==""Q"" ) {splitEffect();}" & @CRLF $sPageSource &= " columnCounter++; if( columnCounter==columnCount ) columnCounter=0;" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "//______________pause effect________________" & @CRLF $sPageSource &= "function pauseScroll(){ clearInterval( loop ); setTimeout( ""LEDinit()"",3000 );}" & @CRLF $sPageSource &= "//______________onArray Section_____________" & @CRLF $sPageSource &= "onArray=new Array(); var onCount=0; //array size counter" & @CRLF $sPageSource &= "function makeOnArray(){ clearInterval( loop ); onCount=0; for ( var i=0; i<700; i++ ){if ( isOn[i]==1 ) {onArray[onCount]=i; onCount++;};}//make onArray of 'on' LEDS" & @CRLF $sPageSource &= "}//_________________________________" & @CRLF $sPageSource &= "//_______________flash effect_______________" & @CRLF $sPageSource &= "var flashCount=0;" & @CRLF $sPageSource &= "function flashScroll(){ makeOnArray(); flashCount=0; if ( NS ) {setTimeout( ""flashItNS()"",250 );} else {setTimeout( ""flashIt()"",250 );}}" & @CRLF $sPageSource &= "function flashItNS(){ flashCount++;" & @CRLF $sPageSource &= " if ( flashCount<14 ) {" & @CRLF $sPageSource &= " if ( flashCount % 2 == 0 ){ for ( var i=0; i<onCount; i++ ){ isOn[onArray[i]]=0;bb[onArray[i]].bgColor=LEDoffColor;}}" & @CRLF $sPageSource &= " else {for ( var i=0; i<onCount; i++ ){isOn[onArray[i]]=1;bb[onArray[i]].bgColor=LEDonColor;}}" & @CRLF $sPageSource &= " setTimeout( ""flashItNS()"",250 );" & @CRLF $sPageSource &= " }" & @CRLF $sPageSource &= " else {flashCount=0; setTimeout( ""LEDinit()"",250 );}" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "function flashIt(){ flashCount++;" & @CRLF $sPageSource &= " if ( flashCount<14 ) {" & @CRLF $sPageSource &= " if ( flashCount % 2 == 0 ){ for ( var i=0; i<onCount; i++ ){ isOn[onArray[i]]=0;bb[onArray[i]].backgroundColor=LEDoffColor;}}" & @CRLF $sPageSource &= " else {for ( var i=0; i<onCount; i++ ){isOn[onArray[i]]=1;bb[onArray[i]].backgroundColor=LEDonColor;}}" & @CRLF $sPageSource &= " setTimeout( ""flashIt()"",250 );" & @CRLF $sPageSource &= " }" & @CRLF $sPageSource &= " else {flashCount=0; setTimeout( ""LEDinit()"",250 );}" & @CRLF $sPageSource &= "}//_________________________________" & @CRLF $sPageSource &= "//____________scroll up effect______________" & @CRLF $sPageSource &= "dropArray=new Array();" & @CRLF $sPageSource &= "function dropEffect(){makeOnArray(); for ( var i=0; i<onCount; i++ ){ dropArray[i]=onArray[i]; } if ( NS ) {dropItNS();} else {dropIt();}}" & @CRLF $sPageSource &= "var dropCount=0;" & @CRLF $sPageSource &= "function dropItNS(){" & @CRLF $sPageSource &= " if ( dropCount<7 ){for ( var i=0; i<onCount; i++ ){ bb[dropArray[i]].bgColor=LEDoffColor; }" & @CRLF $sPageSource &= " for ( var i=0; i<onCount; i++ ){ temp=dropArray[i]; temp-=50;if ( temp<0 ) temp+=350;bb[temp].bgColor=LEDonColor; dropArray[i]=temp;}" & @CRLF $sPageSource &= " dropCount++; setTimeout( ""dropItNS()"",100 );" & @CRLF $sPageSource &= " } else {dropCount=0;setTimeout( ""LEDinit()"",100 );}" & @CRLF $sPageSource &= "}//_________________________________" & @CRLF $sPageSource &= "function dropIt(){" & @CRLF $sPageSource &= " if ( dropCount<7 ){ for ( var i=0; i<onCount; i++ ){ bb[dropArray[i]].backgroundColor=LEDoffColor; }" & @CRLF $sPageSource &= " for ( var i=0; i<onCount; i++ ){ temp=dropArray[i]; temp-=50; if ( temp<0 ) temp+=350; bb[temp].backgroundColor=LEDonColor; dropArray[i]=temp;}" & @CRLF $sPageSource &= " dropCount++; setTimeout( ""dropIt()"",100 );" & @CRLF $sPageSource &= " } else {dropCount=0;setTimeout( ""LEDinit()"",100 );}" & @CRLF $sPageSource &= "}//_________________________________" & @CRLF $sPageSource &= "//____________sunrise effect________________" & @CRLF $sPageSource &= "sunRiseCounter=0;sunRiseArray=new Array();" & @CRLF $sPageSource &= "sunRiseArray[0]=new Array( 50,101,102,103,154,155,156,207,208,259,260,261,212,163,164,115,116,117,168,169,170,221,222,223,274,275,276,227,228,179,180,131,132,83,134,135,186,187,238,239,240,241,292,293,344,295,296,247,198 );//Hills" & @CRLF $sPageSource &= "sunRiseArray[1]=new Array( 224,225,226 ); sunRiseArray[2]=new Array( 174,175,176,177 ); sunRiseArray[3]=new Array( 173,124,125,126,127,128,178 ); sunRiseArray[4]=new Array( 172,123,74,75,76,77,129 ); sunRiseArray[5]=new Array( 171,122,73,24,25,26,27,78,79,130 );" & @CRLF $sPageSource &= "function sunRiseEffect() { makeOnArray(); for ( var i=0; i<onCount; i++ ){ isOn[onArray[i]]=0; if ( !NS ) {bb[onArray[i]].backgroundColor=LEDoffColor;} else {bb[onArray[i]].bgColor=LEDoffColor;}}" & @CRLF $sPageSource &= " setTimeout( ""riseEffectUp()"",1000 );}" & @CRLF $sPageSource &= "function riseEffectUp() {" & @CRLF $sPageSource &= " if ( !NS ) { for ( var ii=0; ii<sunRiseArray[sunRiseCounter].length; ii++ ) {isOn[sunRiseArray[sunRiseCounter][ii]]=1;bb[sunRiseArray[sunRiseCounter][ii]].backgroundColor=LEDonColor;}}" & @CRLF $sPageSource &= " else {for ( var ii=0; ii<sunRiseArray[sunRiseCounter].length; ii++ ) {isOn[sunRiseArray[sunRiseCounter][ii]]=1;bb[sunRiseArray[sunRiseCounter][ii]].bgColor=LEDonColor;}}" & @CRLF $sPageSource &= " sunRiseCounter++; if ( sunRiseCounter>5 ) {sunRiseCounter=5;setTimeout( ""riseEffectDown()"",2000 );} else {setTimeout( ""riseEffectUp()"",250 );}}" & @CRLF $sPageSource &= "function riseEffectDown() {" & @CRLF $sPageSource &= " if ( !NS ) {for ( var ii=0; ii<sunRiseArray[sunRiseCounter].length; ii++ ) {isOn[sunRiseArray[sunRiseCounter][ii]]=0;bb[sunRiseArray[sunRiseCounter][ii]].backgroundColor=LEDoffColor;}}" & @CRLF $sPageSource &= " else {for ( var ii=0; ii<sunRiseArray[sunRiseCounter].length; ii++ ) {isOn[sunRiseArray[sunRiseCounter][ii]]=0;bb[sunRiseArray[sunRiseCounter][ii]].bgColor=LEDoffColor;}}" & @CRLF $sPageSource &= " sunRiseCounter--; if ( sunRiseCounter<1 ) {sunRiseCounter=0;setTimeout( ""LEDinit()"",1500 );}" & @CRLF $sPageSource &= " else {setTimeout( ""riseEffectDown()"",250 );}" & @CRLF $sPageSource &= "}//____________________________________" & @CRLF $sPageSource &= "//____________split scroll effect___________" & @CRLF $sPageSource &= "var splitCount=0;" & @CRLF $sPageSource &= "function splitEffect() { makeOnArray(); for ( var i=0; i<onCount; i++ ) { dropArray[i]=onArray[i]; }" & @CRLF $sPageSource &= " if ( NS ) {setTimeout( ""splitNS()"",55 );} else if ( IE ) {setTimeout( ""splitIt()"",55 );} else {setTimeout( ""splitIt()"",100 );}" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "function splitIt(){ for ( i=0;i<onCount;i++ ){ temp=dropArray[i];" & @CRLF $sPageSource &= " if ( temp<150 ) { if ( temp==100 ) {bb[temp].backgroundColor=LEDoffColor; temp=149; bb[temp-1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else if ( temp==50 ) {bb[temp].backgroundColor=LEDoffColor; temp=99; bb[temp-1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else if ( temp==0 ) {bb[temp].backgroundColor=LEDoffColor; temp=49; bb[temp-1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else {bb[temp].backgroundColor=LEDoffColor; bb[temp-1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " dropArray[i]=temp-1; }" & @CRLF $sPageSource &= " else { if ( temp==199 ) {bb[temp].backgroundColor=LEDoffColor; temp=200; bb[temp+1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else if ( temp==349 ) {bb[temp].backgroundColor=LEDoffColor; temp=300; bb[temp+1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else if ( temp==299 ) {bb[temp].backgroundColor=LEDoffColor; temp=250; bb[temp+1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else if ( temp==249 ) {bb[temp].backgroundColor=LEDoffColor; temp=200; bb[temp+1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " else {bb[temp].backgroundColor=LEDoffColor; bb[temp+1].backgroundColor=LEDonColor;}" & @CRLF $sPageSource &= " dropArray[i]=temp+1; }" & @CRLF $sPageSource &= " } splitCount++; if ( splitCount<49 ) {if ( IE ) {setTimeout( ""splitIt()"",55 );} else {setTimeout( ""splitIt()"",100 );} } else {splitCount=0; LEDinit();}" & @CRLF $sPageSource &= "}" & @CRLF $sPageSource &= "function splitNS(){" & @CRLF $sPageSource &= " for ( i=0;i<onCount;i++ ){ temp=dropArray[i];" & @CRLF $sPageSource &= " if ( temp<150 ) { if ( temp==100 ) {bb[temp].bgColor=LEDoffColor; temp=149; bb[temp-1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else if ( temp==50 ) {bb[temp].bgColor=LEDoffColor; temp=99; bb[temp-1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else if ( temp==0 ) {bb[temp].bgColor=LEDoffColor; temp=49; bb[temp-1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else {bb[temp].bgColor=LEDoffColor; bb[temp-1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " dropArray[i]=temp-1; }" & @CRLF $sPageSource &= " else { if ( temp==199 ) {bb[temp].bgColor=LEDoffColor; temp=200; bb[temp+1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else if ( temp==349 ) {bb[temp].bgColor=LEDoffColor; temp=300; bb[temp+1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else if ( temp==299 ) {bb[temp].bgColor=LEDoffColor; temp=250; bb[temp+1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else if ( temp==249 ) {bb[temp].bgColor=LEDoffColor; temp=200; bb[temp+1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " else {bb[temp].bgColor=LEDoffColor; bb[temp+1].bgColor=LEDonColor;}" & @CRLF $sPageSource &= " dropArray[i]=temp+1; }" & @CRLF $sPageSource &= " } splitCount++; if ( splitCount<49 ) {setTimeout( ""splitNS()"",55 );} else {splitCount=0; LEDinit();}" & @CRLF $sPageSource &= "}//___________________________________" & @CRLF $sPageSource &= "function LEDinit(){if ( NS ) {loop=setInterval( ""scroll()"",55 );} else if ( IE ){loop=setInterval( ""scroll()"",55 );} else {loop=setInterval( ""scroll()"",100 );}}" & @CRLF $sPageSource &= "</SCRIPT>" & @CRLF $sPageSource &= "</BODY></HTML>" & @CRLF Return $sPageSource EndFunc The code is translated to AutoIt from the C++ code in ICoreWebView2.ExecuteScript() and from this example by Chimp. Compared to the original script by Chimp the ICoreWebView2ExecuteScriptCompletedHandler callback interface is added to the code. WebView2-4.au3 is included in the 7z-file at bottom of this post. If the code here is to be a replacement for IE.au3, then I think we'll have to translate all C/C++ code in WebView2.h to AutoIt code in WV2Interfaces.au3. I'll create a new post to document the implementation of callback interfaces.1 point
-
Select Items from a TVirtualStringTree Control in delphi application
FrancescoDiMuro reacted to junkew for a topic
Try the tools as mentioned in wiki faq 31 which you already partly are trying with uiaspy Commercial tools like ranorex and testcomplete are doing this to get some kind of reflection dll injected to get information of these controls.Commercial tools like ranorex and testcomplete are doing this to get some kind of reflection dll injected to get information of these controls. Handy people can probably fix this with sendmessage and some info from https://github.com/Fr0sT-Brutal/Delphi_MiniRTL/blob/master/CommCtrl.pas I think for dellphi controls you can only reach them with code injecting a dll and thats probably tough from AutoIt. Libraries like easyhook, mhook, .... I never understood why those delphi Txxxcontrols do not behave normally with sendmessge api Some references for try just to get item count with sendmessage and from there onwards get the messages to retrieve text. (In general then I advice to start using the commercial tooling as thats the reason these tools exist) {$EXTERNALSYM LVM_FIRST} LVM_FIRST = $1000; { ListView messages } const {$EXTERNALSYM LVM_GETITEMCOUNT} LVM_GETITEMCOUNT = LVM_FIRST + 4; IntPtr count = API.SendMessage(child1, API.LVM_GETITEMCOUNT, 0, 0); PageCount := sendmessage( listview1.handle, LVM_GETCOUNTPERPAGE, 0, 0); Microsoft base: https://social.msdn.microsoft.com/Forums/vstudio/en-US/4a335b85-7a85-4bf9-9079-8f9f1dc45dd0/select-listviewitem-in-a-listview-by-api?forum=windowsuidevelopment Some thoughts references added if maybe someone understands better and maybe we should get some small delphi executable with just a form, textbox, checkbox to experiment with. 0. message explanation delphi https://doc.lagout.org/programmation/Delphi/Delphi/Delphi - Messages (chapter).pdf 1. Delphi seems just as any other windows app based on the message loop so reachable with sendmessage/postmessage https://delphidabbler.github.io/delphi-tips/tips/105.html 2. From delphi to other apps just sendmessage https://stackoverflow.com/questions/6115296/delphi-how-to-send-command-to-other-application 3. Interesting if you prevent apps from processing messages https://stackoverflow.com/questions/1251678/how-to-prevent-processmessages-in-delphi1 point -
well, I got it. Thanks for the illuminating explanation! So WV2Interfaces.au3 is still under construction. If I were able I could collaborate in compiling those parameters, but I'm afraid I would do more harm than good ... I think this ExecuteScript function is very useful. I'm sorry, I hope I'm not too boring, but I would be interested in understanding how to set up for this function also the part related to receiving the result of the script that has been executed, that is; ExecuteScript(LPCWSTR javaScript, ICoreWebView2ExecuteScriptCompletedHandler *handler), so to be able to use the related callback function in our script. Thanks so much again for any help P.S. In my previous post I've embedded in the script a quite long Html listing. Well, if someone is interested, I've used an easy and quick way to generate that ready to be pasted in the AutoIt script 1) Find the the HTML/Javascript listing that you want to embedd in your AutoIt listing and copy it to the clipboard. (that is select it and hit ctrl-c) 2) run this little snippet, It reads the listing that is in the clipboard, prepare it for the pasting and, after the tranformation, puts it again in the clipboard. Local $sFuntionName = "_GetSource" Local $sVarName = "$sSource" Local $aStr = StringSplit(ClipGet(), @CRLF, 1) ; get the clipboard content Local $sListing = "Func " & $sFuntionName & "()" & @CRLF $sListing &= 'Local ' & $sVarName & ' = ""' & @CRLF For $i = 1 To $aStr[0] $sListing &= $sVarName & ' &= "' & StringReplace($aStr[$i], '"', '""') & '" & @CRLF' & @CRLF Next $sListing &= "Return " & $sVarName & @CRLF $sListing &= "EndFunc" ClipPut($sListing) ; ConsoleWrite($sListing) 3) paste the clipboard in your listing (hit ctrl-v) have fun1 point
-
A more readable _TimeConvert function : Func _TimeConvert($iSeconds) Local Const $aDiv = [24, 60, 60] Local $aTimeSplit[4] For $i = UBound($aDiv) - 1 To 0 Step -1 $aTimeSplit[$i + 1] = Mod($iSeconds, $aDiv[$i]) $iSeconds = Floor($iSeconds / $aDiv[$i]) Next $aTimeSplit[0] = $iSeconds Return $aTimeSplit EndFunc ;==>_TimeConvert You can always make a better wheel1 point
-
Graeme, There is a bug deep in AutoIt (which is not going to be fixed) which means that colouring buttons is fraught with danger - for example they usually trap the {ENTER} key and act as a default button even when not intended - and also that they do not play nicely with various other styles. A quick search shows others having the same problem as you - and no solutions. So i would suggest giving up on the colouring - I use underlying labels to indicate colour changes. M231 point
-
Here one easy way you could do it : #include <GUIConstantsEx.au3> #include <InetConstants.au3> #include <StaticConstants.au3> #include <SendMessage.au3> #include <GDIPlus.au3> InetGet ("https://fleet.siemens-healthineers.com/static/images/02_11060815_NL.jpg", "Test.jpg", $INET_FORCERELOAD) _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile("Test.jpg") $hImageRez = _GDIPlus_ImageResize($hImage, 100, 80) _GDIPlus_ImageDispose($hImage) $hGUI = GUICreate("Test") $idPic = GUICtrlCreatePic("", 10, 10, 100, 80) $hBitMap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImageRez) _GDIPlus_ImageDispose($hImageRez) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($idPic), $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap)) _WinAPI_DeleteObject($hBitmap) _GDIPlus_Shutdown() FileDelete("Test.jpg") GUISetState() While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd1 point
-
My comments meant that I am no able to see the same problem yet, so I understood what you said but were not able to get into the same situation yet. So you say we have a LUA process making SciTE hang? Could be but I need first to get the issue before I can debug it. What characters are you typing to cause this hang?1 point
-
1 point
-
It works, but to see the results the window should be maximized so $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESIZED, $GUI_EVENT_RESTORE should be maintained While 1 Switch GUIGetMsg() Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESIZED, $GUI_EVENT_RESTORE Local $tRect = _WinAPI_GetClientRect($hGui) $oCoreWebView2Controller.put_Bounds($tRect) Case $Button1 $oCoreWebView2.ExecuteScript("alert('Hello');", NULL) Sleep(3000) $oCoreWebView2.NavigateToString(_GetPage()) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd1 point
-
Windows 10 and ProcessSetPriority
argumentum reacted to photonblaster for a topic
Thanks!!!!!!!! TheXman: Works for me too. argumentum, thanks for your comments. I am running speed tests to see if I need to go to real time, maybe "high" is good enough. Right now I get ~30% reduction in execution time using real time. I am trying different, dare I say more elegant, ways to speed it up of course since the priority is a hammer, but I need the absolute fastest analysis so I will always be using at least high priority. I have 8 core, 5GHZ CPU, and only two cores go to 85% utilization right now so real time does not seem to be a problem (yet, or that I see). I am working with Excel 2019 which is supposed to be optimized for multi-threading, but my data analysis is very linear, not much parallel processing algorithms available. I am guessing IPC is inter process communications? Can you steer me in the right direction to look into this? Isn't things like Autoit Excel functions to read, manipulate data inside AutoIT, write back answers basically IPC? MS says using the clipboard is one way to implement IPC, but this I think is usually very slow. Interprocess Communications - Win32 apps | Microsoft Docs I expect I will be posting later to get some pointers re speeding things up after I have pushed myself to the limit of my own devices.1 point -
Get excel workbook and sheet name
AnonymousX reacted to Nine for a topic
run those 4 lines please with the maximized books/instances only : Local $aWinList = WinList("[CLASS:XLMAIN]") Local $oXL = _Excel_BookAttach ($aWinList[1][0],"Title") Local $Name = $oXL.ActiveSheet.Name MsgBox (0,"",$Name)1 point -
How to loop through all sheets in a workbook
AnonymousX reacted to MikahS for a topic
Have a look at _Excel_SheetList1 point -
help with bitAND, bitOR
Professor_Bernd reacted to JakeJohnson74 for a topic
This is a good question, but a hard response! I think of it as a light switch. Binary is either a 0 or 1 (aka Base 2) where as our numbering system is Base 10 or 0-9 Example in base 10: We have the 1's place, 10's place, 100's place ect. (base 10 increments by ten each place you move) 1362 means <- we have 2 1's, 60 10's, 3 100's and 1 1000. Add it all up and you get 1362. Example in base 2: We have 1's place, 2's place, 4's place, 8's place, 16's place ect. (each place increments by 2) 101 0101 0010 means <- we have: 0 1's 1 2's 0 4's 0 8's 1 16's 0 32's 1 64's 0 128's 1 256's 0 512's 1 1024's So add up each of the places that had a 1 (2+16+64+256+1024 = 1362) In a nutshell that's binary vs decimal Binary is used for many things related to computers because it is, in it's simplest form a logical 2 choice state (on off, 0 1, true false etc.) Think of a light switch - you could use binary to control it because a 1 can mean "on" and a 0 can mean "off" Decimal numbers can not do this In terms of programming as others have said it is used to decipher which flags you have set and it is done very specific to the particular to the item you are referring to. Normally you are looking at something like: https://msdn.microsoft.com/en-us/library/windows/desktop/ms632612(v=vs.85).aspx There is a flags param with a type UINT (unsigned int) If you convert each of those Hex values to Binary you'll see that each one is unique 0000 0000 0000 0001 0000 0000 0000 0010 0000 0000 0000 0100 0000 0000 0000 1000 0000 0000 0001 0000 0000 0000 0010 0000 0000 0000 0100 0000 0000 0000 1000 0000 etc etc There is only ever a one bit enabled that designates each flag. So the Bitand does multiplication on the bits it is comparing and BitOR does a logical "or" meaning, if there is a 1 in either position the answer is 1, otherwise its a 0. Example bitAnd: Value we are looking at: 0000 1010 1110 0001 BitAnd Value: 1111 1111 0000 0001 *___________________ Multiply it together. 0000 1010 0000 0001 This is basically used to "mask" the original value only allowing certain flags to get through. So lets say a huge set of flags are coming through and you REALLY only care about 2 of them, you could mask all the rest and watch just the 2 bits you cared about, convert that to decimal and test for that number in your code. Example bitOR: value we are looking at: 0000 0000 0000 0000 BitOR Value: 0000 0000 1110 0011 ____________________ Or them all together 0000 0000 1110 0011 Looking at something like a control this would turn "on" certain aspects of it where there was a 1. Obviously this is hard to decipher, so the term "constants" come into play. They assign binary values to constants so us humans can more easily read what flags we are setting. Something like: GUICtrlCreateTreeView(0, 25, 175, 678, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_SHOWSELALWAYS),$WS_EX_CLIENTEDGE) would look a little hard to read if it just said: GUICtrlCreateTreeView(0, 25, 175, 678, 10110110101,1) <- fake flags set, but you get the idea of Constants vs. just using a Bin or Hex value here. Either way it will work fyi as long as it is getting binary or hex (whatever the item is calling for in that parameter) typically its a hex number, that the system then converts to binary internally. Long winded haha but maybe it will help?1 point -
help with bitAND, bitOR
Professor_Bernd reacted to SadBunny for a topic
Hard to explain this without lots of binary numbers. If you are fluent in number systems, this whole bitwise operation thing kind of makes intuitive sense, so if it doesn't it probably means that you don't want to worry about number systems. Let me try to explain it without talking about bits, binary numbers or number system conversions at all and just stick to the decimal system we all know and love, and elementary school math (all we'll need is addition and exponentiation). Just for checking flags like this, you can go with BitAnd. (You can do a lot with BitOr, BitNot, BitXor and all other bitwise operations, but that is outside the scope of this trick that enables you to toggle an arbitrary number of flags using only one piece of data.) Ok. So why do we like binary and bitwise calculation for this way of specifying flags? Because to create ANY (positive) number, even floats (but let's stick to integers), all we have to do is turn a certain combination of powers of 2 "off" or "on" (that's our bit). In other words: ANY number has a unique set of distinct powers of 2 that you can add to get that number. Distinct meaning that you will never need the same power twice. ; Say we want to express 5 as a combination of powers of 2: ; 2^2 (=4) + 2^0 (=1) ; ; (remember: x^0 is always 1, for any x!) So how to use this as a way to specify flags? Well, we assign every flag a unique power of 2: $FLAG1 = 2 ^ 0 ; dec 1, bin 1 $FLAG2 = 2 ^ 1 ; dec 2, bin 10 $FLAG3 = 2 ^ 2 ; dec 4, bin 100 $FLAG4 = 2 ^ 3 ; dec 8, bin 1000 ... and when we get a number, say $iFlag = $FLAG2 + $FLAG4 = 2 + 8 = 10, all we need to know is which combination of powers of 2 we need to make that number 10. Remember, we named the powers of 2, so when we know which powers of 2 we need, we know which names were "on" and which were "off". How to figure this out? Well, with BitAnd: $FLAG1 = 2 ^ 0 ; dec 1, bin 1 $FLAG2 = 2 ^ 1 ; dec 2, bin 10 $FLAG3 = 2 ^ 2 ; dec 4, bin 100 $FLAG4 = 2 ^ 3 ; dec 8, bin 1000 checkFlags($FLAG2 + $FLAG4) Func checkFlags($iFlags) For $i = 0 To 3 ; check which of the first four powers of 2 we need to make $iFlags ConsoleWrite("Do we need 2^" & $i & " (" & 2 ^ $i & ") to make " & $iFlags & "? ") If BitAND($iFlags, 2^$i) Then ConsoleWrite("YEP! That means that FLAG " & $i & " was turned on." & @CRLF) Else ConsoleWrite("NOPE! That means that FLAG " & $i & " was turned off." & @CRLF) EndIf Next EndFunc ;==>checkFlags Result: Do we need 2^0 (1) to make 10? NOPE! That means that FLAG 0 was turned off. Do we need 2^1 (2) to make 10? YEP! That means that FLAG 1 was turned on. Do we need 2^2 (4) to make 10? NOPE! That means that FLAG 2 was turned off. Do we need 2^3 (8) to make 10? YEP! That means that FLAG 3 was turned on. I am cutting a few mathematical corners here, but hopefully this makes sense without having to break your head over the binary system. http://en.wikipedia.org/wiki/Bitwise_operation explains it much more in-depth, but perhaps less intuitively, because it assumes some knowledge on converting between number systems. It is very concise though. Hope I made it easier instead of harder Good luck. /edit: Why is the result of these BitAnd (and related) functions a number and not a boolean truth value? That's because it's a mathematical operation that is done on two numbers, just like *, +, -, /, ^... And just like those operations it results in a new number. For this, we will need to think about bits and binary, because the catch is that you will need to convert both numbers to binary (base-2) before you can see what the operators do exactly. They work on the digits of the numbers represented in binary. Because those digits can only be 0 and 1, they can be used in these logical operations. The aforementioned wiki explains exactly how that works.1 point -
DotNET Compiler Wrapper If you want to run DotNet code as a script, and don't want to install full stack Visual Studio. You can find the DotNet wrapper for VB.NET. But easily can be modified to run C# etc. #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include "BinaryImage.au3" #include <Constants.au3> Global Const $Width = 600 Global Const $Height = 400 Global $sPath, $sCheck Global $color1 = 0x0000000 Global $color2 = 0x0005FFF Global $graphics, $backbuffer, $bitmap, $pen, $i Global $hLabel1, $hLabel2, $hLabel3, $hPic1, $hPic2, $hPic3 Global $LOGO1 = _LOGOBin1() Global $LOGO2 = _LOGOBin2() Global $LOGO3 = _LOGOBin3() Dim $hFile Dim $Font = "Arial" ;GUIRegisterMsg(0xF, "MY_PAINT"); Register PAINT-Event GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND"); Register PAINT-Event _GDIPlus_Startup() $hGui = GUICreate("DotNET Scripting", $Width, $Height, -1,-1) ;GUISetState(@SW_LOCK,$hGui) $hLabel1 = GUICtrlCreateLabel("Visual Studio - Light", 10, 20, 450, 20, $SS_NOTIFY) GUICtrlSetFont(-1, 8.5, 650, "", $font) GUICtrlSetBkColor(-1, 0xFFFFFF) $hPic1 = GUICtrlCreatePic("", 30,60,32,32) _SetImageBinaryToCtrl($hPic1,$LOGO1) $hLabel1 = GUICtrlCreateLabel(" Windows Application", 20, 100, 70, 40, $SS_NOTIFY) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetState(-1, $GUI_FOCUS) $hPic2 = GUICtrlCreatePic("", 130,60,32,32) _SetImageBinaryToCtrl($hPic2,$LOGO2) $hLabel2 = GUICtrlCreateLabel("Class Library", 120, 100, 70, 40, $SS_NOTIFY) GUICtrlSetBkColor(-1, 0xFFFFFF) $hPic3 = GUICtrlCreatePic("", 230,60,32,32) _SetImageBinaryToCtrl($hPic3,$LOGO3) $hLabel3 = GUICtrlCreateLabel(" Console Application", 220, 100, 70, 40, $SS_NOTIFY) GUICtrlSetBkColor(-1, 0xFFFFFF) _CreateGradient($hGui) GUISetState(@SW_SHOW) ; Check availability If $sCheck = "" Then $sCheck = CheckDotNetVersion() ConsoleWrite($sCheck & @CRLF) EndIf While 1 Switch GUIGetMsg() Case $hPic1, $hLabel1 $sScript = FileOpenDialog("Open DotNET Script", @ScriptDir & "", "PS Scripts (*.vb)") If @error Then MsgBox(4096,"","No File(s) chosen") Else Read_DotNET_Script($sScript) Execute_Script("Win", $sPath, $sScript) EndIf Case $hPic2, $hLabel2 $sScript = FileOpenDialog("Open DotNET Script", @ScriptDir & "", "PS Scripts (*.vb)") If @error Then MsgBox(4096,"","No File(s) chosen") Else Read_DotNET_Script($sScript) Execute_Script("Lib", $sPath, $sScript) EndIf Case $hPic3, $hLabel3 $sScript = FileOpenDialog("Open DotNET Script", @ScriptDir & "", "PS Scripts (*.vb)") If @error Then MsgBox(4096,"","No File(s) chosen") Else Read_DotNET_Script($sScript) Execute_Script("Cnsl", $sPath, $sScript) EndIf Case $GUI_EVENT_CLOSE Close() Exit EndSwitch WEnd ; Read the Code Script to be executed Func Read_DotNET_Script($hPSFile) $file = FileOpen($hPSFile, 0) ; Open read only If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Return EndIf Local $sCmd While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $sCmd &= $line & @CRLF Wend ConsoleWrite("Line read: " & @CRLF & $sCmd & @CRLF) FileClose($file) EndFunc ;=> Read_DotNET_Script ; Run the Script Func Execute_Script($sType, $sDotNETCmd, $svbScript) Switch $sType #Region Windows Application Case "Win" $hFile = StringMid($svbScript,1, StringLen($svbScript)-2) & "exe" MsgBox(0,"",$hFile) If FileExists($hFile) Then FileDelete($hFile) EndIf $hOut = Run($sDotNETCmd & " /nowarn /nologo /quiet /debug- /t:winexe " & FileGetShortName($svbScript), "", @SW_HIDE, $STDOUT_CHILD) ;#cs While 1 $line = StdoutRead($hOut) If @error = 2 Then ExitLoop If $line <> "" Then MsgBox(16, "Error", $line) EndIf Wend ;#ce Sleep(500) RunWait($hFile, "" , @SW_SHOW) #Region Class Library Case "Lib" $hFile = StringMid($svbScript,1, StringLen($svbScript)-2) & "dll" If FileExists($hFile) Then FileDelete($hFile) EndIf $hOut = Run($sDotNETCmd & " /nowarn /nologo /quiet /debug- /t:library " & FileGetShortName($svbScript), "", @SW_HIDE) Sleep(500) MsgBox(0,"Library .dll Created successfully ! ",$hFile) #Region Console Application Case "Cnsl" $hFile = StringMid($svbScript,1, StringLen($svbScript)-2) & "exe" If FileExists($hFile) Then FileDelete($hFile) EndIf $hOut = Run($sDotNETCmd & " /nowarn /nologo /quiet /debug- /t:exe " & FileGetShortName($svbScript), "", @SW_HIDE, $STDOUT_CHILD) ;#cs While 1 $line = StdoutRead($hOut) If @error = 2 Then ExitLoop If $line <> "" Then MsgBox(16, "Error", $line) EndIf Wend ;#ce Sleep(500) RunWait(@ComSpec & " /K cd " & @ScriptDir & " & " & FileGetShortName($hFile), "", @SW_SHOW) EndSwitch Return $hFile EndFunc ;=> Execute_Script ; Check the DotNET version available Func CheckDotNetVersion() Local $sFramework If @OSArch = "X64" Then $sFramework = "Framework64" Else $sFramework = "Framework" EndIf If FileExists(@WindowsDir & "Microsoft.NET"& $sFramework &"v3.5vbc.exe") Then $sPath = @WindowsDir & "Microsoft.NET"& $sFramework &"v3.5vbc.exe" ElseIf FileExists(@WindowsDir & "Microsoft.NET"& $sFramework &"v3.0vbc.exe") Then $sPath = @WindowsDir & "Microsoft.NET"& $sFramework &"v3.0vbc.exe" Elseif FileExists(@WindowsDir & "Microsoft.NET"& $sFramework &"v2.0.50727vbc.exe") Then $sPath = @WindowsDir & "Microsoft.NET"& $sFramework &"v2.0.50727vbc.exe" Elseif FileExists(@WindowsDir & "Microsoft.NET"& $sFramework &"v2.0.50727vbc.exe") Then $sPath = @WindowsDir & "Microsoft.NET"& $sFramework &"v2.0.50727vbc.exe" Elseif FileExists(@WindowsDir & "Microsoft.NET"& $sFramework &"v1.1.4322vbc.exe") Then $sPath = @WindowsDir & "Microsoft.NET"& $sFramework &"v1.1.4322vbc.exe" ElseIf FileExists(@WindowsDir & "Microsoft.NET"& $sFramework &"v1.0.3705vbc.exe") Then $sPath = @WindowsDir & "Microsoft.NET"& $sFramework &"v1.0.3705vbc.exe" Else MsgBox(0,"Error", "The DotNet version needed, is not available") Exit EndIf Return $sPath EndFunc ;=> CheckDotNetVersion Func _CreateGradient($hwnd) $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd) $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics) $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap) $pen = _GDIPlus_PenCreate(0xFF000000, 1) ;you can move this lines below until Do...Until loop to Do...Until loop and make some realtime effects $r = 0x00 $g = 0x00 $b = 0xFF $c = "0xFF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2) $i = 255 / $width _GDIPlus_GraphicsClear($backbuffer) For $x = 0 To $width ;_GDIPlus_GraphicsDrawLine($backbuffer, $x, 0, $x, $width, $pen) ; Full Screen _GDIPlus_GraphicsDrawLine($backbuffer, $x, 0, $x, 40, $pen) _GDIPlus_PenSetColor($pen, 0xFFFFFFFF) ; White Next For $x = 0 To $width ;_GDIPlus_GraphicsDrawLine($backbuffer, $x, 0, $x, $width, $pen) ; Full Screen _GDIPlus_GraphicsDrawLine($backbuffer, $x, 40, $x, 42, $pen) ; Start at 30 ends at 40 _GDIPlus_PenSetColor($pen, $c) ; Gradient Line $r += $i $g += $i $c = "0xEF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2) Next For $x = 0 To $width ;_GDIPlus_GraphicsDrawLine($backbuffer, $x, 0, $x, $width, $pen) ; Full Screen _GDIPlus_GraphicsDrawLine($backbuffer, $x, 42, $x, $height, $pen) _GDIPlus_PenSetColor($pen, 0xFFFFFFFF) ; White Next _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height) ; Full Screen EndFunc ;=> _CreateGradient Func Close() _GDIPlus_PenDispose($pen) _GDIPlus_GraphicsDispose($backbuffer) _GDIPlus_BitmapDispose($bitmap) _GDIPlus_GraphicsDispose($graphics) _GDIPlus_Shutdown() EndFunc ;Func to redraw on PAINT MSG - Thanks to UEZ Func MY_PAINT($hWnd, $msg, $wParam, $lParam) ; The sequencial order of these two commands is important. _GDIPlus_GraphicsDrawImage($graphics, $bitmap, 0, 0) _WinAPI_RedrawWindow($hwnd, "", "", BitOR($RDW_INVALIDATE, $RDW_UPDATENOW, $RDW_FRAME, $RDW_ALLCHILDREN)) Return $GUI_RUNDEFMSG EndFunc ;==>MY_PAINT ;Func to redraw on PAINT MSG - Thanks to UEZ Func WM_ERASEBKGND($hWnd, $msg, $wParam, $lParam) _GDIPlus_GraphicsDrawImage($graphics, $bitmap, 0, 0) Return 1 EndFunc ;==>MY_PAINT Func _LOGOBin1() Local $FileName = "0x0000010001002040000001000400E8020000160000002800000020000000400000000100040000000000000000000000000000000000000000000000" $FileName &= "00000000000000000000008000000080800080000000800080008080000080808000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF" $FileName &= "0000FFFFFF0011111111111111111111111111111111111100000000000001111111111111111111788888888888011111111111111111117FFFFFFF" $FileName &= "FFF8011111111111111110007FFFFFFFFFF8011111111111111117FB7FFFFFFFFFF8011111111111111117BF7F44444444F8000000000000001117FB" $FileName &= "7FFFFFFFFFF8088888888888801117BF7F44444444F808F8F8F8F8F8801117FB7FFFFFFFFFF80F8F8F8F8F8F801117BF7F44444444F808F8F8F8F8F8" $FileName &= "801117FB7FFFFFFFFFF80F8F8F8F8F8F801117BF7F44444444F808F8FFFFFFF8801117FB7FFFFFFFFFF80F8FFCCCC8FF801117BF7FFFFFFFFFF808F8" $FileName &= "FCFFFCF8801117FB7777777777770FFFFCFFFCFF801117BFBFBFBFBF78F8FFCFFCCCCFF8801117FBFBFBFBFB7F8FFFCFFCFFFCFF8011177777777777" $FileName &= "78F8FCFCFCFFFCF880111117FFFFFFFFFFFFFCFCFCCCC8FF80111117FFFFFFFFFFFFFCFCFFFFFFF880111117FFFFFFFFFFFFCFFFCF8F8F8F80111117" $FileName &= "FFFFFFFFFFFFCFFFCFF8F8F880111117FFFFFFFFFFFFFFFFFFFF8F8F80111117FFFFFFFFFFFFFFFFF8F8F8F880111117FFFFFFFFFFFFFFFFFFFF8F8F" $FileName &= "80111114444444C4C44C44C4CCC4CCCCC011111444444C444C44C4CCC4CCCCCCC01111144444444C444C4C4CCCCCCCCCC0111114444444C44C44C4C4" $FileName &= "C4C4CCCCC0111111111111111111111111111111111111111111111111111111111111111111FFFFFFFFF0007FFFF0007FFFF0007FFF80007FFF8000" $FileName &= "7FFF80000003800000038000000380000003800000038000000380000003800000038000000380000003800000038000000380000003E0000003E000" $FileName &= "0003E0000003E0000003E0000003E0000003E0000003E0000003E0000003E0000003E0000003FFFFFFFFFFFFFFFF" Return $FileName EndFunc Func _LOGOBin2() Local $FileName = "0x0000010001002040000001002000A8100000160000002800000020000000400000000100200000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "00000000000000000000000000000000000000000000CF6B6CFFC96869FFB25B5CFF7F3F3FFF6E92A2FF6A8B9CFF597687FF435869FF283543FF749C" $FileName &= "8AFF709686FF5E8174FF47645BFF2B403BFF000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000CF6B6CFCE88E8FFFE6898AFFB65B5BFF7196A6FF58C5E1FF4DBEDDFF4DBE" $FileName &= "DDFF5BBADBFF779F8DFF68D097FF5ECC91FF5ECC91FF6ACB9BFF3E6C5FFF000000000000000000000000000000000000000000000000000000000000" $FileName &= "0000000000000000000000000000000000000000000000000000000000000000000000000000D27172FFA66C6CFFA06364FF8C4B4BFF749BACFF62A3" $FileName &= "BDFF5798B4FF4D8DABFF4B809CFF7AA592FF6DB292FF62A989FF58A081FF549279FF3BBC7DFF3E6C5FFF000000000000000000000000000000000000" $FileName &= "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000D67879FFF6AAABFFF09D9EFFCB68" $FileName &= "68FF77A1B1FF63D3F3FF5CD0F3FF55CDF2FF5BBADBFF7EAA95FF74E2A8FF6EE1A5FF67DFA1FF6ACB9BFF3BBC7DFF3E6C5FFF705642FF6F5440FF6E53" $FileName &= "3FFF6D523DFF6B513DFF6A4F3BFF694E39FF684D38FF674C38FF664B36FF654A35FF644934FF634933FF634833FF0000000000000000DA8283FFC37F" $FileName &= "7FFFBC7475FFA45959FF7CA6B7FF69A6BDFF5F9CB4FF5590ACFF4B809CFF83B09BFF73B394FF69AA8CFF5FA185FF549279FF3BBC7DFF406E61FFC4AD" $FileName &= "A2FFC3ACA0FFC1AA9DFFC0A89CFFBFA699FFBDA497FFBBA295FFB9A193FFB89E90FFB69C8EFFB49B8CFFB2998AFFB19787FF634834FF000000000000" $FileName &= "0000DF8A8BFFFDB9BBFFF9B0B1FFCE6E6DFF7FACBDFF7EDEF5FF78DCF4FF71D9F4FF5BBADBFF86B59FFF8CE7B4FF87E5B0FF80E4AEFF6ACB9BFF3BBC" $FileName &= "7DFF437265FFF6DFD4FFF5DED2FFF5DCD0FFF4DACEFFF4D9CCFFF3D7CAFFF3D5C8FFF2D4C6FFF1D3C4FFF2D1C2FFF1D0C0FFF0CEBEFFB3998BFF6549" $FileName &= "35FF0000000000000000E39394FFFFBDBEFFFDB7B9FFCF7170FF83B2C3FF8BE3F5FF85E1F4FF7EDEF4FF5BBADBFF8ABBA3FF97E8B9FF92E7B6FF8CE6" $FileName &= "B3FF6ACB9BFF3BBC7DFF477668FFF5E0D7FFF6DFD5FFF5DED2FFF4DCD0FFF4DACEFFF3D9CCFFF3D7C9FFF2D5C7FFF2D4C5FFF2D3C3FFF2D1C2FFF1D0" $FileName &= "C0FFB59C8DFF664B36FF0000000000000000E79B9CFFFFBDBEFFFFBDBEFFD17473FF88B7C9FF96E7F6FF91E6F6FF8AE3F5FF5BBADBFF8FC1A9FFA1EA" $FileName &= "BFFF9DEABCFF96E8B8FF6ACB9BFF3BBC7DFF4B7B6BFFF7E2D8FFF6E1D6FFF6DFD4FFF5DED2FFF5DCD0FFF4DACEFFF3D9CBFFF3D6CAFFF2D5C8FFF2D3" $FileName &= "C5FFF2D3C4FFF1D1C2FFB89E90FF674D38FF0000000000000000ECA4A5FFFFBDBEFFFFBDBEFFD27676FF8BBCCEFF9FEBF6FF9BEAF6FF96E7F6FF5BBA" $FileName &= "DBFF93C6ADFFA9EBC2FFA6EBC0FFA1EABFFF6ACB9BFF3BBC7DFF4F8070FFF7E3DAFFF6E2D8FFF6E0D6FFF9E8E1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" $FileName &= "FFFFFFFFFFFFFFFFFFFFF7E3DBFFF2D3C4FFBAA193FF684E3AFF0000000000000000F0ACADFFCD8585FFC57A7BFFAC5D5DFF8DC0D2FF78ADBEFF6FA2" $FileName &= "B5FF6697ACFF4B809CFF95CAB0FF80B59AFF77AC93FF6EA38BFF549279FF3BBC7DFF548473FFF7E5DCFFF6E3DAFFF6E2D7FFFFFDFDFFDA925CFFCB66" $FileName &= "00FFCB6600FFCB6600FFCB6600FFDA925CFFFCF6F1FFF5DED3FFBCA497FF6A4F3BFF0000000000000000F4B3B4FFFFBDBEFFFFBDBEFFD37979FF8FC3" $FileName &= "D5FFABF0F7FFABF0F7FFA8EFF7FF5BBADBFF97CCB2FFB4EEC8FFB4EEC8FFB1EDC6FF6ACB9BFF3BBC7DFF598A78FFF8E7DEFFF7E5DCFFF7E3DAFFFFFF" $FileName &= "FFFFDA925CFFCB6600FFE6B692FFE6B692FFD17733FFCB6600FFE9BFA0FFFAEDE7FFBEA79AFF6B523DFF0000000000000000F5B6B7FFF5B6B7FFEDA7" $FileName &= "A9FFCF7171FF8FC3D5FF85B4C7FF7AA4B4FF7095A6FF6A8B9CFF97CCB2FF8DBFA8FF81AD98FF769F8DFF709686FF3BBC7DFF5E907DFFF8E7E0FFF7E6" $FileName &= "DDFFF7E4DBFFFFFFFFFFDA925CFFCB6600FFFFFFFFFFFFFFFFFFE9BFA0FFCB6600FFE9BFA0FFF9EEE8FFC0A99DFF6D543FFF00000000000000000000" $FileName &= "0000D6A29DFF927C6CFFE5E0DCFFCD999EFF91B2B9FF907B6DFFE5E0DCFFFFFFFFFF6A8B9CFF96B4A3FF8B7179FFE4DDDFFFFFFFFFFF709686FF80A8" $FileName &= "98FFFEFAF9FFFFFFFFFFFDFAF8FFFFFFFFFFDA925CFFCB6600FFCB6600FFCB6600FFCB6600FFD7894EFFFCF6F1FFF6E1D7FFC3AB9FFF6F5541FF0000" $FileName &= "0000000000000000000000000000C69992FF957D6EFFF4ECE8FFCB9196FF8CABB3FF86837DFFF4ECE8FFE2F3F5FF6A8B9CFFFBF2EEFF857E7FFFF2E9" $FileName &= "EDFFE5F3EAFFE5ECE9FFE9BFA0FFCB6600FFE9BFA0FFFFFFFFFFDA925CFFCB6600FFE6B692FFE6B692FFD17733FFCB6600FFFFFFFFFFF5DDD2FFC4AE" $FileName &= "A2FF715743FF00000000000000000000000000000000B7A293FFFEFBFAFFFEFBFBFFFDFAF9FFFDF9F7FFFDF9F6FFFCF7F5FFFDF5F3FFFCF5F1FFFBF3" $FileName &= "EFFFFBF2EDFFFBF0EBFFFCF4F1FFF9EDE4FFD7894EFFCB6600FFD7894EFFFFFFFFFFDA925CFFCB6600FFFFFFFFFFFFFFFFFFDD9B69FFCB6600FFF6E4" $FileName &= "D6FFF6E0D6FFC7B1A5FF735945FF00000000000000000000000000000000B7A293FFFEFDFCFFFEFCFBFFFDFCFAFFFDFBF9FFFDF9F8FFFDF9F6FFFDF7" $FileName &= "F4FFFCF6F3FFFCF5F1FFFBF3EFFFFBF2EEFFFEFDFCFFE6B692FFCB6600FFD7894EFFCB6600FFF6E4D6FFDA925CFFCB6600FFCB6600FFCB6600FFCB66" $FileName &= "00FFD7894EFFFFFFFFFFF5DFD4FFC9B3A8FF755B48FF00000000000000000000000000000000B7A293FFFEFEFEFFFEFDFCFFFEFCFBFFFEFBFAFFFEFA" $FileName &= "F9FFFDF9F7FFFDF8F5FFFDF7F4FFFDF5F2FFFBF4F1FFFBF3F0FFFFFFFFFFD48040FFCB6600FFF6E4D6FFCB6600FFD48040FFF6E4D6FFF3DBC9FFF3DB" $FileName &= "C9FFF3DBC9FFF3DBC9FFFFFFFFFFF8EAE3FFF5DED2FFCBB6ACFF775E4AFF00000000000000000000000000000000B7A293FFFFFFFEFFFFFEFDFFFEFD" $FileName &= "FCFFFEFCFCFFFEFBFAFFFDFAF9FFFDF9F7FFFDF8F6FFFDF6F4FFFCF5F2FFFDF8F6FFF6E4D6FFCB6600FFE0A477FFFFFFFFFFE0A477FFCB6600FFF6E4" $FileName &= "D6FFFEFAF9FFFAF1ECFFFAF0EBFFF9ECE6FFF7E5DDFFF6E1D6FFF5DED4FFCDBAAFFF79604DFF00000000000000000000000000000000B7A293FFFFFF" $FileName &= "FFFFFFFFFEFFFEFEFDFFFEFCFCFFFEFCFBFFFEFBF9FFFDFAF8FFFDF9F7FFFDF8F5FFFCF6F4FFFFFFFFFFE3AD84FFCB6600FFF0D2BBFFFFFFFFFFF0D2" $FileName &= "BBFFCB6600FFE3AD84FFFFFEFEFFF8E8E1FFF7E6DEFFF7E5DCFFF7E3DAFFF7E2D8FFF5E0D5FFCFBCB3FF7B624FFF0000000000000000000000000000" $FileName &= "0000B7A293FFFFFFFFFFFFFFFFFFFFFEFEFFFEFDFDFFFEFDFCFFFEFCFBFFFEFAF9FFFDFAF8FFFDF9F7FFFDF7F5FFFFFFFFFFCB6600FFD17733FFFFFF" $FileName &= "FFFFFCF5F1FFFFFFFFFFD17733FFCB6600FFFFFFFFFFF9E9E2FFF8E8E1FFF8E6DEFFF7E5DCFFF6E3D9FFF6E2D8FFD1C0B7FF7E6452FF000000000000" $FileName &= "00000000000000000000B7A293FFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFEFFFFFDFDFFFEFCFCFFFEFCFAFFFDFBFAFFFDF9F8FFFDF9F6FFFEFCFBFFF3DB" $FileName &= "C9FFF6E4D6FFFDFAF8FFFBF3EEFFFEFAF8FFF3DBC9FFF6E4D6FFFDF7F4FFF9EBE4FFF9E9E2FFF8E8E0FFF7E6DEFFF7E5DBFFF6E2DAFFD4C3BAFF8067" $FileName &= "54FF00000000000000000000000000000000B7A293FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFEFDFDFFFEFCFCFFFEFBFBFFFDFBFAFFFEFA" $FileName &= "F8FFFDF9F7FFFEF9F8FFFDF9F6FFFCF6F2FFFCF3EFFFFBF3F0FFFCF4F1FFFBF3F0FFFAEFEAFFF9ECE6FFF9EBE4FFF9E9E2FFF8E7E0FFF8E6DEFFF7E4" $FileName &= "DCFFD7C7BEFF826957FF00000000000000000000000000000000B7A293FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFEFFFEFDFDFFFEFD" $FileName &= "FCFFFEFBFBFFFEFAF9FFFDF9F8FFFDF9F6FFFDF8F4FFFCF6F3FFFCF5F1FFFCF3EFFFFBF2EDFFFAF0ECFFFAEFEAFFF9EEE8FFF9ECE6FFF9EBE4FFF9E9" $FileName &= "E1FFF8E7DFFFF7E6DDFFF7E4DBFF846C5AFF00000000000000000000000000000000D19172FFD19172FFD19172FFD08C6BFFD08661FFCE7E55FFCD75" $FileName &= "49FFCC6D3DFFCA6431FFCA5D27FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC959" $FileName &= "20FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FF00000000000000000000000000000000D19172FFFEC09FFFFEBE9DFFFDBC9BFFFDBA" $FileName &= "98FFFDB996FFFCB793FFFBB590FFFBB38DFFFBB08AFFFAAE86FFF9AB83FFF8A980FFF8A77DFFF7A47AFFF7A377FFF5A074FFF59E71FFF59C6FFFF49A" $FileName &= "6DFFF4996AFFF49768FFF39666FFF39565FFF39565FFF39565FFF39565FFC95920FF00000000000000000000000000000000D19172FFFEC09FFFFEBE" $FileName &= "9DFFFDBD9BFFFDBB98FFFDB995FFFCB693FFFBB590FFFBB28DFFFBB08AFFF9AE86FFF9AB84FFF8A980FFF8A77EFFF7A57AFFF7A377FFF6A074FFF59E" $FileName &= "71FFF59C6EFFF49A6DFFF4986AFFF49768FFF49666FFF39565FFF39565FFF39565FFF39565FFC95920FF00000000000000000000000000000000D191" $FileName &= "72FFFEC09EFFFEBF9DFFFEBC9AFFFDBB98FFFDB995FFFCB693FFFCB590FFFBB38DFFFAB18AFFF9AE87FFF9AB83FFF9AA81FFF7A77DFFF7A57AFFF6A3" $FileName &= "77FFF6A075FFF69E71FFF59D6FFFF49A6CFFF4986AFFF49768FFF49667FFF39565FFF39565FFF39565FFF39565FFC95920FF00000000000000000000" $FileName &= "000000000000D19172FFD19172FFD19172FFD08C6BFFD08661FFCE7E55FFCD7549FFCC6D3DFFCA6431FFCA5D27FFC95920FFC95920FFC95920FFC959" $FileName &= "20FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FF0000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000FFFFFFFFFFFFFFFF8001FFFF8000FFFF80007FFF80000001800000018000000180000001800000018000" $FileName &= "0001800000018000000180000001C0000001E0000001E0000001E0000001E0000001E0000001E0000001E0000001E0000001E0000001E0000001E000" $FileName &= "0001E0000001E0000001E0000001E0000001FFFFFFFFFFFFFFFF" Return $FileName EndFunc Func _LOGOBin3() Local $FileName = "0x0000010001002040000001000800A8080000160000002800000020000000400000000100080000000000000000000000000000000000000000000000" $FileName &= "00000000000000008000008000000080800080000000800080008080000080808000C0DCC000F0CAA600AA3F2A00FF3F2A00005F2A00555F2A00AA5F" $FileName &= "2A00FF5F2A00007F2A00557F2A00AA7F2A00FF7F2A00009F2A00559F2A00AA9F2A00FF9F2A0000BF2A0055BF2A00AABF2A00FFBF2A0000DF2A0055DF" $FileName &= "2A00AADF2A00FFDF2A0000FF2A0055FF2A00AAFF2A00FFFF2A000000550055005500AA005500FF005500001F5500551F5500AA1F5500FF1F5500003F" $FileName &= "5500553F5500AA3F5500FF3F5500005F5500555F5500AA5F5500FF5F5500007F5500557F5500AA7F5500FF7F5500009F5500559F5500AA9F5500FF9F" $FileName &= "550000BF550055BF5500AABF5500FFBF550000DF550055DF5500AADF5500FFDF550000FF550055FF5500AAFF5500FFFF550000007F0055007F00AA00" $FileName &= "7F00FF007F00001F7F00551F7F00AA1F7F00FF1F7F00003F7F00553F7F00AA3F7F00FF3F7F00005F7F00555F7F00AA5F7F00FF5F7F00007F7F00557F" $FileName &= "7F00AA7F7F00FF7F7F00009F7F00559F7F00AA9F7F00FF9F7F0000BF7F0055BF7F00AABF7F00FFBF7F0000DF7F0055DF7F00AADF7F00FFDF7F0000FF" $FileName &= "7F0055FF7F00AAFF7F00FFFF7F000000AA005500AA00AA00AA00FF00AA00001FAA00551FAA00AA1FAA00FF1FAA00003FAA00553FAA00AA3FAA00FF3F" $FileName &= "AA00005FAA00555FAA00AA5FAA00FF5FAA00007FAA00557FAA00AA7FAA00FF7FAA00009FAA00559FAA00AA9FAA00FF9FAA0000BFAA0055BFAA00AABF" $FileName &= "AA00FFBFAA0000DFAA0055DFAA00AADFAA00FFDFAA0000FFAA0055FFAA00AAFFAA00FFFFAA000000D4005500D400AA00D400FF00D400001FD400551F" $FileName &= "D400AA1FD400FF1FD400003FD400553FD400AA3FD400FF3FD400005FD400555FD400AA5FD400FF5FD400007FD400557FD400AA7FD400FF7FD400009F" $FileName &= "D400559FD400AA9FD400FF9FD40000BFD40055BFD400AABFD400FFBFD40000DFD40055DFD400AADFD400FFDFD40000FFD40055FFD400AAFFD400FFFF" $FileName &= "D4005500FF00AA00FF00001FFF00551FFF00AA1FFF00FF1FFF00003FFF00553FFF00AA3FFF00FF3FFF00005FFF00555FFF00AA5FFF00FF5FFF00007F" $FileName &= "FF00557FFF00AA7FFF00FF7FFF00009FFF00559FFF00AA9FFF00FF9FFF0000BFFF0055BFFF00AABFFF00FFBFFF0000DFFF0055DFFF00AADFFF00FFDF" $FileName &= "FF0055FFFF00AAFFFF00FFCCCC00FFCCFF00FFFF3300FFFF6600FFFF9900FFFFCC00007F0000557F0000AA7F0000FF7F0000009F0000559F0000AA9F" $FileName &= "0000FF9F000000BF000055BF0000AABF0000FFBF000000DF000055DF0000AADF0000FFDF000055FF0000AAFF000000002A0055002A00AA002A00FF00" $FileName &= "2A00001F2A00551F2A00AA1F2A00FF1F2A00003F2A00553F2A00F0FBFF00A4A0A000808080000000FF0000FF000000FFFF00FF00000000000000FFFF" $FileName &= "0000FFFFFF00FDFDFD5E5A5E075A0707073207313231FDFDFDF6AFAFAFD4AFAFFDFDFDFDFDFDFDFDFD82F6D4D4D409D4080909090931FDFDFDAF37DC" $FileName &= "0EDCDD36F6FDFDFDFDFDFDFDFD82B3AFF6AFAFAFAFAFAFAF0932FDFDFDAF37DC63090EDDAFFDFDFDFDFD5E5E5A09AFF6AFAFAFAFAFAFAFAF0931FDFD" $FileName &= "FDAF3ADDD1D187DCAFFDFDFDFDFD82D0A986D1AF0F0E0E0E0A0AF5AF0907AFAFAFAF37DCDCDCDC37FFFDFDFDFDFD5ECFD086F6F6F6AFF6AFB3AFAFAF" $FileName &= "D4AF83DC09AF370E63090EDCAFFDFDFDFDFD82D0CF09D1B30F0E0E0A0AF50AAFAFAF36DC37AF3ADDD1FF3BDCAF320DF5FDFD86D0AD09F6FFF6B3D1B3" $FileName &= "F6AFAFF6FF63DC37DCAF37DCDCDCDC37FFF000F5FDFD86D0D008FFF60F0E0E0A0AF50AAFFF33DCAFDC12AFD4D409D4FF3100000DFDFD09CFD009FFF6" $FileName &= "F6FFFFB3FFB3AFF6AFDC5FF65FDCAF08070731F100F000F5FDFD08D0D008FFFF0F0E0E0A0AF50AFF5FDCD4FFD4DD5FF600F00000000000F5FDFD09D0" $FileName &= "D3AFFFFFFFFFFFFFF6B3D1FFDC12FF31FF12DCFFF00000F000000031FDFD08D0D008F6FFFFFFFFFFFFFFFFFFAFAFF7F082AFAFF700F100000000000D" $FileName &= "FDFDD4D3D0AFFFFFFFF6FFFFFFF6D1FFF6F72DF02D3131F5F000F0F100F0002DFDFD08D0D3AFAF0808AFAF08D4D40808095EF1F5F0F5F0F0F1F00000" $FileName &= "F000000EFDFDAFD3D0D3D0D0D3D0ADD0CFAD5AF52C2DF5F4F1F0F0F1F0F0F1F0F000F031FDFDAFD0D3D0D3D0D0D3D0D0D0D05A2DF5F52CF52CF5F5F0" $FileName &= "F1F0F0F100F0000EFDFDAFAFAFAFAFAFD4D4D408AB085E2D2D2DF52DF5F429F5F0F5F0F0F1F0F031FDFDFDFD5E3131313155313131312D31312D31F5" $FileName &= "2CF5F5F4F1F0F1F1F0F0F10DFDFDFDFD8231553131313131313131312D2D2D2DF52DF42DF5F4F5F0F0F1F031FDFDFDFD5E313107FFFF31FF3131FF31" $FileName &= "3131312D31F52DF52CF5F0F5F1F0F032FDFDFDFD823131FF075531553131FF31312D31312D2D31F52DF52DF4F5F5F031FDFDFDFD823131FF31313131" $FileName &= "318282313131312D31312D2D0D2DF42DF5F0F532FDFDFDFD5E3155FF073131FF31FF313131313131312D2D312DF52DF52CF5F431FDFDFDFD82313107" $FileName &= "FFFF313131FF3107313131313131312D2D312DF52D2DF532FDFDFDFD5E31313131310731073131313131313131313131312D312DF52DF531FDFDFDFD" $FileName &= "5B5E5B363636320E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A0E0E0E0E0FFDFDFDFD5E8763878787636387635F5F5F5F5F5F3B5F5F3B5B3B5F3B3B375F0E" $FileName &= "FDFDFDFD37878787636383635F5F635F635F5F5F5F5F3B5F3B5F3B5B3B5F3B0EFDFDFDFD5E6387098787638763635F5F5F5F5F5F3B5F3B5F3B373B3B" $FileName &= "373B370FFDFDFDFD5E5B5E373637360E0F0E0E0E0E0F0E0E0E0E0F0E0E0E0E0F0E0E0E0EFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD" $FileName &= "FDFDFDFDFDFDFDFDFDFDE000E03FE000E01FE000E01F0000E01F0000001F0000001F0000000300000003000000030000000300000003000000030000" $FileName &= "00030000000300000003000000030000000300000003C0000003C0000003C0000003C0000003C0000003C0000003C0000003C0000003C0000003C000" $FileName &= "0003C0000003C0000003C0000003FFFFFFFF" Return $FileName EndFunc 1.To create a Windows Application, you can use the fist icon. See the "Hello World.vb" example script. 2.To create a Class Library(dll file), you can use the second icon. Open the "Hello World.vb" Script and it will produce a DotNet.dll. Wich you can reuse in other scripts. 3.To create a console application, you can use the third icon. See the "GetTickCount.vb" example script. _DOTnet Scripting.zip Edit : Changed the script not to delete the compiled exe files. Enjoy ! Rgds ptrex1 point
-
bitwise calcs
Professor_Bernd reacted to trancexx for a topic
If BitAND(44, 1) Then 1 is used If BitAND(44, 2) Then 2 is used If BitAND(44, 4) Then 4 is used If BitAND(44, 8) Then 8 is used If BitAND(44, 16) Then 16 is used If BitAND(44, 32) Then 32 is used1 point -
@all OK this is an Example connecting to a Web Service collecting the MS stock information. Dim $oMyError, $xmlFile, $oNode, $strReturn, $objReq $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $xmlDoc= ObjCreate("Msxml2.DOMdocument.3.0") $SOAPClient = objcreate("MSSOAP.SOAPClient") $SOAPClient.mssoapinit ("http://www.webservicex.net/stockquote.asmx?WSDL") $strReturn = $SOAPClient.GetQuote("MSFT") ConsoleWrite( "MSFT : " & $strReturn & @CRLF & @CRLF) $xmlDoc.loadXML ($strReturn) $oNode = $xmlDoc.selectSingleNode("StockQuotes") ConsoleWrite($oNode.text & @CRLF & @CRLF) ;This is COM error handler Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc oÝ÷ ØgXsJ)ߢ¹¶*'jëh×6Dim $oMyError $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") dim $SOAPClient $SOAPClient = ObjCreate("MSSOAP.SOAPClient") $SOAPClient.mssoapinit("http://www.webservicex.net/whois.asmx?wsdl") if @error then ConsoleWrite( $SOAPClient.faultString) ConsoleWrite( $SOAPClient.detail) Endif ConsoleWrite($SOAPClient.GetWhois("autoitscript.com")) if @error then ConsoleWrite($SOAPClient.faultString) ConsoleWrite($SOAPClient.detail) endif ;This is COM error handler Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns EndfuncoÝ÷ Ù8b²ÞÁ¶Ø§©e §¶¸±«¢+Ù¥´ÀÌØí½5åÉɽÈ(ÀÌØí½5åÉɽÈô=©Ù¹Ð ÅÕ½ÐíÕѽ%йÉɽÈÅÕ½Ðì°ÅÕ½Ðí5åÉÉÕ¹ÅÕ½Ðì¤()¥´ÀÌØíM=A ±¥¹Ð(ÀÌØíM=A ±¥¹Ðô=© ÉÑ ÅÕ½Ðí5MM=@¹M=A ±¥¹ÐÅÕ½Ðì¤((ÀÌØíM=A ±¥¹Ð¹µÍͽÁ¥¹¥Ð ÅÕ½Ðí¡ÑÑÀè¼½ÝÝܹÝÍÉ٥๹н½Õ¹ÑÉä¹ÍµàýÝÍ°ÅÕ½Ðì¤(¥ÉɽÈÑ¡¸( ½¹Í½±]É¥Ñ ÀÌØíM=A ±¥¹Ð¹Õ±ÑMÑÉ¥¹¤( ½¹Í½±]É¥Ñ ÀÌØíM=A ±¥¹Ð¹Ñ¥°¤(¹¥) ½¹Í½±]É¥Ñ ÀÌØíM=A ±¥¹Ð¹Ñ ½Õ¹ÑÉ¥Ì ¤¤(¥ÉɽÈÑ¡¸( ½¹Í½±]É¥Ñ ÀÌØíM=A ±¥¹Ð¹Õ±ÑMÑÉ¥¹¤( ½¹Í½±]É¥Ñ ÀÌØíM=A ±¥¹Ð¹Ñ¥°¤(¹¥((íQ¡¥Ì¥Ì =4Éɽȡ¹±È)Õ¹5åÉÉÕ¹ ¤(ÀÌØí!á9ÕµÈõ¡à ÀÌØí½5åÉɽȹ¹ÕµÈ°à¤(5ͽà À°ÅÕ½Ðí =4ÉɽÈQÍÐÅÕ½Ðì°ÅÕ½Ðí]¥¹ÑÉÁÑ =4ÉɽÈÌÌìÅÕ½ÐìµÀì I1µÀì I1µÀì|($$$ÅÕ½ÐíÉȹÍÉ¥ÁÑ¥½¸¥ÌèÅÕ½ÐìµÀìQµÀìÀÌØí½5åÉɽȹÍÉ¥ÁÑ¥½¸µÀì I1µÀì|($$$ÅÕ½ÐíÉȹݥ¹ÍÉ¥ÁÑ¥½¸èÅÕ½ÐìµÀìQµÀìÀÌØí½5åÉɽȹݥ¹ÍÉ¥ÁÑ¥½¸µÀì I1µÀì|($$$ÅÕ½ÐíÉȹ¹ÕµÈ¥ÌèÅÕ½ÐìµÀìQµÀìÀÌØí!á9յȵÀì I1µÀì|($$$ÅÕ½ÐíÉȹ±Íѱ±ÉɽȥÌèÅÕ½ÐìµÀìQµÀìÀÌØí½5åÉɽȹ±Íѱ±ÉɽȵÀì I1µÀì|($$$ÅÕ½ÐíÉȹÍÉ¥Áѱ¥¹¥ÌèÅÕ½ÐìµÀìQµÀìÀÌØí½5åÉɽȹÍÉ¥Áѱ¥¹µÀì I1µÀì|($$$ÅÕ½ÐíÉȹͽÕÉ¥ÌèÅÕ½ÐìµÀìQµÀìÀÌØí½5åÉɽȹͽÕɵÀì I1µÀì|($$$ÅÕ½ÐíÉȹ¡±Á¥±¥ÌèÅÕ½ÐìµÀìQµÀìÀÌØí½5åÉɽȹ¡±Á¥±µÀì I1µÀì|($$$ÅÕ½ÐíÉȹ¡±Á½¹ÑáÐ¥ÌèÅÕ½ÐìµÀìQµÀìÀÌØí½5åÉɽȹ¡±Á½¹ÑáÐ|($$$¤(MÑÉÉ½È Ä¤ìѼ¡¬½ÈÑÈÑ¡¥Ìչѥ½¸ÉÑÕɹÌ)¹Õ¹ Regards, ptrex1 point