Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/06/2014 in all areas

  1. mesale0077

    QR Barcode create

    Generate QR code Thank you UEZ for helps not: autoit version v3.3.12.0 after versions used link: http://www.mediafire.com/download/rm63wck1yhqmgdn/QR+Barcode.rar QR+Barcode.rar example.au3, example_1.au3, createQRw.au3
    2 points
  2. At least this one is only 7 years old...
    2 points
  3. Ok, here is what i came up with after 3-4 hours of scripting well ok, it has been long time since then, so... after an year or so of hard scripting/testing!!! (inspired by this topic)... GUICtrlSetOnHover UDF... Syntax: _GUICtrl_OnHoverRegister(ControlID [, OnHoverFunc [, OnLeaveHoverFunc [, PrimaryDownFunc [, PrimaryUpFunc [, KeepCall_PrDn_Func [, KeepCall_Hover_Func]]]]]]) ControlID can be -1 as in Build-In functions! Example: #include "GUICtrlOnHover.au3" Opt("GUIOnEventMode", 1) $Btn_Color = 0x7A9DD8 $Hover_Color = 0xFF0000 ;0x7AC5D8 $GUIMain = GUICreate("Letters Hovering Example", 570, 200) GUISetOnEvent(-3, "Quit") _CreateLetters_Proc(10, 60, 18, 20) GUICtrlCreateButton("Close", 30, 120, 100, 30) GUICtrlSetOnEvent(-1, "Quit") GUICtrlSetFont(GUICtrlCreateLabel("Letter: ", 35, 170, 200, 20), 9, 800) $Status_Label = GUICtrlCreateLabel("", 80, 171, 200, 20) GUICtrlSetColor(-1, 0xFF0000) GUICtrlSetFont(-1, 8.5, 800) GUISetState() While 1 Sleep(100) WEnd Func _CreateLetters_Proc($iLeft, $Top, $Width=15, $Height=15) Local $iLeft_Begin = $iLeft Local $iAsc_Char = 64 For $i = 0 To 25 $iLeft_Begin += 20 $iAsc_Char += 1 GUICtrlCreateButton(Chr($iAsc_Char), $iLeft_Begin, $Top, $Width, $Height) _GUICtrl_OnHoverRegister(-1, "_Hover_Func", "_Leave_Hover_Func") GUICtrlSetOnEvent(-1, "_Letter_Events") GUICtrlSetBkColor(-1, $Btn_Color) GUICtrlSetFont(-1, 6) Next EndFunc Func _Letter_Events() MsgBox(64, "Pressed", "Letter = " & GUICtrlRead(@GUI_CtrlId)) EndFunc Func _Hover_Func($iCtrlID) GUICtrlSetBkColor($iCtrlID, $Hover_Color) GUICtrlSetData($Status_Label, GUICtrlRead($iCtrlID)) Beep(1000, 20) EndFunc Func _Leave_Hover_Func($iCtrlID) GUICtrlSetBkColor($iCtrlID, $Btn_Color) GUICtrlSetData($Status_Label, "") EndFunc Func Quit() Exit EndFunc Attachments: [The archive include few nice examples, and the UDF itself of course .] * New (v2.1) (Redirection to Zip-file, 159 kb) _GUICtrlSetOnHover.html GUICtrlSetOnHover.zip GUICtrlSetOnHover_UDF.au3 GuiCtrlSetOnHover.zip GUICtrlSetOnHover_UDF_For_3.2.10.0.au3 Old Beta - GUICtrlSetOnHover_UDF_beta.zip Enjoy! P.S Thanks to piccaso for the greatest CallBack tool! Without it, this UDF would never been created! ============================================ History version:
    1 point
  4. Tested to work under Win7. Should work with Vista as well. Usage: WinSetVolume("title", 50) - Set volume (0-100) WinSetVolume("title", "mute") - Mute WinSetVolume("title", "unmute") - Unmute WinSetVolume("title", "toggle") - Toggles mute state Returns 1 on success, 0 on failure. Please note: For non-English platforms you'll need to alter the $localized string (e.g. for Dutch: $localized = "Dempen voor ").Setting the volume to 0 is not the same as muting.This function doesn't respect the WinTitleMatchMode setting, it will always match titles as if in mode 1.On how it functions: The keypress after setting the slider's position is needed to trigger Windows to adjust the volume, otherwise it won't become effective. Just FYI, if you wondered.Since there's no easy way to determine whether or not a given window is muted, the volume level is being re-set which results in unmuting (though it possibly already was), so we're certain of it's state. Afterwards it 'presses' the mute button, if applicable.Any questions, bug reports or ideas are welcome. I appreciate if you let me know if this was of use to you. #include <GuiConstantsEx.au3> #include <GuiSlider.au3> Func WinSetVolume($targetTitle, $targetVolume = "toggle") Const $localized = "Mute for " $currentActive = WinGetHandle("[active]") $mixerPid = Run(@SystemDir & "\SndVol.exe -r", "", @SW_HIDE) $mixerHandle = WinWaitActive("[CLASS:#32770]") WinActivate($currentActive) $iSlider = 1 $iButton = 2 While 1 $currentButton = ControlGetText("[CLASS:#32770]", "", "[CLASS:ToolbarWindow32; INSTANCE:" & $iButton & "]") If @error Then ProcessClose($mixerPid) Return 0 ElseIf StringInStr($currentButton, $localized & $targetTitle, 1) = 1 Then If NOT ($targetVolume == "toggle") Then $sliderHandle = ControlGetHandle("[CLASS:#32770]", "", "[CLASS:msctls_trackbar32; INSTANCE:" & $iSlider & "]") If IsInt($targetVolume) Then $setVolume = -($targetVolume-100) Else $setVolume = _GUICtrlSlider_GetPos($sliderHandle) EndIf If $setVolume < 100 Then _GUICtrlSlider_SetPos($sliderHandle, $setVolume+1) ControlSend("[CLASS:#32770]", "", "[CLASS:msctls_trackbar32; INSTANCE:" & $iSlider & "]", "{UP}") Else _GUICtrlSlider_SetPos($sliderHandle, $setVolume-1) ControlSend("[CLASS:#32770]", "", "[CLASS:msctls_trackbar32; INSTANCE:" & $iSlider & "]", "{DOWN}") EndIf EndIf If $targetVolume == "toggle" OR $targetVolume == "mute" Then ControlCommand("[CLASS:#32770]", "", "[CLASS:ToolbarWindow32; INSTANCE:" & $iButton & "]", "SendCommandID", 305) WinClose($mixerHandle) Return 1 EndIf $iSlider += 1 $iButton += 2 WEnd EndFunc
    1 point
  5. It should hardly make any difference. It is generally a good idea to use the minimum recources to achieve a task. In this case you can pass the handle directly and do not need to create a variable. Sometimes you might want to declare a variable simply to make the code easier to understand.
    1 point
  6. micechal, The WinWait function internally polls "every 250 milliseconds or so", but the overall script remains paused until it returns. M23
    1 point
  7. BrewManNH

    Newbie - Help Please

    https://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F
    1 point
  8. like this: Global $UzemanyagKartyaFile = "" Global $SaveDirectory = "" FileKivalasztas() Func FileKivalasztas() $message = "?zemanyag K?rtya Sz?mok" $filter = "Text files (*.txt)" $UzemanyagKartyaFile = FileOpenDialog($message, "D:\", $filter, 1) If $UzemanyagKartyaFile = "" Then Return ; this will return the function back to the calling script if file was not selected. $SaveDirectory = FileSelectFolder("Select a Folder to Save the Datas", "D:\") ; no condition is needed here because anyway the function returns. EndFunc ;==>FileKivalasztas also notice i moved the Global variables declaration to the main script, not inside a function.
    1 point
  9. Dont know if something like this catagorize as bug at all... but my main question is where are your icons? Sloppy edited a random script from AutoIt forum for this purpose: #include <WindowsConstants.au3> #include <Misc.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #Include <GuiImageList.au3> #include <GuiListView.au3> #NoTrayIcon Opt("GUIOnEventMode", 1) _Singleton(@ScriptName) $hGUI=GUICreate ("test", 500,300,-1,-1) GUISetOnEvent($GUI_EVENT_CLOSE, "_GuiMsg") $hListView = GUICtrlCreateListView("", 0, 0,500, 300) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") _GUICtrlListView_SetExtendedListViewStyle($hListView, $LVS_EX_CHECKBOXES) GUICtrlSetStyle($hListView, $LVS_SMALLICON) ;~ $hImage = _GUIImageList_Create(32, 32, 5, 3) $hImage = _GUIImageList_Create(1, 32, 5, 3);use upper to fully display icons ;~ _GUIImageList_AddIcon($hImage, "shell32.dll", "15", True) ;Extract large icons;ennable this line to display icons _GUICtrlListView_SetImageList($hListView, $hImage, 1) ;but use as small icons For $x = 0 To 99 _GUICtrlListView_AddItem($hListView, 'Testtttt'&$x + 1 , 0) Next _GUICtrlListView_SetView($hListView, 2) ;Set the view mode (2 = List) GUISetState() While 1 Sleep(100) Wend Func _GuiMsg() Switch @GUI_CTRLID Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_MINIMIZE guisetstate(@SW_MINIMIZE) EndSwitch EndFunc
    1 point
  10. Welcome to the AutoIt forum! For one, using code tags [ autoit ] ;code goes here [ /autoit ] (remove the spaces) will give you syntax highlighting and a box for your code making it very clean. Two, that is not a runnable script that we can test for you, please post your whole script, or a reproducer script that does what you say is the problem. Using onEvent will not be needed here, but I'm glad you are trying to find solutions.
    1 point
  11. Do you mean this? #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 438, 192, 146, $WS_POPUP, 0) $Pic1 = GUICtrlCreatePic("", 40, 56, 337, 161, 0, $GUI_WS_EX_PARENTDRAG) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUIRegisterMsg($WM_NCHITTEST, "Dragwindow") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func Dragwindow($hWnd, $iMsg, $iwParam, $ilParam) If $iMsg = $WM_NCHITTEST Then Return $HTCAPTION EndIf EndFunc
    1 point
  12. Zedna

    Listview Selected item value

    I use _GUICtrlListView_GetNextItem() to get selected item index: ; current selected (0 - first column) $col_value = _GUICtrlListView_GetItemText($ListView1, _GUICtrlListView_GetNextItem($ListView1), 0) If $col_value = -1 Then Return
    1 point
×
×
  • Create New...