Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/04/2014 in all areas

  1. Well, what about this method? $oWMP = ObjCreate("WMPlayer.OCX") $hEmbedd = GUICtrlCreateObj($oWMP, 0, 0, 320, 240) $oWMP.URL = @ScriptDir & "\aac.mp4" With $oWMP .settings.volume = 100 .stretchToFit = True .fullscreen = True .uiMode = 'none' .controls.play() EndWith Sleep(10000) ( source: http://www.autoit.de/index.php?page=Thread&threadID=25048 )
    2 points
  2. I wrote this a while ago and only recently implemented shading. The current shading algorithm could use some improvements. Most of the source is based from here. The .dll source is also in the archive (made with Visual Studio 2012 Express). 2D Water simulation using a C++ dll.7z If you use a x64 bit OS then: EDIT: Added an example using a .gif file (split into frames).
    1 point
  3. Rooted Androids can access things like that but stock roms won't let you.
    1 point
  4. LarsJ

    Get CLSID from IID

    You are right. This is much, much better: Global Const $CLSID_ShellLink = "{00021401-0000-0000-C000-000000000046}" Global Const $dtag_IPersist = _ "GetClassID hresult();" Global Const $sIID_IPersistFile = "{0000010b-0000-0000-C000-000000000046}" Global Const $dtag_IPersistFile = $dtag_IPersist & _ ; Inherits from IPersist "IsDirty hresult();" & _ "Load hresult();" & _ "Save hresult();" & _ "SaveCompleted hresult();" & _ "GetCurFile hresult();" Opt( "MustDeclareVars", 1 ) MainFunc() Func MainFunc() Local $oIPersistFile = ObjCreateInterface( $CLSID_ShellLink, $sIID_IPersistFile, $dtag_IPersistFile ) If Not IsObj( $oIPersistFile ) Then Return ConsoleWrite( "$oIPersistFile ERR" & @CRLF ) ConsoleWrite( "$oIPersistFile OK" & @CRLF ) EndFunc
    1 point
  5. trancexx

    Get CLSID from IID

    You actually don't need to call QueryInterface by yourself because ObjCreateInterface will do that for you by definition. So, just call ObjCreateInterface for $sIID_IPersistFile on ShellLink object. To furher reduce the code, it should be obvious after that being said, that you can simply call ObjCreateInterface with $CLSID_ShellLink as CLSID, $sIID_IPersistFile as IID and $tagIPersistFile interface description to get (wanted) IPersistFile object.
    1 point
  6. (First off, sorry about the font. I didn't set anything specific to make it turn out that way) PhoenixXL, a BIG Thanks for that example!!!! After some experimentation, I came up with this example that DOES allow both an OnEntry as well as OnLeave events. Kudos PhoenixXL for your guidance........ #include <EditConstants.au3> #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> Global Const $OnEntry = 256, $OnLeave = 512 GUICreate(@ScriptName) Global $edit1 = GUICtrlCreateEdit("Edit 1", 10, 10, -1, -1, 0) Global $hEdit1 = GUICtrlGetHandle(-1) Global $edit2 = GUICtrlCreateEdit("Edit 2", 10, 200, -1, -1, 0) Global $hEdit2 = GUICtrlGetHandle(-1) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Switch $lParam Case $hEdit1, $hEdit2 Local $iHi = _WinAPI_HiWord($wParam) Local $iLo = _WinAPI_LoWord($wParam) Case Else Return $GUI_RUNDEFMSG EndSwitch if $iHi = $OnLeave Then Switch $iLo Case $edit1 ConsoleWrite("OnLeave Edit1" & @CRLF) Return 0 Case $edit2 ConsoleWrite("OnLeave Edit2" & @CRLF) Return 0 EndSwitch EndIf if $iHi = $OnEntry Then Switch $iLo Case $edit1 ConsoleWrite("OnEntry Edit1" & @CRLF) Return 0 case $edit2 ConsoleWrite("OnEntry Edit2" & @CRLF) Return 0 EndSwitch EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND
    1 point
  7. I modified your script to display the selected tab number (starting with 0): #include <GUIConstantsEx.au3> Example() Func Example() Local $msg GUICreate("My GUI Tab") ; will create a dialog box that when displayed is centered GUISetBkColor(0x00E0FFFF) GUISetFont(9, 300) $hTab = GUICtrlCreateTab(10, 10, 200, 100) GUICtrlCreateTabItem("tab0") GUICtrlCreateLabel("label0", 30, 80, 50, 20) GUICtrlCreateButton("OK0", 20, 50, 50, 20) GUICtrlCreateInput("default", 80, 50, 70, 20) GUICtrlCreateTabItem("tab----1") GUICtrlCreateLabel("label1", 30, 80, 50, 20) GUICtrlCreateCombo("", 20, 50, 60, 120) GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon") ; default Jon GUICtrlCreateButton("OK1", 80, 50, 50, 20) GUICtrlCreateTabItem("tab2") GUICtrlSetState(-1, $GUI_SHOW) ; will be display first GUICtrlCreateLabel("label2", 30, 80, 50, 20) GUICtrlCreateButton("OK2", 140, 50, 50) GUICtrlCreateTabItem("") ; end tabitem definition GUICtrlCreateLabel("label3", 20, 130, 50, 20) GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $hTAB Then MsgBox(0, "Tab", "Tab #" & GUICtrlRead($hTab) & " selected!") EndIf WEnd EndFunc ;==>Example
    1 point
  8. With just what you told us, I would say take a look at WinActivate and WinGetPos. If the button is always at the same location within the popup window, you should be able to add a certain amount of pixels to the WinGetPos coordinates to click the button.
    1 point
  9. And here is the same but non-blocking, so here you can use also time consuming (long lasting) code: #NoTrayIcon #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <GuiListView.au3> $Form1 = GUICreate("Test", 300, 200, -1, -1) $ListView1 = GUICtrlCreateListView("A|B|C", 15, 15, 270, 118) GUICtrlCreateListViewItem("r1c1|r1c2|r1c3", $ListView1) GUICtrlCreateListViewItem("r2c1|r2c2|r2c3", $ListView1) _GUICtrlListView_SetColumnWidth($ListView1, 0, $LVSCW_AUTOSIZE) $click_id = GuiCtrlCreateDummy() $dblclick_id = GuiCtrlCreateDummy() GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "WM_Notify_Events") While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $click_id OnClick(GUICtrlRead($click_id)) Case $msg = $dblclick_id OnDoubleclick(GUICtrlRead($dblclick_id)) EndSelect WEnd Func OnClick($subitem) $item = _GUICtrlListView_GetNextItem($ListView1) ; current selected $value = _GUICtrlListView_GetItemText($ListView1,$item,$subitem) ConsoleWrite('Click: index:' & $item & ' subitem:' & $subitem & ' value:' & $value & @CRLF) EndFunc Func OnDoubleClick($subitem) $item = _GUICtrlListView_GetNextItem($ListView1) ; current selected $value = _GUICtrlListView_GetItemText($ListView1,$item,$subitem) ConsoleWrite('DoubleClick: index:' & $item & ' subitem:' & $subitem & ' value:' & $value & @CRLF) EndFunc Func WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam) #forceref $hWndGUI, $MsgID, $wParam Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam) Local $hWndFrom = DllStructGetData($tNMHDR, "hWndFrom") Local $nNotifyCode = DllStructGetData($tNMHDR, "Code") If $wParam = $ListView1 Then If $nNotifyCode = $NM_CLICK Then $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) ;~ $item = DllStructGetData($tInfo, "Index") $subitem = DllStructGetData($tInfo, "SubItem") ;~ OnClick($item,$subitem) GUICtrlSendToDummy($click_id, $subitem) EndIf If $nNotifyCode = $NM_DBLCLK Then $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) ;~ $item = DllStructGetData($tInfo, "Index") $subitem = DllStructGetData($tInfo, "SubItem") ;~ OnDoubleClick($item,$subitem) GUICtrlSendToDummy($dblclick_id, $subitem) EndIf EndIf EndFunc
    1 point
  10. I use the following. Returns a path to the icon and its index in "pure" form. #Include <WinAPIEx.au3> Global $Ext = '.au3' ConsoleWrite('(' & $Ext & ')' & @CR) ConsoleWrite('--------------------' & @CR) ConsoleWrite('Type: ' & _WinAPI_AssocQueryString($Ext, $ASSOCSTR_FRIENDLYDOCNAME) & @CR) ConsoleWrite('Command: ' & _WinAPI_AssocQueryString($Ext, $ASSOCSTR_COMMAND) & @CR) ConsoleWrite('Executable: ' & _WinAPI_AssocQueryString($Ext, $ASSOCSTR_EXECUTABLE) & @CR) ConsoleWrite('Icon: ' & _WinAPI_AssocQueryString($Ext, $ASSOCSTR_DEFAULTICON) & @CR) WinAPIEx.au3
    1 point
×
×
  • Create New...