Leaderboard
Popular Content
Showing content with the highest reputation on 02/19/2017 in all areas
-
Slightly modified version from Chimp's code: #include <GDIPlus.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() ; declare parameters to set the dashed rectangle; (out of screen and hidden at startup) Global $show = 0, $xPosition = @DesktopWidth, $yPosition = @DesktopHeight, $Width = 10, $Height = 10 Global $RectColor = 0xFFFF0000 ; FFRRGGBB Global $PixelThickness = 4 DashEdge() ; initialize the rectangle AdlibRegister("DashEdge", 100) ; set the refresh rate ; Your scipt here.... Local $Timer = TimerInit() Do ; ... when you need a dotted rectangle somewhere on the screen ; just set the following variables accordingly ... ; ; here we use random values $show = 1 $xPosition = Random(10, 600, 1) $yPosition = Random(10, 600, 1) $Width = Random(200, 500, 1) $Height = Random(150, 400, 1) $RectColor = Random(0, 16777215, 1) + 4278190080 ; 0xFF000000 to 0xFFFFFFFF Sleep(1500) Until TimerDiff($Timer) >= 10000 ; show demo for ten seconds ; The end $show = -1 ; set -1 to dispose all DashEdge() ; Clean up GDI+ resources Func DashEdge() ; following static variables are generated and initialized only the first time this function is called Local Static $AlphaKey = 0xFF0FF0FF ; this color will set background transparent (can be changed) Local Static $hGUI = GUICreate("", $Width, $Height, $xPosition, $yPosition, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST + $WS_EX_TRANSPARENT) Local Static $Dummy = _WinAPI_SetLayeredWindowAttributes($hGUI, $AlphaKey, 0, $LWA_COLORKEY) Local Static $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) Local Static $hPen = _GDIPlus_PenCreate($RectColor, $PixelThickness) Local Static $fOffset = 0 _GDIPlus_PenSetDashStyle($hPen, $GDIP_DASHSTYLEDOT) _GDIPlus_PenSetColor($hPen, $RectColor) DllCall($__g_hGDIPDll, "int", "GdipSetPenDashOffset", "handle", $hPen, "float", $fOffset) ;this is the key for the animated dotted line ;-) Local $aWinPos = WinGetPos($hGUI) ; check if we need to move the rectangle If $aWinPos[0] <> $xPosition Or $aWinPos[1] <> $yPosition Or $aWinPos[2] <> $Width Or $aWinPos[3] <> $Height Then _GDIPlus_GraphicsDispose($hGraphic) WinMove($hGUI, "", $xPosition, $yPosition, $Width, $Height) $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) EndIf ; show or hide dashes as from the $show variable If $show = 1 Then GUISetState(@SW_SHOW, $hGUI) If $show = 0 Then GUISetState(@SW_HIDE, $hGUI) _GDIPlus_GraphicsClear($hGraphic, $AlphaKey) ; erase rect _GDIPlus_GraphicsDrawRect($hGraphic, 0, 0, $Width, $Height, $hPen) ; draw again $fOffset += 0.5 If $show = -1 Then ; we have to stop? AdlibUnRegister("DashEdge") _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() WinKill($hGUI) EndIf EndFunc ;==>DashEdge2 points
-
Hey autoit scripters! So I don't know about the rest of you, but I have to deal with a very annoying ticketing system where I work, which it makes it hard to keep track of the times that I work on specific tickets. Most of the time, I spend a good portion of my time, rather than actually working the tickets, mulling over the tickets I have done and trying to guesstimate how much time I spent on each task, which end up inaccurate as all hell, but that is for management to deal with. However, to make it easier on me, (and I really dont give a crap if it's against corporate policy management) I wrote the below script which is meant to be a much more efficient method of keeping track of time: type a summary of the task, press the button, clock starts, press it again, clock stops, task is recorded in list view. Edit: found the error I was looking for concerning exported PDF. Fixed. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=time-management-clock-small.ico #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_Language=1033 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.15.0 (Beta) Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <Excel.au3> #include <GuiListView.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiEdit.au3> #include <Constants.au3> #include <Misc.au3> Global $count = 0 $Form1 = GUICreate("Time Tracker", 405, 429, 192, 124) $Label1 = GUICtrlCreateLabel("Time Tracker", 142, 8, 120, 29) GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif") $Label4 = GUICtrlCreateLabel(" 00:00:00", 72, 40, 244, 84) GUICtrlSetFont(-1, 50, 400, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Project/ticket working on", 87, 90, 214, 29) GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif") $Input1 = GUICtrlCreateInput("", 96, 130, 201, 21) $Label3 = GUICtrlCreateLabel("All time entries", 120, 162, 130, 29) GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif") $ListView1 = GUICtrlCreateListView("Task|Start Time|End time|Total Time", 8, 194, 385, 175) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 150) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 73) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 73) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 73) $Button1 = GUICtrlCreateButton("Start Timer", 24, 376, 89, 41, $BS_NOTIFY) GUICtrlSetCursor(-1, 0) $Button2 = GUICtrlCreateButton("Export to file", 152, 376, 89, 41, $BS_NOTIFY) GUICtrlSetCursor(-1, 0) $Button3 = GUICtrlCreateButton("Cancel", 280, 376, 81, 41, $BS_NOTIFY) GUICtrlSetCursor(-1, 0) $dummy = GUICtrlCreateDummy () GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $x = Int(Stopwatch() / 100) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE If _GUICtrlListView_GetItemCount ( $ListView1 ) > 0 Then If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox($MB_YESNO + $MB_ICONQUESTION + $MB_SYSTEMMODAL,"Save info?","Do you want to save your time entries?") Select Case $iMsgBoxAnswer = $IDYES $exfile2 = FileSaveDialog ( "Name of exported document.", "", "Excel document (*.xlsx)", 18, "", $Form1 ) If $exfile2 = "" Then Else $num2 = _GUICtrlListView_GetItemCount ( $ListView1 ) Local $array2[$num2 + 1][4] $array2[0][0] = "Task" $array2[0][1] = "Start Time" $array2[0][2] = "End Time" $array2[0][3] = "Total Time" For $y = 0 To $num2 - 1 Step 1 $listarray2 = _GUICtrlListView_GetItemTextArray ( $ListView1, $y ) $array2[$y + 1][0] = $listarray2[1] $array2[$y + 1][1] = $listarray2[2] $array2[$y + 1][2] = $listarray2[3] $array2[$y + 1][3] = $listarray2[4] Next $oExcel2 = _Excel_Open () $oWorksheet2 = _Excel_BookNew ( $oExcel2 ) _Excel_RangeWrite ( $oWorksheet2, Default, $array2 ) _Excel_BookSaveAs ( $oWorksheet2, $exfile2 ) _Excel_Close ( $oExcel2 ) EndIf Case $iMsgBoxAnswer = $IDNO Exit EndSelect Else Exit EndIf Case $Form1 ToolTip ("") Case $Input1 If _IsPressed ( "0D" ) Then ToolTip ("") Stopwatch() If @extended = 1 Then If GUICtrlRead($Input1) = "" Then $sToolTipAnswer = ToolTip("You need to specify the task in order to catalog the time.", Default, Default, "Enter task") Else Starttime(@HOUR, @MIN) GUICtrlSetState ( $Button2, $GUI_DISABLE ) GUICtrlSetData ( $Input1, "" ) GUICtrlSetData ( $Button1, "Stop Timer" ) GUICtrlSetState ( $Input1, $GUI_DISABLE ) GUICtrlSetState ( $Button3, $GUI_DISABLE ) Stopwatch(1) EndIf EndIf EndIf Case $Button1 ToolTip ("") Stopwatch() $store = @extended If $store = 1 Then If GUICtrlRead($Input1) = "" Then $sToolTipAnswer = ToolTip("You need to specify the task in order to catalog the time.", Default, Default, "Enter task") Else Starttime(@HOUR, @MIN) GUICtrlSetData ( $Button1, "Stop Timer" ) GUICtrlSetState ( $Button2, $GUI_DISABLE ) GUICtrlSetData ( $Input1, "" ) GUICtrlSetState ( $Input1, $GUI_DISABLE ) GUICtrlSetState ( $Button3, $GUI_DISABLE ) Stopwatch ( 1 ) EndIf Else Endtime ( @HOUR, @MIN ) GUICtrlSetData ( $Button1, "Start Timer" ) GUICtrlSetState ( $Button2, $GUI_ENABLE ) GUICtrlSetState ( $Button3, $GUI_ENABLE ) GUICtrlSetState ( $Input1, $GUI_ENABLE ) Stopwatch ( 2 ) EndIf Case $Button2 $exfile = FileSaveDialog ( "Name of exported document.", "", "PDF file (*.pdf)", 18, "", $Form1 ) If $exfile = "" Then Else $excel = StringTrimRight ( $exfile, 3 ) & "xlsx" $num = _GUICtrlListView_GetItemCount ( $ListView1 ) Local $array[$num + 1][4] $array[0][0] = "Task" $array[0][1] = "Start Time" $array[0][2] = "End Time" $array[0][3] = "Total Time" For $y = 0 To $num - 1 Step 1 $listarray = _GUICtrlListView_GetItemTextArray ( $ListView1, $y ) $array[$y + 1][0] = $listarray[1] $array[$y + 1][1] = $listarray[2] $array[$y + 1][2] = $listarray[3] $array[$y + 1][3] = $listarray[4] Next $oExcel = _Excel_Open () $oWorksheet = _Excel_BookNew ( $oExcel ) _Excel_RangeWrite ( $oWorksheet, Default, $array ) _Excel_BookSaveAs ( $oWorksheet, $excel ) _Excel_Export ( $oExcel, $oWorksheet, $exfile, Default, Default, Default, Default, Default, True ) _Excel_Close ( $oExcel ) EndIf Case $Button3 If _GUICtrlListView_GetItemCount ( $ListView1 ) > 0 Then If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox($MB_YESNO + $MB_ICONQUESTION + $MB_SYSTEMMODAL,"Save info?","Do you want to save your time entries?") Select Case $iMsgBoxAnswer = $IDYES $exfile2 = FileSaveDialog ( "Name of exported document.", "", "Excel document (*.xlsx)", 18, "", $Form1 ) If $exfile2 = "" Then Else $num2 = _GUICtrlListView_GetItemCount ( $ListView1 ) Local $array2[$num2 + 1][4] $array2[0][0] = "Task" $array2[0][1] = "Start Time" $array2[0][2] = "End Time" $array2[0][3] = "Total Time" For $y = 0 To $num2 - 1 Step 1 $listarray2 = _GUICtrlListView_GetItemTextArray ( $ListView1, $y ) $array2[$y + 1][0] = $listarray2[1] $array2[$y + 1][1] = $listarray2[2] $array2[$y + 1][2] = $listarray2[3] $array2[$y + 1][3] = $listarray2[4] Next $oExcel2 = _Excel_Open () $oWorksheet2 = _Excel_BookNew ( $oExcel2 ) _Excel_RangeWrite ( $oWorksheet2, Default, $array2 ) _Excel_BookSaveAs ( $oWorksheet2, $exfile2 ) _Excel_Close ( $oExcel2 ) EndIf Case $iMsgBoxAnswer = $IDNO Exit EndSelect Else Exit EndIf EndSwitch If $x <> Int(Stopwatch() / 100) Then $totsec = Int(Stopwatch() / 1000) ; ms to sec $hr = Int($totsec / 3600) ; hours $mn = Int(($totsec - ($hr * 3600)) / 60) ; minutes $sc = Int(($totsec - ($hr * 3600) - ($mn * 60))) ; seconds $tn = Int((Int(Stopwatch() / 100) - ($hr * 36000) - ($mn * 600) - ($sc * 10))) ; tenths of a second GUICtrlSetData($Label4, " " & StringFormat("%02s", $hr) & ":" & StringFormat("%02s", $mn) & ":" & StringFormat("%02s", $sc) & "." & StringFormat("%01s", $tn)) If $mn >= 15 Then GUICtrlSetColor ( $Label4, 0xFF0000 ) Else GUICtrlSetColor ( $Label4, 0x000000 ) EndIf EndIf WEnd Func Stopwatch($ToggleTo = 4) Static Local $Paused = True Static Local $Stopwatch = 0 Static Local $TotalTime = 0 Switch $ToggleTo Case 0 ; pause counter If $Paused Then SetExtended($Paused) ; $Paused status Return $TotalTime ; already paused, just return current $TotalTime Else $TotalTime += TimerDiff($Stopwatch) $Paused = True SetExtended($Paused) Return $TotalTime EndIf Case 1 ; unpause counter If $Paused Then $Stopwatch = TimerInit() $Paused = False SetExtended($Paused) Return $TotalTime Else SetExtended($Paused) Return $TotalTime + TimerDiff($Stopwatch) EndIf Case 2 ; reset to 0 and pause $Paused = True $TotalTime = 0 SetExtended($Paused) Return $TotalTime Case 3 ; reset to 0 and restart $Paused = False $TotalTime = 0 $Stopwatch = TimerInit() SetExtended($Paused) Return $TotalTime Case 4 ; return status SetExtended($Paused) If $Paused Then Return $TotalTime Else Return $TotalTime + TimerDiff($Stopwatch) EndIf EndSwitch EndFunc ;==>Stopwatch Func Starttime($hour, $min) $pm = False $tm = "" If Int($hour) >= 12 Then $pm = True $tm = " PM" If Int($hour) > 12 Then $hour = Int($hour) - 12 EndIf Else $pm = False $tm = " AM" If Int($hour) = 0 Then $hour = Int($hour) + 12 EndIf EndIf GUICtrlCreateListViewItem(GUICtrlRead($Input1) & "|" & $hour & ":" & $min & $tm, $ListView1) EndFunc ;==>Starttime Func Endtime($hour2, $min2) $pm2 = False $tm2 = "" If Int($hour2) >= 12 Then $pm2 = True $tm2 = " PM" If Int($hour2) > 12 Then $hour2 = Int($hour2) - 12 EndIf Else $pm2 = False $tm2 = " AM" If Int($hour2) = 0 Then $hour2 = Int($hour2) + 12 EndIf EndIf $time = Int ( Round ( Stopwatch () ) ) / 1000 $hr2 = Int($time / 3600) ; hours $mn2 = Int(($time - ($hr2 * 3600)) / 60) ; minutes $sc2 = Int(($time - ($hr2 * 3600) - ($mn2 * 60))) ; seconds _GUICtrlListView_AddSubItem($ListView1, $count, $hour2 & ":" & $min2 & $tm2, 2) _GUICtrlListView_AddSubItem($ListView1, $count, StringFormat("%02s", $hr2) & ":" & StringFormat("%02s", $mn2) & ":" & StringFormat("%02s", $sc2), 3) $count += 1 EndFunc ;==>Endtime1 point
-
aa2zz6, And I entirely agree with this sentiment. But please choose terms which are not so game-related in future - could I suggest that using the names of fruit or cartoon characters would be less likely to attract attention. M231 point
-
#include <Array.au3> #include <MsgBoxConstants.au3> Global $aDisplay[0][2] MsgBox($MB_SYSTEMMODAL, 'Results', 'Found ' & read("Search") & ' Matches.') _ArrayDisplay($aDisplay) Func read($sSearch) Local Const $hostfile = @ScriptDir & "\" & "Final_List.ini" Local $iCount = 0 $Readvar = IniReadSection($hostfile, "Scanner") ;---------------------------------------------------------------------------------------- ; Read ini ;---------------------------------------------------------------------------------------- If Not @error Then For $i = 2 To $Readvar[0][0] If StringInStr($Readvar[$i][1], $sSearch) Then _ArrayAdd($aDisplay, $Readvar[$i][0] & '|' & $Readvar[$i][1]) $iCount += 1 MsgBox($MB_SYSTEMMODAL, "Results", "Found a match.", 1) Else MsgBox($MB_SYSTEMMODAL, "Results", "Match not found.", 1) ;ExitLoop EndIf Next Return $iCount EndIf Return $iCount EndFunc ;==>read1 point
-
MattHiggs, Very nice - some interesting code here thanks for showing your example script. Jury1 point
-
@Chimp - that could be done this way: Local Static $fOffset = 0 _GDIPlus_PenSetColor($hPen, $RectColor) Local $iCount = 4, $tArray = DllStructCreate("float;float;float;float") DllStructSetData($tArray, 1, 5.0) ;dash length DllStructSetData($tArray, 2, 2.0) ;space length DllStructSetData($tArray, 3, 15.0) ;dash length DllStructSetData($tArray, 4, 4.0) ;space length DllCall($__g_hGDIPDll, "int", "GdipSetPenDashArray", "handle", $hPen, "struct*", $tArray, "long", $iCount) ;This method will set the DashStyle enumeration for this Pen object to DashStyleCustom. DllCall($__g_hGDIPDll, "int", "GdipSetPenDashOffset", "handle", $hPen, "float", $fOffset) ;this is the key for the animated dotted line ;-)1 point
-
Run/ShellExecute windows folder locations
AnonymousX reacted to benners for a topic
I created a function to do something similar a while ago. You may be able to adapt for your needs. #include <WinAPIShellEx.au3> #include <WinAPI.au3> Local $s_FilePath = _Win7_GetKnownFolder('PicturesLibrary') if @error Then MsgBox(0,'DOH!', $s_FilePath) Else MsgBox(0,'Yay Found', 'Path: '& $s_FilePath & @crlf & 'File Exists: ' & FileExists($s_FilePath)) EndIf ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Win7_GetKnownFolder ; Description ...: Retrieves the full path of a known folder ; Syntax ........: _Win7_GetKnownFolder($s_Folder) ; Parameters ....: $s_Folder - A string value denoting the known folder ; Return values .: Success - Returns the full folder path ; Failure - Sets @error to 1 and returns a string for logging ; Remarks .......: Only for Windows Vista and above ; Related .......: _XP_GetSpecialFolder (for XP and lower) ; Link ..........: link http://msdn.microsoft.com/en-us/library/dd378457.aspx ; Example .......: _Win7_GetKnownFolder('CommonPrograms') ; =============================================================================================================================== Func _Win7_GetKnownFolder($s_Folder) ; trimmed list of KnownFolder constants Local $s_Constants = 'CommonPrograms|' & _ ;%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs 'CommonStartMenu|' & _ ; %ALLUSERSPROFILE%\Microsoft\Windows\Start Menu 'CommonStartup|' & _ ; %ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\StartUp 'CommonTemplates|' & _ ; %ALLUSERSPROFILE%\Microsoft\Windows\Templates 'Desktop|' & _ ; %USERPROFILE%\Desktop 'Documents|' & _ ; %USERPROFILE%\Documents 'DocumentsLibrary|' & _ ; %APPDATA%\Microsoft\Windows\Libraries\Documents.library-ms 'Favorites|' & _ ; %USERPROFILE%\Favorites 'Fonts|' & _ ; %windir%\Fonts 'Libraries|' & _ ; %APPDATA%\Microsoft\Windows\Libraries 'LocalAppData|' & _ ; %LOCALAPPDATA% (%USERPROFILE%\AppData\Local) 'LocalAppDataLow|' & _ ; %USERPROFILE%\AppData\LocalLow 'Music|' & _ ; %USERPROFILE%\Music 'MusicLibrary|' & _ ; %APPDATA%\Microsoft\Windows\Libraries\Music.library-ms 'PhotoAlbums|' & _ ; %USERPROFILE%\Pictures\Slide Shows 'PicturesLibrary|' & _ ; %APPDATA%\Microsoft\Windows\Libraries\Pictures.library-ms 'Pictures|' & _ ; %USERPROFILE%\Pictures 'Playlists|' & _ ; %USERPROFILE%\Music\Playlists 'Profile|' & _ ; %USERPROFILE% (%SystemDrive%\Users\%USERNAME%) 'ProgramData|' & _ ; %ALLUSERSPROFILE% (%ProgramData%, %SystemDrive%\ProgramData) 'ProgramFiles|' & _ ; %ProgramFiles% (%SystemDrive%\Program Files) 'ProgramFilesX64|' & _ ; %ProgramFiles% (%SystemDrive%\Program Files) 'ProgramFilesX86|' & _ ; %ProgramFiles% (%SystemDrive%\Program Files) 'ProgramFilesCommon|' & _ ; %ProgramFiles%\Common Files 'ProgramFilesCommonX64|' & _ ; %ProgramFiles%\Common Files 'ProgramFilesCommonX86|' & _ ; %ProgramFiles%\Common Files 'Programs|' & _ ; %APPDATA%\Microsoft\Windows\Start Menu\Programs 'Public|' & _ ; %PUBLIC% (%SystemDrive%\Users\Public) 'PublicDesktop|' & _ ; %PUBLIC%\Desktop 'PublicDocuments|' & _ ; %PUBLIC%\Documents 'PublicLibraries|' & _ ; %ALLUSERSPROFILE%\Microsoft\Windows\Libraries 'PublicMusic|' & _ ; %PUBLIC%\Music 'PublicPictures|' & _ ; %PUBLIC%\Pictures 'PublicVideos|' & _ ; %PUBLIC%\Videos 'QuickLaunch|' & _ ; %APPDATA%\Microsoft\Internet Explorer\Quick Launch 'ResourceDir|' & _ ; %windir%\Resources 'RoamingAppData|' & _ ; %APPDATA% (%USERPROFILE%\AppData\Roaming) 'SendTo|' & _ ; %APPDATA%\Microsoft\Windows\SendTo 'StartMenu|' & _ ; %APPDATA%\Microsoft\Windows\Start Menu 'Startup|' & _ ; %APPDATA%\Microsoft\Windows\Start Menu\Programs\StartUp 'System|' & _ ; %windir%\system32 'SystemX86|' & _ ; %windir%\system32 'Templates|' & _ ; %APPDATA%\Microsoft\Windows\Templates 'UserPinned|' & _ ; %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned 'UserProfiles|' & _ ; %SystemDrive%\Users 'UserProgramFiles|' & _ ; %LOCALAPPDATA%\Programs 'UserProgramFilesCommon|' & _ ; %LOCALAPPDATA%\Programs\Common 'Videos|' & _ ; %USERPROFILE%\Videos 'VideosLibrary|' & _ ; %APPDATA%\Microsoft\Windows\Libraries\Videos.library-ms 'Windows' ; %windir% ; check the passed folder name is listed If Not _String_SearchForWords($s_Constants, $s_Folder) Then Return SetError(1, 0, '"' & $s_Folder & '" ' & ' is not listed in the Known Folder list') ; return the value of the variable Local $s_GUID = Eval('FOLDERID_' & $s_Folder) ; get the known folder path Local $s_FolderPath = _WinAPI_ShellGetKnownFolderPath($s_GUID) If @error Then Return SetError(@error, @extended, _WinAPI_GetLastErrorMessage()) Return $s_FolderPath EndFunc ;==>_Win7_GetKnownFolder ; #FUNCTION# ==================================================================================================================== ; Name ..........: _String_SearchForWords ; Description ...: Search for the existance of multiple words in a given string ; Syntax ........: _String_SearchForWords($sCallingFunc, $sTest, $sSearch) ; Parameters ....: $sTest - The string to run the check against ; $sSearch - The string(s) to search for ; Return values .: Success - Returns 0 - No Match ; 1 - Match ; Failure - Sets @error to 1 and logs an error message ; Example .......: MsgBox(0,'', _String_SearchForWords('', 'batcave1,batcave2,xbmc,benneraswell', 'batcave')) ; =============================================================================================================================== Func _String_SearchForWords($sTest, $sSearch) Local $sRunningFunc = '_String_SearchForWords' Local $sPattern = '(?i)^(?=.*\b' & StringReplace($sSearch, '|', '\b)(?=.*\b') & '\b)' Local $iRet = StringRegExp($sTest, $sPattern) If @error Then Return SetError(@error, @extended, '') Return $iRet EndFunc ;==>_String_SearchForWords Or probably better for you Local $s_FileName = FileSelectFolder('Please Select The Folder...', '', 3, "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}") If Not @error Then ; get the folder name of any special folders If StringInStr($s_FileName, '::{') Then $s_DisplayName = SpecialFolders_GetSelfName($s_FileName) $s_FileName = SpecialFolder_ReturnPath($s_FileName) EndIf MsgBox(0,'', $s_FileName) ; check fileexists EndIf Func SpecialFolder_ReturnPath($s_Path) Local $s_Lnk = @TempDir & '\FileName.lnk' ; creste a shortcut for the path If Not FileCreateShortcut($s_Path, $s_Lnk) Then Return $s_Path ; read the shortcuts property to an array Local $a_Shortcut = FileGetShortcut($s_Lnk) If @error Then Return $s_Path FileDelete($s_Lnk) ; get the shortcut target path If IsArray($a_Shortcut) Then Return $a_Shortcut[0] Return $s_Path EndFunc ;==>SpecialFolder_ReturnPath Func SpecialFolders_GetSelfName($s_Path) Local $objShell = ObjCreate("Shell.Application") If Not IsObj($objShell) Then Return '' Return $objShell.NameSpace($s_Path).Self.Name EndFunc ;==>SpecialFolders_GetSelfName1 point -
Thank you very much! It works for my application! Run(@ComSpec & ' /c start "" "shell:Appsfolder\Microsoft.Messaging_8wekyb3d8bbwe!x27e26f40ye031y48a6yb130yd1f20388991ax"', '', @SW_HIDE) - Hit Win-R to open a "Run" input, and type "shell:Appsfolder" - When in that, hit F-10 to get a menu bar, and from that menu bar select "View / Choose Details" - Select the radio box for "AppUserModelID". That ID is what you are going to want to execute. - Select "Details" from the little "View" gadget" on the right hand side. "shell:Appsfolder\"+AppUserModelID found in the right column1 point
-
Submitting a form that requires an OnClick
BrianTheLibrarian reacted to Subz for a topic
Use StringStripWs with flag 7 around $tag.innertext should work, as you have a @lf in the name i.e. <br>.1 point