Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/26/2013 in all areas

  1. Ascend4nt

    _RunWithReducedPrivileges

    _RunWithReducedPrivileges An odd thing about Vista+ O/S's is that, once you run a process in elevated privileges mode, you can't run other processes in lower-privileged modes. Why, you ask, would that be important? Sometimes you want - or need - to limit the privileges of a process: A very common scenario for me is drag-and-drop. Windows' Explorer does NOT allow this to occur between lower privileged processes (like Explorer itself!) and other processes. This is very frustrating for users in programs that take advantage of that. There's also some problems using certain SendMessage commands from other unelevated processes.Setting the state or properties of windows that have an elevated privilege may not work either from other unelevated processes..An install or setup program that needs to launch the installed program will more often than not want to run that program on a lower privilege level (for some of the reasons mentioned above)So, after some looking around I found a way of running processes under a lower privilege mode.Check Elmue's comment 'Here the cleaned and bugfixed code' on this CodeProject page to see where my code was ported from:'Creating a process with Medium Integration Level from the process with High Integration Level in Vista' The usage is straightforward for this one: use it like Run/RunWait, but with the command-line as the 2nd parameter. [i.e. _RunWithReducedPrivileges(@ComSpec,' /k title Non-Admin prompt') ] Anyway, hope this helps someone out! Ascend4nt's AutoIT Code License agreement: While I provide this source code freely, if you do use the code in your projects, all I ask is that: If you provide source, keep the header as I have put it, OR, if you expand it, then at least acknowledge me as the original author, and any other authors I creditIf the program is released, acknowledge me in your credits (it doesn't have to state which functions came from me, though again if the source is provided - see #1)The source on it's own (as opposed to part of a project) can not be posted unless a link to the page(s) where the code were retrieved from is provided and a message stating that the latest updates will be available on the page(s) linked to.Pieces of the code can however be discussed on the threads where Ascend4nt has posted the code without worrying about further linking.Download the ZIP from my site
    1 point
  2. WinMove("[Class:SciTEWindow]","",0,0) Exit
    1 point
  3. tommytx, Try adding these lines (with suitable values) to your User properties file. You can open it via the SciTE <Options - Open user Option File> menu or look for "C:Usersyour_user_nameSciTEUser.properties": position.left=5 position.top=10 position.width=1000 position.height=500 Then restart SciTE. M23
    1 point
  4. mlipok, Please do. No-one should feel offended - all we are trying to do is make sure that the best advice is given to those seeking help here. M23
    1 point
  5. LOL At some point, when you post 3 times and the issue is the same thing each time, people start thinking Troll - no one is that thick.
    1 point
  6. You can get it here : AU3_FrameGrabber.dll
    1 point
  7. Something like this? #Include <IE.au3> #include <GUIConstantsEx.au3> Global $oIE[2], $GUIActiveX[2] Global $BodyStyle = '<body style="margin-top: auto; border: 0px; overflow: hidden;">' Global $LoadingImg = '<img src="http://www.shipco.com/include/images/shipco/loading1.gif">' ;Loading gif from google images Global $ImgCentering = '<table cellpadding="0" cellspacing="0" border="0" height="100%" width="100%"><tr><td align="center" valign="middle">' Global $ImgCenteringE = '</td></tr></table>' Global $Site = 'http://www.google.com/', $Search = 'search?q=', $SearchKeys $GUI = GUICreate('Example', 1024, 780, -1, -1) $oIE[0] = _IECreateEmbedded() ;Main IE window $oIE[1] = _IECreateEmbedded() ;Secondary for loading display $GUIActiveX[0] = GUICtrlCreateObj($oIE[0], 1, 1, 1023, 779) $GUIActiveX[1] = GUICtrlCreateObj($oIE[1], 1, 1, 1023, 779) GUICtrlSetState($GUIActiveX[1], $GUI_HIDE) ; Hide secondary window, so user can interact with first one _IENavigate($oIE[0], $Site) _IENavigate($oIE[1], 'about:blank') GUISetState(@SW_SHOW) $SearchKeys = InputBox('', '', '') Loading(1) ;Loading "screen" on If $SearchKeys <> '' Then $Chars = Round(StringLen($SearchKeys)/2) _IENavigate($oIE[0], $Site & $Search & StringRegExpReplace($SearchKeys, '\s', '+')) $oLinks = _IELinkGetCollection($oIE[0]) $iNumLinks = @extended Dim $Links[$iNumLinks] $Limk = 0 For $oLink In $oLinks If StringInStr($oLink.outertext, StringLeft($SearchKeys, $Chars)) Then $Links[$Limk] = $oLink.href $Limk += 1 EndIf Next If $Chars <= 1 Then _IENavigate($oIE[0], $Links[1]) Else _IENavigate($oIE[0], $Links[0]) EndIf EndIf Loading(0) ;Loading "screen" off While 1 $gMsg = GUIGetMsg() Switch $gMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func Loading($State) If $State = 1 Then GUICtrlSetState($GUIActiveX[0], $GUI_HIDE) ;Hide first window where all stuff is running GUICtrlSetState($GUIActiveX[1], $GUI_SHOW) ;Loading "screen" now visible _IEDocWriteHTML($oIE[1], $BodyStyle & $ImgCentering & $LoadingImg & $ImgCenteringE) ;Loading animated gif (or any stuff can be there) _IELoadWait($oIE[1], 100) Else _IENavigate($oIE[1], 'about:blank') GUICtrlSetState($GUIActiveX[1], $GUI_HIDE) GUICtrlSetState($GUIActiveX[0], $GUI_SHOW) EndIf EndFunc
    1 point
  8. 1 point
  9. Probably the best example yet eXPoSiTIoN... **Remember to drag the 1st Letter to Stop the animation ** ; eXPoSiTIoN... ;********* USER INPUT ************** ; Create a Background GUI? Dim $BackGround_GUI = False ; Animation on? Dim $Random = True ; Display your user name or ???? Dim $Title = @UserName ; seconds to wait between animations $wMin = 1 $wMax = 10 Dim $wait = Random($wMin, $wMax, 1) ; Font Size ; -1 = random 38-50 Dim $tSize = -1 ;********** END USER INPUT *********** ; ** Drag 1st Letter to Park ** #include <FreeText.au3> #include <Date.au3> ; FreeText. au3 - eXPoSiTIoN... - Desk-Top Display $FT_Ver = "Ver 2.5.2 " ; 11/24/2008, AutoIt Ver 3.2.12.0" Opt("GUIOnEventMode", 1) Global $Time_hold = 1, $Name_GUI[2][2], $ticks = TimerInit(), $Reset = False _FreeText_Functions() HotKeySet("{ESC}", "_Terminate") If $BackGround_GUI = True Then $GUI_Back = _FreeText_CreateBackGround() While 1 If $Reset = False Then ;_FreeText_Delete($Name_GUI) $sName = StringLen($Title) $Name_GUI = _FreeText_Creator($sName) _FreeText_Shape_SetText_Special($Name_GUI, $Title) If $BackGround_GUI = True Then GUIDelete($GUI_Back) $GUI_Back = _FreeText_CreateBackGround() EndIf $Reset = True EndIf $dif = Int(TimerDiff($ticks) / 1000) If $Random And $dif >= $wait Then $uPick = Random(1, 28, 1) ConsoleWrite("> Case = " & $uPick & @CRLF) $nSize = _Pick_Text_Size() $cColor = _Pick_a_Color() Switch $uPick Case 1 _FreeText_CreateGlitter("Random", 100, 4000, 1, 1) Case 2, 28 $style = _Pick_a_Color("0,2,4,6,8,10,12,14,16,18");1,3,5,7,9,11,13,15,17,19") _FreeText_Animate($Name_GUI, $style) Sleep(500) _FreeText_Animate($Name_GUI, $style + 1) Case 3 _FreeText_Blink($Name_GUI) Case 4 _FreeText_Bump($Name_GUI) Case 5 _FreeText_ColorStrobe($Name_GUI) Case 6 _FreeText_HorseRace($Name_GUI) Case 7 _FreeText_FireWorks($Name_GUI) $Reset = False Case 8 _FreeText_Implode($Name_GUI) Case 9 _FreeText_MixUp($Name_GUI) _FreeText_Shape_SetTextColor($Name_GUI, _Pick_a_Color()) _FreeText_Scatter($Name_GUI) _FreeText_Move($Name_GUI, 100, 510) Case 10, 25 _FreeText_Move($Name_GUI, 10, 10) Case 11 _FreeText_MoveAsIs($Name_GUI, 200, 325) Case 12 For $x = 1 To UBound($Name_GUI) - 1 _FreeText_ExplodeOne($Name_GUI) Next $Reset = False Case 13, 26 _FreeText_MoveVertical($Name_GUI, 10, 10) Case 14 _FreeText_Rain($Name_GUI) Case 15 _FreeText_Rainbow($Name_GUI) Case 16 _FreeText_Scatter($Name_GUI) Case 17 _FreeText_Shape_ClearText($Name_GUI) Case 18 _FreeText_Shape_RainbowText($Name_GUI) Case 19 _FreeText_Shape_SetTextColor($Name_GUI, _Pick_a_Color()) Case 20 _FreeText_Shape_StrobeText($Name_GUI) Case 21 _FreeText_ShockWave($Name_GUI) Case 22 _FreeText_SpinIn($Name_GUI) $Reset = False Case 23 _FreeText_SpinOut($Name_GUI) $Reset = False Case 24 _FreeText_StairCase($Name_GUI) Case 27 _FreeText_Delete($Name_GUI) $Reset = False EndSwitch $wait = Random($wMin, $wMax, 1) $ticks = TimerInit() EndIf Sleep(20) WEnd Func _Set_Animation() $pos = WinGetPos($Name_GUI[1][0]) _FreeText_Move($Name_GUI, $pos[0], $pos[1]) $Random = Not $Random ToolTip("Animation = " & $Random & @CRLF & "Press (esc) to exit ", 20, 20, " eXPoSiTIoN... 8) ", 1) Sleep(4000) ToolTip("") EndFunc ;==>_Set_Animation Func _Terminate() Exit 0 EndFunc ;==>_Terminate Func _FreeText_Creator($a1) $nSize = _Pick_Text_Size() $cColor = _Pick_a_Color() $a2 = Random(1, 3, 1) If $a2 = 1 Then Return _FreeText_CreateBalls($a1, -1, -1, $nSize, $cColor) If $a2 = 2 Then Return _FreeText_CreateBlocks($a1, -1, -1, $nSize, $cColor) If $a2 = 3 Then Return _FreeText_CreateCubes($a1, -1, -1, $nSize, $cColor) EndFunc ;==>_FreeText_Creator Func _Pick_Text_Size() If $tSize = -1 Then Return Random(30, 45, 1) Return $tSize EndFunc ;==>_Pick_Text_Size Func _Pick_a_Color($cChoices = "Red,Green,Blue,Black,White,yellow,violet,win_xp_bg") $cSplit = StringSplit($cChoices, ",") $cRand = Random(1, $cSplit[0], 1) Return $cSplit[$cRand] EndFunc ;==>_Pick_a_Color Func _FreeText_Shape_SetText_Special($B_GUI, $Text, $Size = 20, $Color = "black", $Font = "Arial", $Weight = 1000, $delay = 20) If Not IsArray($B_GUI) Then Return 0 Local $TL_S = StringSplit($Text, ""), $tControl, $Tpos, $ret, $rgn If UBound($TL_S) > UBound($B_GUI) Then Return 0 If StringIsXDigit($Color) = 0 Then $Color = _GetColorByName($Color) For $x = 1 To $TL_S[0] Sleep($delay) GUICtrlSetData($B_GUI[$x][1], $TL_S[$x]) If $x = 1 Then GUICtrlSetStyle($B_GUI[$x][1], -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetOnEvent($B_GUI[$x][1], "_Set_Animation") EndIf GUICtrlSetColor($B_GUI[$x][1], $Color) GUICtrlSetFont($B_GUI[$x][1], $Size, $Weight, "", $Font) Next Return 1 EndFunc ;==>_FreeText_Shape_SetText_Special 8)
    1 point
×
×
  • Create New...