Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/30/2013 in all areas

  1. Inspired from '?do=embed' frameborder='0' data-embedContent>> You cannot use chrome to navigate or access the DOM, but I suppose you just might want to display your page, or your app. You need latest version of chrome as far as I know. #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPIEx.au3> #include <Constants.au3> _Example() Func _Example() Local $hGui, $sURL = "https://www.google.co.uk" Local $iLeft = 0, $iTop = 0, $iWidth = 1024, $iHeight = 768 $hGui = GUICreate("Test", $iWidth, $iHeight) Local $aMain = ChromeCreatePseudoEmbedded($iLeft, $iTop, $iWidth, $iHeight, $hGUI, $sURL) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then WinClose($aMain[1]) ; Chrome kiosk window WinClose($hGui) ; Own gui ;ProcessClose($aMain[0]) ; Chrome executable ProcessWaitClose($aMain[0]) ; Chrome executable Exit EndIf WEnd EndFunc ;==>_Example ;Returns a 1D array where [0] is the process id of the chrome executable which is launched ;and [1] is the handle to the chrome window. ;They are both needed to cleanly close. Func ChromeCreatePseudoEmbedded($i_Left, $i_Top, $i_Width, $i_Height, $h_Parent, $sURL) ;http://www.autoitscript.com/forum/topic/152173-pseudo-embed-google-chrome/ Local $acMain[2] $acMain[0] = Run(@ProgramFilesDir & "\Google\Chrome\Application\chrome.exe --chrome-frame -kiosk " & $sURL) If @error Then MsgBox(0, 0, @error) Exit EndIf Local $ah_HWND Do $ah_HWND = _WinAPI_EnumProcessWindows($acMain[0]) Sleep(10) Until IsArray($ah_HWND) $acMain[1] = HWnd($ah_HWND[1][0]) _WinAPI_SetParent($acMain[1], $h_Parent) _WinAPI_SetWindowLong($acMain[1], $GWL_STYLE, $WS_POPUP + $WS_VISIBLE) ControlMove($acMain[1], "", "", $i_Left + 1, $i_Top + 1, $i_Width - 2, $i_Height - 2) GUISetState(@SW_SHOW, $h_Parent) WinActivate($acMain[1]) Return $acMain EndFunc ;==>ChromeCreatePseudoEmbedded .EDIT: Remove ProcessClose(), Closes itself after WinClose. EDIT2: I have also noticed you can include more urls, and ctrl tab between them. For example $sURL = "https://www.google.co.uk http://www.yahoo.com" I'm not yet sure though whether that would leave orphan window handles or processes after closing. .
    1 point
  2. Ok, here is what i came up with after 3-4 hours of scripting well ok, it has been long time since then, so... after an year or so of hard scripting/testing!!! (inspired by this topic)... GUICtrlSetOnHover UDF... Syntax: _GUICtrl_OnHoverRegister(ControlID [, OnHoverFunc [, OnLeaveHoverFunc [, PrimaryDownFunc [, PrimaryUpFunc [, KeepCall_PrDn_Func [, KeepCall_Hover_Func]]]]]]) ControlID can be -1 as in Build-In functions! Example: #include "GUICtrlOnHover.au3" Opt("GUIOnEventMode", 1) $Btn_Color = 0x7A9DD8 $Hover_Color = 0xFF0000 ;0x7AC5D8 $GUIMain = GUICreate("Letters Hovering Example", 570, 200) GUISetOnEvent(-3, "Quit") _CreateLetters_Proc(10, 60, 18, 20) GUICtrlCreateButton("Close", 30, 120, 100, 30) GUICtrlSetOnEvent(-1, "Quit") GUICtrlSetFont(GUICtrlCreateLabel("Letter: ", 35, 170, 200, 20), 9, 800) $Status_Label = GUICtrlCreateLabel("", 80, 171, 200, 20) GUICtrlSetColor(-1, 0xFF0000) GUICtrlSetFont(-1, 8.5, 800) GUISetState() While 1 Sleep(100) WEnd Func _CreateLetters_Proc($iLeft, $Top, $Width=15, $Height=15) Local $iLeft_Begin = $iLeft Local $iAsc_Char = 64 For $i = 0 To 25 $iLeft_Begin += 20 $iAsc_Char += 1 GUICtrlCreateButton(Chr($iAsc_Char), $iLeft_Begin, $Top, $Width, $Height) _GUICtrl_OnHoverRegister(-1, "_Hover_Func", "_Leave_Hover_Func") GUICtrlSetOnEvent(-1, "_Letter_Events") GUICtrlSetBkColor(-1, $Btn_Color) GUICtrlSetFont(-1, 6) Next EndFunc Func _Letter_Events() MsgBox(64, "Pressed", "Letter = " & GUICtrlRead(@GUI_CtrlId)) EndFunc Func _Hover_Func($iCtrlID) GUICtrlSetBkColor($iCtrlID, $Hover_Color) GUICtrlSetData($Status_Label, GUICtrlRead($iCtrlID)) Beep(1000, 20) EndFunc Func _Leave_Hover_Func($iCtrlID) GUICtrlSetBkColor($iCtrlID, $Btn_Color) GUICtrlSetData($Status_Label, "") EndFunc Func Quit() Exit EndFunc Attachments: [The archive include few nice examples, and the UDF itself of course .] * New (v2.1) (Redirection to Zip-file, 159 kb) _GUICtrlSetOnHover.html GUICtrlSetOnHover.zip GUICtrlSetOnHover_UDF.au3 GuiCtrlSetOnHover.zip GUICtrlSetOnHover_UDF_For_3.2.10.0.au3 Old Beta - GUICtrlSetOnHover_UDF_beta.zip Enjoy! P.S Thanks to piccaso for the greatest CallBack tool! Without it, this UDF would never been created! ============================================ History version:
    1 point
  3. In layman's terms... NTFS file system allows for file to be associated with more than one file stream. Streams other than the main are called Alternate Data Streams. Normally the users on Windows systems aren't aware of them because windows explorer can't show them. They aren't meant to be seen and have purpose of carrying additional information about the file they are "attached" to. For example if you download something from internet and try to run it, by default you should have shell window popping-up informing you about the risks of running downloaded material. That information is attached to the file right after it's been downloaded and it's saved as :Zone.Identifier ADS. Also some malware creators use ADS to hide and perform different actions from there. For example it's nothing unusual to find malignant executable module in ADS of seemingly benign executable. NTFS implementation for Compound Files also uses ADS, even exclusively. Anyway, the script I'm posting here allows you to list and view all streams of the file that you load. Three methods are used to enumerate streams depending on your wishes. You can choose to use NtQuery, BackupRead or FindStream method and maybe compare speed and availability of each method depending on your system specifications. NtQuery method is used by KaFu in his SMF, so that's not new, but other two methods are new to AutoIt AFAIK, unless used privately of course. There is a GUI around the three functions to show what they do, that part isn't really that important. You will notice that I'm displaying up to 1024 bytes of the selected stream. The script: ADS_Viewer.au3 edit: New script.
    1 point
  4. Here are a few real working examples that have adopted the API-like approach. >_AppMon - By guinness >_AppMonEx - By guinness >_BinaryBin - By guinness >VirusTotal - By Danyfirex
    1 point
  5. FireFox

    omg help

    Only god can help you. I like you too
    1 point
×
×
  • Create New...