Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/15/2015 in all areas

  1. Melba23

    Wannabee Mods

    Hi, A number of recent threads have degenerated into discussions between no doubt well-meaning members over the legality of the question asked - such spats are both unseemly and unnecessary. If you have not already noticed, there is a Moderation team charged by the site owner with keeping the site running smoothly in accordance with his wishes - so please leave the decisions to them. If the question is obviously illegal, then perhaps the first responder might point at the Forum rules as well as reporting the thread so that normal moderation action can be taken. But if there is any doubt, please still report the thread, but do NOT get involved in pointless discussions as to whether or not it is allowable - the Moderation team will make the final decision and will not be swayed by any other opinions, so save the wear on typing fingers and keyboards. In particular, if a Moderation team member has already posted permitting the thread to continue, it is completely out of order for a third party to post again questioning the decision - from now on this will be regarded as an unfriendly act and is likely to attract sanctions upon the wannabee-Mod. If there is really a burning need to discuss the matter further, please do so by PM - the Moderation team do not bite and are open to reasoned debate. M23
    2 points
  2. StringFormat
    2 points
  3. INTERIM VERSION 11 Mar 21 A bug in the x64 implementation of some the library TreeView functions meant that some replacement working functions were added to the UDF. Now the Beta TreeView library (from 15.3) has been modified, these functions are no longer required, but they will remain until the modified library is formally released. However, other changes in the Beta mean that the replacement functions will not work under it - don't you just love compatibility problems! So here is an interim release with a modified replacement function so that it will function with Release and Beta versions under both x32 and x64 - I hope! New UDF and examples in zip below. Previous version descriptions: ChangeLog.txt I was fed up with using the native FileOpenDialog and FileSelectFolder which appeared anywhere on the screen in seemingly random sizes and often allowed users to select files from other than the path desired. So I decided to write my own version of an Explorer-type treeview and here it is: ChooseFileFolder. What are the main advantages of this UDF over the normal dialogs? Common format for both file and folder selection. Ability to size and place the dialog where you want it rather than how Windows last left it. Ability to select (and delete) multiple items - even from different folders or drives. You can also select both files and folders from the same tree Ability to preselect items. And there is also a function to allow you to use an existing treeview in your own GUI to display the folder tree - no need to have a dialog at all. Here is a zip file with the UDF and several example scripts: ChooseFileFolder.zip As usual happy to take feedback and, preferably, plaudits. M23
    1 point
  4. Version 3.2.0.4

    884 downloads

    ADCG displays two Active Directory groups and their direct members in two listviews. You can filter and export the data to Excel, Outlook mail and the clipboard. Before running the script you need to change file AD-Tools.ini and function _Check_Access in AD-Tools_User.au3. BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort Needs to be run with the latest AutoIt production version (>= 3.3.12.0). Needs to be run with the latest version of the AD UDF (>= 1.4.2.0).
    1 point
  5. Just did a bit of "spring cleaning" on that example. Expect an update in the next beta (no deadline currently set).
    1 point
  6. wakillon

    Chiptunes Players

    A V2m file Player was added.
    1 point
  7. Code has been updated due to a request by bazii from German forum / coffeeturtle to add a feature that the clock acts as a screensaver. Check out post#1.
    1 point
  8. ​I don't only "like" it, I LOVE (Auto)IT!
    1 point
  9. Try this: #include <SQLite.au3> #include <SQLite.dll.au3> #include <GUIMonthCal.au3> #include <GUIConstantsEx.au3> #include <String.au3> _SQLite_Startup() $hDB = _SQLite_Open() _SQLite_Exec($hDB,'CREATE TABLE Days(dt datetime)') _SQLite_Exec($hDB,"INSERT INTO Days SELECT '2015-06-15'") _SQLite_Exec($hDB,"INSERT INTO Days SELECT '2015-06-18'") _SQLite_Exec($hDB,"INSERT INTO Days SELECT '2015-06-21'") _SQLite_Exec($hDB,"INSERT INTO Days SELECT '2015-06-23'") _SQLite_Exec($hDB,"INSERT INTO Days SELECT '2015-06-29'") $hMain = GUICreate('Test') $hCal = _GUICtrlMonthCal_Create($hMain, 100,100, $MCS_DAYSTATE) SetBoldDays($hDB,$hCal,"SELECT strftime('%d',dt) AS Day FROM Days") GUISetState(@SW_SHOW) Do Sleep(10) Until GUIGetMsg() = $GUI_EVENT_CLOSE _SQLite_Close($hDB) _SQLite_Shutdown() Func SetBoldDays($hDB,$hCal,$sQuery) Local $aResult, $iRows, $iColumns $iRval = _SQLite_GetTable2d($hDB, $sQuery , $aResult, $iRows, $iColumns) If $iRval = $SQLITE_OK Then Local $Mask = _StringRepeat('0',31) For $Index = 1 To UBound($aResult)-1 $Mask = StringLeft($Mask,$aResult[$Index][0]-1) & '1' & StringRight($Mask,31-$aResult[$Index][0]-1) Next Local $aMasks[_GUICtrlMonthCal_GetMonthRangeSpan($hCal, True)] $aMasks[1] = Bin2Dec(StringReverse($Mask)) _GUICtrlMonthCal_SetDayState($hCal, $aMasks) Else MsgBox(0x10,'Error','Oups!') EndIf EndFunc Func Bin2Dec($B) ; Thanks to kaesereibe ;https://www.autoitscript.com/forum/topic/163035-dec2bin-bin2dec/?do=findComment&comment=1186748 Return BitOr((StringLen($B) > 1 ? BitShift(Bin2Dec(StringTrimRight($B, 1)), -1) : 0), StringRight($B, 1)) EndFunc
    1 point
  10. As you didn't explain just what you're trying to do, I assume you are looking for general suggestions. So I give you one that I wrote for a helpdesk person that was continually asking me questions without searching for himself: $input = InputBox( "Every answer to every question - Ever", "Please enter type in your question." ) ShellExecute ("http://www.lmgtfy.com/?q=" &$input)
    1 point
  11. I get an error, also. Is the 'mainpage' you refer to something other that the HTML link in the first post?
    1 point
  12. ok, completely not what i had in mind, but still... i made a simple non-resizable smartphone-like GUI, with a button at the top, like this: what i'm now struggling with is to draw a contour line around the GUI, same color as the sunken edge of the button. i've been trying to follow the line with PixelGetColor() but that failed miserably. there must be a simpler way to this? #include <StaticConstants.au3> #include <Array.au3> #include <WindowsConstants.au3> #include <GuiConstants.au3> Opt('PixelCoordMode',0) $my_gui = GuiCreate('', 290, 500, Default,Default,$WS_POPUP) GUISetBkColor(0x333340) _GuiRoundCorners($my_gui, 0, 0, 40, 40) $gArea=GUICtrlCreateGraphic(0,0,290,500) ; button Global $cHeadButtonColor=0xCCDDEE $gHeadButtonPaddingTop=GUICtrlCreateLabel('',81,0,200-81,3,$SS_CENTER) GUICtrlSetBkColor(-1,$cHeadButtonColor) GUICtrlSetCursor(-1,0) $gHeadButtonLabel=GUICtrlCreateLabel('My App Title',81,3,200-81,20,$SS_CENTER) GUICtrlSetBkColor(-1,$cHeadButtonColor) GUICtrlSetCursor(-1,0) GUICtrlSetFont(-1,Default,800) ; button sunken edge GUICtrlSetGraphic($gArea, $GUI_GR_COLOR, 0x77CCCC) GUICtrlSetGraphic($gArea,$GUI_GR_MOVE,79,0) GUICtrlSetGraphic($gArea,$GUI_GR_LINE,79,24) GUICtrlSetGraphic($gArea,$GUI_GR_LINE,280-79,24) GUICtrlSetGraphic($gArea,$GUI_GR_LINE,280-79,-1) GUICtrlSetState($gArea,$GUI_DISABLE) GuiSetState() GUIRegisterMsg($WM_NCHITTEST, 'WM_NCHITTEST') While True $msg=GuiGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $gHeadButtonLabel,$gHeadButtonPaddingTop MsgBox(0,'','Head Button pressed') EndSwitch WEnd Exit Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3) Dim $pos, $ret, $ret2 $pos = WinGetPos($h_win) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3, "long", $i_y3) If $ret[0] Then $ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1) If $ret2[0] Then Return 1 Else Return 0 EndIf Else Return 0 EndIf EndFunc ;==>_GuiRoundCorners Func WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam Return $HTCAPTION EndFunc ;==>WM_NCHITTEST
    1 point
  13. It is actually quite easy to do. Create a popup window which is big enough to hold the button. Make the window positionthe same as the position you want it to be in the 3rd party window. Set the parent for the popup to be the 3rd party window and it will move there. You can react to the button press in your script as normal. Here is a simple example. ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=Pumac.exe #AutoIt3Wrapper_res_requestedExecutionLevel=asInvoker #EndRegion;**** Directives created by AutoIt3Wrapper_GUI **** ; *** Start added by AutoIt3Wrapper *** #include <WindowsConstants.au3> ; *** End added by AutoIt3Wrapper *** AutoItSetOption('trayiconhide', 1) Run('calc.exe');just to have a window to use $ParentTitle = "Calculator"; While Not WinExists($ParentTitle) Sleep(200) WEnd ConsoleWrite("ss" & @CRLF) $hParentWindow = WinGetHandle($ParentTitle) ;guess and experiment $fleft = 12 $ftop = 38 $winf7 = GUICreate("F7",30, 30, $fleft, $ftop, $WS_POPUP) GUISetBkColor(0xff0000) $Btnf7 = GUICtrlCreateButton("F7", 1, 1, 28, 28) ;GUICtrlSetFont(-1, 16) DllCall("user32.dll", "int", "SetParent", "hwnd", $winf7, "hwnd", $hParentWindow) GUISetState() While WinExists($hParentWindow) if GUIGetMsg() = $Btnf7 then msgbox(262144,'Click', 'F7 pressed') WEnd WinKill($winf7) For a UDF which does this for you search for anygui.
    1 point
  14. You can't use GUI event mode and GUIgetmsg in the same script at the same time, but you can use TRAY event mode and GUIgetmsg together. And vice versa, you can use GUI EventMode and Traygetmsg at the same time, just not traygetmsg and tray event mode together.
    1 point
  15. Q: How can I make my game bot? A: Without any help on the forums, because it's against the rules. EX: None.
    1 point
  16. Here are 2 examples of using transparency in a GUI. The first uses a background image that is used to display an oval shaped GUI and controls on top of it. It's just a basic one color oval, but you can use anything in it's place to make a GUI of any shape, as long as the background has a consistent single color to be used for the transparent color. The second is a GUI that is nearly fully transparent except for the label text. This example also shows how to use a label as a hyperlink, and a label that can be used to drag a GUI around like a title bar. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ProgressConstants.au3> Opt("GUIOnEventMode", 1) Global $URL[4] Global $Active = 1 _Main() _Links() Func _Main() ; Partially transparent GUI $Temp = GUICreate("", 800, 280, -1, -1, $WS_POPUP, $WS_EX_LAYERED) ; set up GUI to be transparent GUISetBkColor(0x9FBAD8) ; set the back ground color of the GUI to match the color of the upper left pixel of the back ground picture GUICtrlCreatePic(@ScriptDir & "\bg.bmp", 0, 0, 0, 0) ; use a bmp as the back ground picture, jpg can be used but it won't look as good. GUICtrlSetState(-1, $GUI_DISABLE) ; disable the picture so you can interact with the controls GUISetOnEvent($GUI_EVENT_CLOSE, "_TempClose1") GUICtrlSetFont(-1, 10, 800, -1, "Consolas") GUICtrlSetColor(-1, 0x0000000) GUICtrlCreateButton(" Close ", 225, 210, -1) ; buttons can show artifacts that you don't want on your GUI GUICtrlSetOnEvent(-1, "_TempClose1") GUICtrlCreateIcon("shell32.dll", -28, 230, 150) ; icons look much better on this type of GUI GUICtrlSetOnEvent(-1, "_TempClose1") ; the icon acts like a button Local $idProgress = GUICtrlCreateProgress(110, 100, 280, 20) $iProgress = 1 GUISetState() While $Active Sleep(100) $iProgress += 1 If $iProgress = 101 Then $iProgress = 1 GUICtrlSetData($idProgress, $iProgress) WEnd EndFunc ;==>_Main Func _Links() ; Fully transparent GUI with hyperlinks Local $Func[4] $URL[0] = "http://www.autoitscript.com/forum" $URL[1] = "http://www.autoitscript.com/forum/forum/2-general-help-and-support/" $URL[2] = "http://www.autoitscript.com/forum/forum/9-example-scripts/" $URL[3] = "Extended Message Box" Local $Text = "You can drag the GUI around by left clicking on this label and dragging it." & @LF & @LF & _ "Some helpful links: " $Func[0] = "Main forum page" $Func[1] = "General Help and Support" $Func[2] = "Example Scripts" $Func[3] = "" $Temp = GUICreate("", 800, 280, -1, -1, $WS_POPUP, $WS_EX_LAYERED) GUISetBkColor(0xFFFFFF) ; set the back ground color of the GUI to match the color of the Upper left pixel of the background image. In this case it's white. GUICtrlCreatePic(@ScriptDir & "\White.bmp", 0, 0, 0, 0) GUICtrlSetState(-1, $GUI_DISABLE) GUISetOnEvent($GUI_EVENT_CLOSE, "_TempClose") GUISetBkColor(0xFFFFFF, $Temp) GUICtrlCreateLabel($Text, 40, 10, 750, 100, Default, $GUI_WS_EX_PARENTDRAG) ; You can drag the window around with this label GUICtrlSetFont(-1, 10, 800, -1, "Consolas") GUICtrlSetBkColor(-1, 0x00DDDD) ; sets the back ground color of the label so you can see where it starts/ends GUICtrlSetColor(-1, 0x0000000) GUICtrlCreateButton(" Close ", 360, 230, -1) GUICtrlSetOnEvent(-1, "_TempClose") For $I = 0 To 3 GUICtrlCreateLabel($Func[$I], 40, 130 + ($I * 20), 200, 20) GUICtrlSetColor(-1, 0x000000) GUICtrlSetFont(-1, 9, 400, 0) Next GUICtrlCreateLabel($URL[0], 260, 130, 400, 20) GUICtrlSetOnEvent(-1, "_ForumURL") GUICtrlSetCursor(-1, 0) GUICtrlSetColor(-1, 0x00000FF) GUICtrlSetFont(-1, 9, 400, 4) GUICtrlCreateLabel($URL[1], 260, 150, 400, 20) GUICtrlSetOnEvent(-1, "_GHSURL") GUICtrlSetCursor(-1, 0) GUICtrlSetColor(-1, 0x00000FF) GUICtrlSetFont(-1, 9, 400, 4) GUICtrlCreateLabel($URL[2], 260, 170, 348, 20) GUICtrlSetOnEvent(-1, "_ExampleURL") GUICtrlSetCursor(-1, 0) GUICtrlSetColor(-1, 0x00000FF) GUICtrlSetFont(-1, 9, 400, 4) GUICtrlCreateLabel($URL[3], 260, 190, 400, 20) GUICtrlSetOnEvent(-1, "_EMBURL") GUICtrlSetCursor(-1, 0) GUICtrlSetColor(-1, 0x00000FF) GUICtrlSetFont(-1, 9, 400, 4) GUISetState() While 1 Sleep(10) WEnd EndFunc ;==>_Links Func _TempClose() Exit EndFunc ;==>_TempClose Func _TempClose1() $Active = 0 GUIDelete() EndFunc ;==>_TempClose1 Func _ForumURL() ShellExecute($URL[0]) EndFunc ;==>_ForumURL Func _GHSURL() ShellExecute($URL[1]) EndFunc ;==>_GHSURL Func _ExampleURL() ShellExecute($URL[2]) EndFunc ;==>_ExampleURL Func _EMBURL() ShellExecute("http://www.autoitscript.com/forum/index.php?showtopic=109096") EndFunc ;==>_EMBURL You will need the files in the attached zip to see these in action, extract them to the same folder that the script is being run from. You can use files other than BMP files, but they won't look as good because of artifacting due to image compression. A PNG should/might work as well, I haven't tried that yet. Backgrounds.zip
    1 point
  17. Melba23

    TaskBar / TrayIcon

    cynapse, Is this more understandable? #include <GUIConstantsEx.au3> Opt("TrayOnEventMode", 1) ; Use event trapping for tray menu Opt("TrayMenuMode", 3) ; Default tray menu items will not be shown. TrayCreateItem("Show") TrayItemSetOnEvent(-1, "Tray_Show") TrayCreateItem("Hide") TrayItemSetOnEvent(-1, "Tray_Hide") TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "On_Exit") TraySetState() ; Make GUI a child of the hidden Autoit window - then it has no taskbar button $hGUI = GUICreate("Test", 500, 500, -1, -1, -1, -1, WinGetHandle(AutoitWinGetTitle())) GUISetState() While 1 Switch GUIGetMsg() ; Click [X] Case $GUI_EVENT_CLOSE Exit ; Click [_] Case $GUI_EVENT_MINIMIZE ; Hide as well as minimize GUISetState(@SW_HIDE, $hGUI) EndSwitch WEnd Func Tray_Show() ; Show and also restore in case it was minimized GUISetState(@SW_SHOW, $hGUI) GUISetState(@SW_RESTORE, $hGUI) EndFunc Func Tray_Hide() GUISetState(@SW_HIDE, $hGUI) EndFunc Func On_Exit() Exit EndFunc M23
    1 point
  18. Doh /smackself. Thanks! $WM_QUERYENDSESSION = 0x11 GUIRegisterMsg($WM_QUERYENDSESSION, "Cancel_Shutdown") $Hwnd = GUICreate("PreventShutdownGUI") GUISetSTate(@SW_SHOW) _ShutdownBlockReasonCreate($hwnd, "Sorry! you lose!") TrayTip("Shutdown", "Denied shutdown for 15 seconds", 20) Sleep(15000) _ShutdownBlockReasonDestroy($hwnd) Func _ShutdownBlockReasonCreate($Hwnd, $wStr) ; http://msdn.microsoft.com/en-us/library/ms...28VS.85%29.aspx ; Prog@ndy Local $aResult = DllCall("User32.dll", "int", "ShutdownBlockReasonCreate", "hwnd", $Hwnd, "wstr", $wStr) If @error Then Return SetError(1,0,0) Return $aResult[0] EndFunc Func _ShutdownBlockReasonDestroy($Hwnd) Local $aResult = DllCall("User32.dll", "int", "ShutdownBlockReasonDestroy", "hwnd", $Hwnd) If @error Then Return SetError(1,0,0) Return $aResult[0] EndFunc Func Cancel_Shutdown($hWndGUI, $MsgID, $WParam, $LParam) ; This HAS to be here to capture the endsession... ; DO NOT ADD A MSGBOX HERE ; Windows shows a not responding box after ~5 secs and allows to kill your app. Return False EndFunc Edit: Fixed it... Works now.
    1 point
  19. I found a func to set the Shutdow level $WM_QUERYENDSESSION = 0x11 GUIRegisterMsg($WM_QUERYENDSESSION, "Cancel_Shutdown") GUICreate("PreventShutdownGUI") GUISetSTate(@SW_HIDE) ; set highest notification level If Not _SetProcessShutdownParameters(0xFFF) Then ; MSDN says maximum is 0x4FF, but it worked for me If Not _SetProcessShutdownParameters(0x4FF) Then ; MSDN says this is reserved for System, but worked for me _SetProcessShutdownParameters(0x3FF) ; highest not reserved number, if everything else does not work EndIf EndIf Global $b_ShutdownInitiated = False While 1 If $b_ShutdownInitiated = True then $b_ShutdownInitiated = False MsgBox(48 + 8192 + 262144, "Installer", "Ending your user session has been disabled to allow the installation to complete." _ & @CRLF & @CRLF & "You will be able to shutdown/reboot/logoff once the installation process has completed." , 8) EndIf sleep(10) WEnd Func Cancel_Shutdown($hWndGUI, $MsgID, $WParam, $LParam) $b_ShutdownInitiated = True ; DO NOT ADD A MSGBOX HERE ; Windows shows a not responding box after ~5 secs and allows to kill your app. Return False EndFunc Func _SetProcessShutdownParameters($dwLevel, $dwFlags=0) ; http://msdn.microsoft.com/en-us/library/ms686227%28VS.85%29.aspx ; Prog@ndy Local $aResult = DllCall("Kernel32.dll", "int", "SetProcessShutdownParameters", "dword", $dwLevel, "dword", $dwFlags) If @error Then Return SetError(1,0,0) Return $aResult[0] EndFunc
    1 point
×
×
  • Create New...