Jump to content

Leaderboard

Popular Content

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

  1. Thanks to all who participated. PM me if you want something like this every month or so. I have another idea that I will be looking at in the next couple of weeks.
    1 point
  2. guinness

    OSVersion & OSArch)

    Now I'm confused. DriveGetDrive?
    1 point
  3. You can do it this way. #include <WinAPITheme.au3> ; add this to your list of includes Global $chkIconShow = GUICtrlCreateCheckbox("I should be white, but I'm black. Why?", 32, 64, 329, 25) _WinAPI_SetWindowTheme($chkIconShow, "", "") ; add this line after you've created your checkbox and before coloring it GUICtrlSetColor(-1, 0xFFFFFF)
    1 point
  4. czardas

    Guitar Tab Tester

    For ear training you need to start with diatonic intervals within the octave. The two notes should be played separately and later at the same time. Then extend the range to cover two octaves. Next you should start to include the four standard triads along with their inversions (chords with three notes). For four note chords, add sevenths. Chords should eventually be presented as short sequences (normally 2 or 3 chords in a standard cadence). Later add ninths, elevenths and thirteenths. There are a number of other possible combinations eg 6/9 and suspended fourths or seconds. Altered intervals normally occur in dominant chords. The above list is not exhaustive, and the number of possible combinations is staggering. I suggest you try to solve one or two simpler problems and leave the more advanced stuff until you are ready for it. An ear trainer is perhaps one of the most difficult and complicated programming problems I have ever attempted myself. There are some reasonable apps out there, but what I have seen falls short of my expectations.
    1 point
  5. In AutoIt help file is found the functions DriveGetDrive and DriveSpaceTotal. #include <Array.au3> Local $Drive = DriveGetDrive('FIXED') _ArrayDisplay($Drive) Local $aDriveMax_Min[2][2] = [[$Drive[1], Round(DriveSpaceTotal($Drive[1]) / 1024, 3)], _ [$Drive[1], Round(DriveSpaceTotal($Drive[1]) / 1024, 3)]] ; $aDriveMax_Min[0][n]for Maximum; $aDriveMax_Min[1][n]for Minimum. For $i = 1 To UBound($Drive) - 1 ConsoleWrite($Drive[$i] & " " & Round(DriveSpaceTotal($Drive[$i]) / 1024, 3) & " GB" & @LF) If Round(DriveSpaceTotal($Drive[$i]) / 1024, 3) > $aDriveMax_Min[0][1] Then ; Max $aDriveMax_Min[0][1] = Round(DriveSpaceTotal($Drive[$i]) / 1024, 3) $aDriveMax_Min[0][0] = $Drive[$i] EndIf If Round(DriveSpaceTotal($Drive[$i]) / 1024, 3) < $aDriveMax_Min[1][1] Then ;Min $aDriveMax_Min[1][1] = Round(DriveSpaceTotal($Drive[$i]) / 1024, 3) $aDriveMax_Min[1][0] = $Drive[$i] EndIf Next MsgBox(0, "Results", "Largest Drive is " & StringUpper($aDriveMax_Min[0][0]) & " (" & $aDriveMax_Min[0][1] & "GB)" & @CRLF & _ "Smallest Drive is " & StringUpper($aDriveMax_Min[1][0]) & " (" & $aDriveMax_Min[1][1] & "GB)")
    1 point
  6. Hi, Your code is correct for the TCP part. Just one thing : Don't declare a variable in a continous loop otherwise it will be declared each time for nothing. And in your case I guess it's important as you will need efficiency. I doubt you can login to the stream like you did, is it a kind of htaccess ? Br, FireFox.
    1 point
  7. Sorry for triple posting here (I'm not trying to bump or anything I am really sorry I just don't know how to add this to anything else). I FINALLY FIGURED IT OUT Here's the dumb code that's been giving me a headache all day. Func bet() $dicegui = GUICreate("",200,100) GUISetFont(16,700,2,"Minion Pro") $rolling = GUICtrlCreateLabel("Rolling...",10,0) GUISetState() Sleep(2000) GUISetFont(16,700,2,"Minion Pro") $showroll = GUICtrlCreateLabel("You have rolled a:",10,0) $show = GUICtrlCreateLabel("",170,0,25,30) GUICtrlSetColor($show,0xB43D01) ;If $result = ;MsgBox(4096,"","hi") If GUICtrlRead($radiod2) = 1 Then $result = Random(1,2,1) GUICtrlSetData($show,$result) EndIf If GUICtrlRead($radiod4) = 1 Then $result = Random(1,4,1) GUICtrlSetData($show,$result) EndIf If GUICtrlRead($radiod6) = 1 Then $result = Random(1,6,1) GUICtrlSetData($show,$result) EndIf If GUICtrlRead($radiod8) = 1 Then $result = Random(1,8,1) GUICtrlSetData($show,$result) EndIf If GUICtrlRead($radiod10) = 1 Then $result = Random(1,10,1) GUICtrlSetData($show,$result) EndIf If GUICtrlRead($radiod12) = 1 Then $result = Random(1,12,1) GUICtrlSetData($show,$result) EndIf If GUICtrlRead($radiod14) = 1 Then $result = Random(1,14,1) GUICtrlSetData($show,$result) EndIf If GUICtrlRead($radiod16) = 1 Then $result = Random(1,16,1) GUICtrlSetData($show,$result) EndIf If GUICtrlRead($radiod18) = 1 Then $result = Random(1,18,1) GUICtrlSetData($show,$result) EndIf If GUICtrlRead($radiod20) = 1 Then $result = Random(1,20,1) GUICtrlSetData($show,$result) EndIf ;From here. If $2b1t = "1" Then If $result = "1" Then GUICtrlCreateLabel("Congratulations, You won!",0,50,200,50) EndIf EndIf ;To here. EndFunc All I had to freaking do was put the code (inside the ";From here" to ";To here") below all the other if statements and it works perfect now. I just have to repeat this process like 50 more times and then add in a system to buy ranks to be able to do bigger bets and use bigger dice . Thanks again Danyfirex
    1 point
  8. I have not gone ahead with the scripts by Bluesmaster. Instead I have moved most code from the start script to an UDF: WindowsExplorer.au3. This is the new start script (included in the zip): #include <GuiConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt( "MustDeclareVars", 1 ) ; Project includes #include "Resources\Include\WindowsExplorer.au3" ; Include this file #include "Resources\Include\ToolbarFunctions.au3" ; Edit this file to modify toolbar MainFunc() Func MainFunc() ; Create GUI Local $sTitle = "Windows Explorer right pane" Local $iStyle = BitOR( $GUI_SS_DEFAULT_GUI, $WS_CLIPCHILDREN, $WS_MAXIMIZEBOX, $WS_SIZEBOX ) Local $hGui = GUICreate( $sTitle, 700, 400, 200, 50, $iStyle ) ; Show GUI GUISetState( @SW_SHOW, $hGui ) ; Create toolbar ; CreateToolbar( $hGui, $bLargeIcons = False ) CreateToolbar( $hGui, True ) ; Create Explorer window ; CreateExplorerWindow( $hGui, $sFolder = @ScriptDir, $iView = $FVM_DETAILS ) ; $FVM_ICON = 1 ; The view should display medium-size icons. ; $FVM_SMALLICON = 2 ; The view should display small icons. ; $FVM_LIST = 3 ; Object names are displayed in a list view. ; $FVM_DETAILS = 4 ; Object names and other selected information, such as the size or date last updated, are shown. ; $FVM_THUMBNAIL = 5 ; The view should display thumbnail icons. ; $FVM_TILE = 6 ; The view should display large icons. ; $FVM_THUMBSTRIP = 7 ; The view should display icons in a filmstrip format. ;CreateExplorerWindow( $hGui, "C:\Windows", $FVM_ICON ) CreateExplorerWindow( $hGui ) ; Message loop Local $iMsg While 1 $iMsg = GUIGetMsg() If $iMsg = 0 Or $iMsg = $GUI_EVENT_MOUSEMOVE Then ContinueLoop Switch $iMsg Case $idToolbarClick, $idDropDownMenu, $idBackMenu, $idViewMenu ToolbarEvent( $iMsg ) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd EndFunc This code doesn't work on XP, and you need AutoIt 3.3.10.0+ (however, only a matter of a few includes). Let me know if there are any issues. Windows Explorer right pane.7z
    1 point
  9. Hi, unfortunately I cannot answer all questions. Viewtype is easy: DllStructSetData( $tFOLDERSETTINGS, "ViewMode", 1 ) ; 1 = medium 2 = small | 3 = list | 4 = details | 5 = thumbnail| 6 = large | 7 = filmstrip Renavigation must be done with ... $oIShellBrowser.BrowseObject( $pidlRel , 1 ) ; 0 = default user setting | 1 = open folders in same window | 2 = open folders in new window ...I think. But I dont know how to get the oIShellBrowser object I just got the pIShellBrowser This must solve the first question too through the 2. parameter if we get this to run ehm....LarsJ ? new more simplified code: #include "WinAPIEx.au3" global $hHook, $oIShellView, $hGui, $hExplorer HotKeySet("{ESC}", "_Exit") Func _Exit() _WinAPI_UnhookWindowsHookEx( $hHook ) $oIShellView = 0 Exit EndFunc explorerRightPane() While Sleep( 1000 ) WEnd Func explorerRightPane( $path = @ScriptDir , $x = 100 , $y = 100 , $width = 500 , $height = 500) ; 1 - CONSTANTS global $sIID_IServiceProvider = "{6D5140C1-7436-11CE-8034-00AA006009FA}" $dtag_IServiceProvider = "QueryService hresult(ptr;ptr;ptr*);" $tagMSG = "hwnd hwnd;uint message;wparam wParam;lparam lParam;dword time;int X;int Y" global $sIID_ICommDlgBrowser = "{000214F1-0000-0000-C000-000000000046}" $dtag_ICommDlgBrowser = "OnDefaultCommand hresult(ptr);OnStateChange hresult(ptr;ulong);IncludeObject hresult(ptr;ptr);" $dtag_IOleWindow = "GetWindow hresult(hwnd*);ContextSensitiveHelp hresult(int);" $sIID_IShellFolder = "{000214E6-0000-0000-C000-000000000046}" $tRIID_IShellFolder = _WinAPI_GUIDFromString( $sIID_IShellFolder ) $dtag_IShellFolder = "ParseDisplayName hresult(hwnd;ptr;wstr;ulong*;ptr*;ulong*);EnumObjects hresult(hwnd;dword;ptr*);BindToObject hresult(ptr;ptr;clsid;ptr*);BindToStorage hresult(ptr;ptr;clsid;ptr*);CompareIDs hresult(lparam;ptr;ptr);CreateViewObject hresult(hwnd;clsid;ptr*);GetAttributesOf hresult(uint;struct*;ulong*);GetUIObjectOf hresult(hwnd;uint;struct*;clsid;uint*;ptr*);GetDisplayNameOf hresult(ptr;dword;struct*);SetNameOf hresult(hwnd;ptr;wstr;dword;ptr*);" $sIID_IShellBrowser = "{000214E2-0000-0000-C000-000000000046}" $dtag_IShellBrowser = $dtag_IOleWindow &"InsertMenusSB hresult(handle;ptr);SetMenuSB hresult(handle;handle;hwnd);RemoveMenusSB hresult(handle);SetStatusTextSB hresult(ptr);EnableModelessSB hresult(int);TranslateAcceleratorSB hresult(ptr;word);BrowseObject hresult(ptr;uint);GetViewStateStream hresult(dword;ptr*);GetControlWindow hresult(uint;hwnd);SendControlMsg hresult(uint;uint;wparam;lparam;lresult);QueryActiveShellView hresult(ptr*);OnViewWindowActive hresult(ptr);SetToolbarItems hresult(ptr;uint;uint);" $sIID_IShellView = "{000214E3-0000-0000-C000-000000000046}" $tRIID_IShellView = _WinAPI_GUIDFromString( $sIID_IShellView ) $dtag_IShellView = $dtag_IOleWindow & "TranslateAccelerator hresult(ptr);EnableModeless hresult(int);UIActivate hresult(uint);Refresh hresult();CreateViewWindow hresult(ptr;ptr;ptr;ptr;hwnd*);DestroyViewWindow hresult();GetCurrentInfo hresult(ptr*);AddPropertySheetPages hresult(dword;ptr;lparam);SaveViewState hresult();SelectItem hresult(ptr;uint);GetItemObject hresult(uint;struct*;ptr*);" $tagFOLDERSETTINGS = "uint ViewMode;uint fFlags" DllCall("ole32.dll", "long", "OleInitialize", "ptr", 0) ; 2 - GUI ( Wrapper ) $hGui = GUICreate( "" , $width, $height, $x, $y) ; $WS_POPUP = 0x80000000 GUISetState( @SW_SHOW, $hGui ) Local $hMessageFilter ; , $hHook ; Catch window messages $hMessageFilter = DllCallbackRegister( "boxCallbacks", "long", "int;wparam;lparam" ) $hHook = _WinAPI_SetWindowsHookEx( $WH_GETMESSAGE , DllCallbackGetPtr( $hMessageFilter ) , 0 , _WinAPI_GetCurrentThreadId() ) ; 3 - START DIR + SIZE Local $pDesktopFolder $aRet = DllCall( "shell32.dll", "uint", "SHGetDesktopFolder", "ptr*", 0 ) $pDesktopFolder = $aRet[1] $oIDesktopFolder = ObjCreateInterface( $pDesktopFolder, $sIID_IShellFolder, $dtag_IShellFolder ) ; $oIDesktopFolder is used in oIShellBrowser_BrowseObject because the PIDLs are absolute PIDLs. This means that they are relative to the Desktop (and not the parent folder). Local $pParentFolder, $pidlRel, $pFolder $pPidlHome = DllCall( "shell32.dll", "ptr", "ILCreateFromPathW", "wstr", $path )[0] $aRet = DllCall( "shell32.dll", "long", "SHBindToParent", "ptr", $pPidlHome, "ptr", DllStructGetPtr( $tRIID_IShellFolder ), "ptr*", 0, "ptr*", 0 ) $pParentFolder = $aRet[3] $pidlRel = $aRet[4] $oIShellFolder = ObjCreateInterface( $pParentFolder, $sIID_IShellFolder, $dtag_IShellFolder ) ; Parent folder $oIShellFolder.BindToObject( $pidlRel, 0x00000000 , $tRIID_IShellFolder, $pFolder ) ; $NULL = 0x00000000 $oIShellFolder = ObjCreateInterface( $pFolder, $sIID_IShellFolder, $dtag_IShellFolder ) ; @ScriptDir $aPos = WinGetClientSize( $hGui ) $tRECT = DllStructCreate( $tagRECT ) DllStructSetData( $tRECT , "Left" , 0 ) DllStructSetData( $tRECT , "Top" , 0 ) DllStructSetData( $tRECT , "Right" , $aPos[0] ) DllStructSetData( $tRECT , "Bottom" , $aPos[1] ) ; 4 - SHELL BROWSER Local $pShellView $oIShellFolder.CreateViewObject( $hGui, $tRIID_IShellView, $pShellView ) $oIShellView = ObjCreateInterface( $pShellView, $sIID_IShellView, $dtag_IShellView ) $dtag_IShellBrowser = "QueryInterface hresult(ptr;ptr*);AddRef ulong();Release ulong();" & $dtag_IShellBrowser ; Inherits from IUnknown $pIShellBrowser = DllCall('ole32.dll', 'ptr', 'CoTaskMemAlloc', 'uint_ptr', 152 )[0] ; $AllocSize = $PtrSize * (18 + 1) = 8 * 19 = 152 $tInterface = DllStructCreate( "ptr[" & 18 + 1 & "]", $pIShellBrowser ) DllStructSetData( $tInterface , 1, DllCallbackGetPtr( DllCallbackRegister( "oIShellBrowser_QueryInterface" , "long" , "ptr;ptr;ptr*" )) , 2 ) DllStructSetData( $tInterface , 1, DllCallbackGetPtr(DllCallbackRegister( "oIShellBrowser_AddRef" , "ulong" , "ptr" )) , 3 ) DllStructSetData( $tInterface , 1, DllCallbackGetPtr(DllCallbackRegister( "oIShellBrowser_Release" , "ulong" , "ptr" )) , 4 ) DllStructSetData( $tInterface , 1, DllCallbackGetPtr(DllCallbackRegister( "oIShellBrowser_GetWindow" , "long" , "ptr;hwnd*" )) , 5 ) DllStructSetData( $tInterface , 1, DllCallbackGetPtr( DllCallbackRegister( "oIShellBrowser_InsertMenusSB" , "long" , "ptr;handle;ptr" )) , 7 ) DllStructSetData( $tInterface , 1, DllCallbackGetPtr(DllCallbackRegister( "oIShellBrowser_SetMenuSB" , "long" , "ptr;handle;handle;hwnd" )) , 8 ) DllStructSetData( $tInterface , 1, DllCallbackGetPtr(DllCallbackRegister( "oIShellBrowser_RemoveMenusSB" , "long" , "ptr;handle" )) , 9 ) DllStructSetData( $tInterface , 1, DllCallbackGetPtr(DllCallbackRegister( "oIShellBrowser_BrowseObject" , "long" , "ptr;ptr;uint" )) , 13 ) DllStructSetData( $tInterface , 1, DllCallbackGetPtr(DllCallbackRegister( "oIShellBrowser_GetControlWindow" , "long" , "ptr;uint;hwnd" )) , 15 ) DllStructSetData( $tInterface , 1, DllCallbackGetPtr(DllCallbackRegister( "oIShellBrowser_OnViewWindowActive" , "long" , "ptr;ptr" )) , 18 ) DllStructSetData( $tInterface , 1 , $pIShellBrowser + 8 ) ; Interface method pointers are actually pointer size away ; 5 - WINDOW $tFOLDERSETTINGS = DllStructCreate( $tagFOLDERSETTINGS ) DllStructSetData( $tFOLDERSETTINGS, "ViewMode", 1 ) ; 1 = medium 2 = small | 3 = list | 4 = details | 5 = thumbnail| 6 = large | 7 = filmstrip DllStructSetData( $tFOLDERSETTINGS, "fFlags" , 0x00800000 ) ;$FWF_NOCOLUMNHEADER = 0x00800000 > sorgt auch für frei verschiebbare Elemente $hViewWindow = $oIShellView.CreateViewWindow( 0x00000000 , DllStructGetPtr( $tFOLDERSETTINGS ), $pIShellBrowser, DllStructGetPtr( $tRECT ), $hExplorer ) ; $NULL = 0x00000000 ConsoleWrite( $hViewWindow ) $oIShellView.UIActivate( 1 ) ; $SVUIA_ACTIVATE_NOFOCUS = 1 ; 6 - REBROWSE (experiments, no success so far) Sleep( 2000 ) ;~ Local $pParentFolder, $pidlRel, $pFolder ;~ $pPidlHome = DllCall( "shell32.dll", "ptr", "ILCreateFromPathW", "wstr", "c:\" )[0] ;~ $aRet = DllCall( "shell32.dll", "long", "SHBindToParent", "ptr", $pPidlHome, "ptr", DllStructGetPtr( $tRIID_IShellFolder ), "ptr*", 0, "ptr*", 0 ) ;~ $pParentFolder = $aRet[3] ;~ $pidlRel = $aRet[4] ;~ $oIShellFolder = ObjCreateInterface( $pParentFolder, $sIID_IShellFolder, $dtag_IShellFolder ) ; Parent folder ;~ $oIShellFolder.BindToObject( $pidlRel, 0x00000000 , $tRIID_IShellFolder, $pFolder ) ; $NULL = 0x00000000 ; http://msdn.microsoft.com/en-us/library/windows/desktop/bb775113(v=vs.85).aspx ;~ $oIShellFolder = ObjCreateInterface( $pIShellBrowser, $sIID_IShellBrowser , $dtag_IShellBrowser ) ; Parent folder ;~ $oIShellBrowser.BrowseObject( $pidlRel , 1 ) ; 0 = default user setting | 1 = open folders in same window | 2 = open folders in new window ;~ Global Const $SBSP_DEFBROWSER = 0x0000 ; Use default behavior, which respects the view option (the user setting to create new windows or to browse in place). In most cases, calling applications should use this flag. ;~ Global Const $SBSP_SAMEBROWSER = 0x0001 ; Browse to another folder with the same Windows Explorer window. ;~ Global Const $SBSP_NEWBROWSER = 0x0002 ; Creates another window for the specified folder. EndFunc ; CALLBACKS (IShellBrowser) Func oIShellBrowser_GetWindow( $pSelf, $hExplorer ) DllStructSetData( DllStructCreate( "hwnd", $hExplorer ) , 1 , $hGui ) ; belege den DLL-Struct mit dem zugehörigen windowhandle ( $hExplorer ist der Pointer der auf dass DLL struct zeigen muss ) EndFunc Func oIShellBrowser_QueryInterface( $pSelf, $pRIID, $pObj ) Return 0x80004002 ; $E_NOINTERFACE = 0x80004002 EndFunc Func oIShellBrowser_AddRef( $pSelf ) EndFunc Func oIShellBrowser_Release( $pSelf ) EndFunc Func oIShellBrowser_InsertMenusSB( $pSelf, $hmenuShared, $lpMenuWidths ) EndFunc Func oIShellBrowser_GetControlWindow( $pSelf, $id, $lphwnd ) EndFunc Func oIShellBrowser_OnViewWindowActive( $pSelf, $ppshv ) EndFunc Func oIShellBrowser_SetMenuSB( $pSelf, $hmenuShared, $holemenuRes, $hwndActiveObject ) EndFunc Func oIShellBrowser_RemoveMenusSB( $pSelf, $hmenuShared ) EndFunc Func oIShellBrowser_BrowseObject( $pidl, $wFlags ) EndFunc
    1 point
×
×
  • Create New...