Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/15/2014 in all areas

  1. You put a lot of time and effort into writing that post, so it's only fair that I do the same in a reply. But I can't think of anything else to say, except for padding the post out a bit. I could tell you the story about when my nana got a jelly fish stuck to her face, or the time I thought I was dreaming, but it turned out I really was in class without my pants on, but that would be more padding out of the post. Tell us your endgame, because your description could mean anything.
    2 points
  2. I use a USB key or an FM transmitter in my car to listen mp3. Two problems have emerged: long silences or a different sound level between different tracks or between tracks and FM radio. Seeking a software that could solve automatically these problems, for multiple files, I returned empty-handed ! All i have found who could be interesting were some examples about remove silence on un4seen.com (the bass audio library website) After much research I managed to adapt it, here is the result : Mp3SilenceRemover can trim a bunch of mp3 files that have silence at the beginnings and ends, automatically. Script scans each file for when the sound starts and ends, by detecting a pre-determined silence threshold, then reencode them without silent parts found. Usefull if you want use mp3 files for a mix or avoid long silences between tracks. Multiple settings are available for preserving mp3 quality. Mp3Gain can be used for avoid a too big difference in sound level between 2 tracks. Main Id3 Tags can be preserved and the fade at end of the track too. Script use : bass.dll, bassenc.dll, bassext.dll, tags.dll, lame.exe and mp3gain.exe. The default settings I have choosen are the ones who give me the best results during my numerous tries. Free to you to adapt them to your needs, they are saved automatically. New mp3 files will be located in the same folder with "_SR1" at the end of the name. Buttons were made online with chimply.com the easy and free buttons generator ! No external files or includes needed, they are embbeded in script. source and executable are available in the Download Section Hope you like it !
    1 point
  3. A utility to look up constants in the Include files Countless times in writing or debugging I’ve interrupted my train of thought to go look up the numeric value of a named constant ... or worse, had to figure out which include file reference is needed. I finally got around to looking for a solution. (Actually, I’ve never understood why there hasn’t been some standard feature—in SciTE?— to do this. But I digress.) What I found was a pair of ready-to-use functions (from “Mat”) in the example files from 2009. They are everything I envisioned for the “lookup side” of the problem, but they lacked a GUI for convenient use. Encouraged by the possibilities, I began to work with richedit, drag/drop and WM_COMMAND (thanks, Melba23!), and I've now put all the pieces together into a desktop utility. (Caution to coding purists: I sought a solution, here—not programming art ... so you’ll see some “quick fix” code ... even (aghast!) some straight-line coding. I’m always interested in readable code and function trumps form, for me—certainly at this moment.) That said, I did add some touches using simple GUI methods: frameless ... draggable ... on top ... with some basic uses of transparency and parent drag. I wanted to stay away from GDI+. It’s great, but I’ve done enough at that level to really develop an appreciation for SIMPLE. Simple is so much easier to troubleshoot! But these forums are great sources of information for both levels. I’m continually amazed at what knowledge is embodied in the posts. Sometimes it takes a while—and some directional assistance—to ferret it out. But it’s there. [screen image] How to use the utility: Easiest use: just drag the text string for the constant into the lower box and let it go. (caveat: when dragging from SciTE, you MUST hold down the CTRL key to keep it from removing the text from your script—but more on that, below.) Or, you can type (or paste/edit) the name of the constant into the upper box and then click Find. Either way, the utility finds the occurrence (or occurrences) in the include files and shows the file(s), plus the numeric value for the constant. The other main feature (as afforded by Mat’s second function) is to type in (or paste) a numeric value into the top field and click Find. The utility will display an array of all the include files that have a constant with that value. A third use (which I took the liberty of modifying Mat’s functions to implement) is to look up references to include files that occur in the standard UDFs (those on the Include directory). As you might expect, “#i” is the trigger string for the lookup. For simplicity’s sake, only the first seven occurrences are listed. This feature is more a proof of concept than anything else, as it demonstrates how this simple utility might be expanded or adapted for other uses. Technical note on the drag/drop from SciTE: Let me be clear: dragging a constant from the SciTE window to the Lookup Utility WITHOUT USING THE CTRL KEY REMOVES IT from the script. Ctrl+Z is required to restore it. (Curiously, you can drag the same constant to WorkPad and it stays in SciTE.) I toyed with ways to automatically issue that restore, but SciTE apparently doesn’t accept sent keystrokes. Nine different attempts yielded nothing, so I dropped the idea. Later, I found these two entries on Google Groups: “In the simplest case, the target of a drag and drop action receives a copy of the data being dragged, and the source decides whether to delete the original. “ “There is no (SciTE) option. The code that controls this is in /scintilla/gtk/ScintillaGTK.cxx ScintillaGTK::DragMotionThis where preferredAction = GDK_ACTION_MOVE can be changed to GDK_ACTION_COPY.” Link: https://groups.google.com/forum/#!topicsearchin/scite-interest/drag/scite-interest/2AZzHfnfFIQ Apparently there’s at least the possibility of a solution. Programming notes: • Yes, the fonts are large. I trust I’m not the only one annoyed by tiny fonts on large screens. Anyone running a desktop setting of 125% or 150% with have to tune accordingly. • The progress bar exists only to give some indication of action. • The utility assumes you’re entering a findable name or number. Some minimal pre-check of the requested text would be worthwhile to avoid false runs. • Also, it would appear to be an easy extension to add “F” (for Func) as a 3rd trigger to locate functions in UDFs. The top entry field is a little wider to accommodate this eventuality, given that some names are long. Another obvious possibility is to bring the searched directory to the forefront and make it selectable so any group of au3 files can be searched. Right now, only the standard and user include directories are looked at. All that said, let me restate the main purpose: Provides a convenient desktop utility that locates a constant name (or value) in the include files. Anything more is icing ... but never forget the two-layer cake of simplicity and convenience! Well, that’s it, for now. Suggestions and advice are welcome; criticism, not so much! Lookup.zip IMPORTANT NOTE: Footnote: Mat’s functions did require one change for a compiled version to operate correctly: @AutoItExe >> $AutoItExe (“@AutoItExe is the full path and filename of the AutoIt executable currently running. For compiled scripts it is the path of the compiled script; for .a3x and .au3 files it is the path of the interpreter running the file.”) The functions must know where the actual AutoIt3.exe actually is ... and hence, where the Include files are.
    1 point
  4. MikahS

    LLH Mouse AND Keyboard?

    Hmm, didn't see you were being sarcastic at first. To bad I was trying to help, but I thought you were being nice, oh well. You gave yourself the answer then MyEarth. "This parameter can be one of the following values" and "I can choice between mouse OR keyboard with SetWindowsHookEx not both".
    1 point
  5. MikahS, My pleasure, as always. M23
    1 point
  6. hi. Try this. #include <APIDlgConstants.au3> #include <Memory.au3> #include <WinAPIDlg.au3> #include <WinAPIFiles.au3> #include <WindowsConstants.au3> Global $hHandle = DllCallbackRegister("_PrintHookProc", "INT_PTR", "hwnd;UINT;wparam;lparam") Local $tPRINTDLG = DllStructCreate($tagPRINTDLG) DllStructSetData($tPRINTDLG, 'Size', DllStructGetSize($tPRINTDLG)) DllStructSetData($tPRINTDLG, 'Flags', $PD_ENABLEPRINTHOOK) DllStructSetData($tPRINTDLG, 'FromPage', 2) DllStructSetData($tPRINTDLG, 'ToPage', 3) DllStructSetData($tPRINTDLG, 'MinPage', 1) DllStructSetData($tPRINTDLG, 'MaxPage', 9) DllStructSetData($tPRINTDLG, 'Copies', 4) DllStructSetData($tPRINTDLG, 'PrintHook', DllCallbackGetPtr($hHandle)) If Not _WinAPI_PrintDlg($tPRINTDLG) Then DllCallbackFree($hHandle) Exit EndIf ; Show results Local $hDevNames = DllStructGetData($tPRINTDLG, 'hDevNames') Local $pDevNames = _MemGlobalLock($hDevNames) Local $tDEVNAMES = DllStructCreate($tagDEVNAMES, $pDevNames) ConsoleWrite('Printer: ' & _WinAPI_GetString($pDevNames + 2 * DllStructGetData($tDEVNAMES, 'DeviceOffset'))) If DllStructGetData($tDEVNAMES, 'Default') Then ConsoleWrite(' (Default)' & @CRLF) Else ConsoleWrite(@CRLF) EndIf ConsoleWrite('First page: ' & DllStructGetData($tPRINTDLG, 'FromPage') & @CRLF) ConsoleWrite('Last page: ' & DllStructGetData($tPRINTDLG, 'ToPage') & @CRLF) ConsoleWrite('Copies: ' & DllStructGetData($tPRINTDLG, 'Copies') & @CRLF) ; Free global memory objects that contains a DEVMODE and DEVNAMES structures _MemGlobalFree(DllStructGetData($tPRINTDLG, 'hDevMode')) _MemGlobalFree($hDevNames) DllCallbackFree($hHandle) Func _PrintHookProc($hWnd, $iMsg, $wParam, $lParam) If $iMsg = $WM_INITDIALOG Then ControlHide($hWnd, "", "Button2") EndIf Return 0 EndFunc ;==>_PrintHookProc Saludos
    1 point
  7. Guy_, By all means do report possible bugs - but as I said in your earlier thread, best to post in the forum first to get others to check. And do some in depth errorchecking yourself as well, of course. M23
    1 point
  8. JohnOne

    Run Program inside GUI

    #include <WinAPI.au3> #include <GUIConstants.au3> Local $msg, $hwnd, $Nhandle $hwnd = GUICreate("hello") GUISetState() $pid = Run("notepad", "", @SW_HIDE) ProcessWait($pid) $Nhandle = WinGetHandle("Untitled - Notepad") _WinAPI_SetParent($Nhandle, $hwnd) _WinAPI_SetWindowLong($Nhandle, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE) WinMove($Nhandle, "", 0, 0) While ProcessExists($pid) $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ProcessClose($pid) EndSwitch WEnd
    1 point
  9. Try this ( N.B. i have stripped some part like the orientation/GUI and added the Const into the Func ) ; psandu.ro - PartyPooper - KaFu _ChangeScreenRes(@DesktopWidth, @DesktopHeight, 16, @DesktopRefresh) Sleep(2000) _ChangeScreenRes(@DesktopWidth, @DesktopHeight, 32, @DesktopRefresh) Func _ChangeScreenRes($i_Width = @DesktopWidth, $i_Height = @DesktopHeight, $i_BitsPP = @DesktopDepth, $i_RefreshRate = @DesktopRefresh) Local $h_DLL_user32 = DllOpen("user32.dll") Local Const $ENUM_CURRENT_SETTINGS = -1 Local Const $ENUM_REGISTRY_SETTINGS = -2 Local Const $_tag_POINTL = "long x;long y" Local Const $_tag_DEVMODE = "char dmDeviceName[32];ushort dmSpecVersion;ushort dmDriverVersion;short dmSize;" & _ "ushort dmDriverExtra;dword dmFields;" & $_tag_POINTL & ";dword dmDisplayOrientation;dword dmDisplayFixedOutput;" & _ "short dmColor;short dmDuplex;short dmYResolution;short dmTTOption;short dmCollate;" & _ "byte dmFormName[32];ushort LogPixels;dword dmBitsPerPel;int dmPelsWidth;dword dmPelsHeight;" & _ "dword dmDisplayFlags;dword dmDisplayFrequency" Local Const $DM_ORIENTATION = 0x00000001 Local Const $DM_PAPERSIZE = 0x00000002 Local Const $DM_PAPERLENGTH = 0x00000004 Local Const $DM_PAPERWIDTH = 0x00000008 Local Const $DM_SCALE = 0x00000010 Local Const $DM_COPIES = 0x00000100 Local Const $DM_DEFAULTSOURCE = 0x00000200 Local Const $DM_PRINTQUALITY = 0x00000400 Local Const $DM_POSITION = 0x00000020 Local Const $DM_DISPLAYORIENTATION = 0x00000080 Local Const $DM_DISPLAYFIXEDOUTPUT = 0x20000000 Local Const $DM_COLOR = 0x00000800 Local Const $DM_DUPLEX = 0x00001000 Local Const $DM_YRESOLUTION = 0x00002000 Local Const $DM_TTOPTION = 0x00004000 Local Const $DM_COLLATE = 0x00008000 Local Const $DM_FORMNAME = 0x00010000 Local Const $DM_LOGPIXELS = 0x00020000 Local Const $DM_BITSPERPEL = 0x00040000 Local Const $DM_PELSWIDTH = 0x00080000 Local Const $DM_PELSHEIGHT = 0x00100000 Local Const $DM_DISPLAYFLAGS = 0x00200000 Local Const $DM_NUP = 0x00000040 Local Const $DM_DISPLAYFREQUENCY = 0x00400000 Local Const $DM_ICMMETHOD = 0x00800000 Local Const $DM_ICMINTENT = 0x01000000 Local Const $DM_MEDIATYPE = 0x02000000 Local Const $DM_DITHERTYPE = 0x04000000 Local Const $DM_PANNINGWIDTH = 0x08000000 Local Const $DM_PANNINGHEIGHT = 0x10000000 Local Const $DM_DISPLAYQUERYORIENTATION = 0x01000000 Local Const $CDS_TEST = 0x00000002 Local Const $CDS_UPDATEREGISTRY = 0x00000001 Local Const $CDS_RESET = 0x40000000 Local Const $CDS_SET_PRIMARY = 0x00000010 Local Const $CDS_VIDEOPARAMETERS = 0x00000020 Local Const $CDS_ENABLE_UNSAFE_MODES = 0x00000100 Local Const $CDS_DISABLE_UNSAFE_MODES = 0x00000200 ; error 2 = EnumDisplaySettingsEx for $ENUM_CURRENT_SETTINGS failed Local Const $DISP_CHANGE_SUCCESSFUL = 0 Local Const $DISP_CHANGE_FAILED = -1 Local Const $DISP_CHANGE_BADMODE = -2 Local Const $DISP_CHANGE_NOTUPDATED = -3 Local Const $DISP_CHANGE_BADFLAGS = -4 Local Const $DISP_CHANGE_BADPARAM = -5 Local Const $DISP_CHANGE_BADDUALVIEW = -6 Local Const $DISP_CHANGE_RESTART = 1 Local Const $HWND_BROADCAST = 0xffff Local Const $WM_DISPLAYCHANGE = 0x007E If $i_Width = "" Or $i_Width = -1 Then $i_Width = @DesktopWidth ; default to current setting If $i_Height = "" Or $i_Height = -1 Then $i_Height = @DesktopHeight ; default to current setting If $i_BitsPP = "" Or $i_BitsPP = -1 Then $i_BitsPP = @DesktopDepth ; default to current setting If $i_RefreshRate = "" Or $i_RefreshRate = -1 Then $i_RefreshRate = @DesktopRefresh ; default to current setting Local $DEVMODE = DllStructCreate($_tag_DEVMODE) DllStructSetData($DEVMODE, "dmSize", DllStructGetSize($DEVMODE)) ; Using the dmFields flag of DM_DISPLAYORIENTATION, ChangeDisplaySettingsEx can be used to dynamically rotate the screen orientation. However, the DM_PELSWIDTH and DM_PELSHEIGHT flags cannot be used to change the screen resolution. Local $i_DllRet = DllCall($h_DLL_user32, "int", "EnumDisplaySettingsEx", "ptr", 0, "dword", $ENUM_CURRENT_SETTINGS, "ptr", DllStructGetPtr($DEVMODE), "dword", 0) If $i_DllRet[0] = 0 Then $i_DllRet = DllCall($h_DLL_user32, "int", "EnumDisplaySettingsEx", "ptr", 0, "dword", $ENUM_REGISTRY_SETTINGS, "ptr", DllStructGetPtr($DEVMODE), "dword", 0) EndIf #cs ConsoleWrite("dmDeviceName " & DllStructGetData($DEVMODE, "dmDeviceName") & @CRLF) ConsoleWrite("dmSpecVersion " & DllStructGetData($DEVMODE, "dmSpecVersion") & @CRLF) ConsoleWrite("dmDriverVersion " & DllStructGetData($DEVMODE, "dmDriverVersion") & @CRLF) ConsoleWrite("dmSize " & DllStructGetData($DEVMODE, "dmSize") & @CRLF) ConsoleWrite("dmDriverExtra " & DllStructGetData($DEVMODE, "dmDriverExtra") & @CRLF) ConsoleWrite("dmFields " & DllStructGetData($DEVMODE, "dmFields") & @CRLF) ConsoleWrite("dmPositionx " & DllStructGetData($DEVMODE, "dmPositionx") & @CRLF) ConsoleWrite("dmPositiony " & DllStructGetData($DEVMODE, "dmPositiony") & @CRLF) ConsoleWrite("- dmDisplayOrientation " & DllStructGetData($DEVMODE, "dmDisplayOrientation") & @CRLF) ConsoleWrite("dmDisplayFixedOutput " & DllStructGetData($DEVMODE, "dmDisplayFixedOutput") & @CRLF) ConsoleWrite("dmColor " & DllStructGetData($DEVMODE, "dmColor") & @CRLF) ConsoleWrite("dmDuplex " & DllStructGetData($DEVMODE, "dmDuplex") & @CRLF) ConsoleWrite("dmYResolution " & DllStructGetData($DEVMODE, "dmYResolution") & @CRLF) ConsoleWrite("dmTTOption " & DllStructGetData($DEVMODE, "dmTTOption") & @CRLF) ConsoleWrite("dmCollate " & DllStructGetData($DEVMODE, "dmCollate") & @CRLF) ConsoleWrite("dmFormName " & DllStructGetData($DEVMODE, "dmFormName") & @CRLF) ConsoleWrite("dmLogPixels " & DllStructGetData($DEVMODE, "dmLogPixels") & @CRLF) ConsoleWrite("dmBitsPerPel " & DllStructGetData($DEVMODE, "dmBitsPerPel") & @CRLF) ConsoleWrite("dmPelsWidth " & DllStructGetData($DEVMODE, "dmPelsWidth") & @CRLF) ConsoleWrite("dmPelsHeight " & DllStructGetData($DEVMODE, "dmPelsHeight") & @CRLF) ConsoleWrite("dmDisplayFlags " & DllStructGetData($DEVMODE, "dmDisplayFlags") & @CRLF) ConsoleWrite("dmDisplayFrequency " & DllStructGetData($DEVMODE, "dmDisplayFrequency") & @CRLF & @CRLF) #ce If @error Then $DEVMODE = 0 SetError(1) Return 1 Else $i_DllRet = $i_DllRet[0] EndIf If $i_DllRet <> 0 Then DllStructSetData($DEVMODE, "dmPelsWidth", $i_Width) DllStructSetData($DEVMODE, "dmPelsHeight", $i_Height) DllStructSetData($DEVMODE, "dmBitsPerPel", $i_BitsPP) DllStructSetData($DEVMODE, "dmDisplayFrequency", $i_RefreshRate) $i_DllRet = DllCall($h_DLL_user32, "int", "ChangeDisplaySettingsEx", "ptr", 0, "ptr", DllStructGetPtr($DEVMODE), "hwnd", 0, "int", $CDS_TEST, "ptr", 0) If @error Then $DEVMODE = 0 SetError(2) Return 2 Else $i_DllRet = $i_DllRet[0] EndIf Select Case $i_DllRet = $DISP_CHANGE_SUCCESSFUL $i_DllRet = DllCall($h_DLL_user32, "int", "ChangeDisplaySettingsEx", "ptr", 0, "ptr", DllStructGetPtr($DEVMODE), "hwnd", 0, "int", $CDS_UPDATEREGISTRY, "ptr", 0) If @error Then $DEVMODE = 0 SetError(2) Return 3 Else $i_DllRet = $i_DllRet[0] EndIf If $i_DllRet <> $DISP_CHANGE_SUCCESSFUL Then $DEVMODE = 0 SetError($i_DllRet) Return 3 EndIf Return 0 ; Success ! Case Else $DEVMODE = 0 SetError($i_DllRet) Return 2 EndSelect EndIf $DEVMODE = 0 SetError(2) Return 1 EndFunc ;==>_ChangeScreenRes '?do=embed' frameborder='0' data-embedContent>>
    1 point
  10. Something like this >> Local $sHelpPath = "C:Program FilesAutoItSciTE" Run('"' & @WindowsDir & 'hh.exe" "' & $sHelpPath & 'Scite4AutoIt3.chm::/SciTEJump_Doc.htm"'
    1 point
  11. #include <GuiConstants.au3> GUICreate("Example") $label = GuiCtrlCreateButton("3456789:;<=", 10, 10, 200, 40) GuiCtrlSetFont($label, 12, 800, 0, "Webdings") GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WendBy the way, run charmap from the start menu and copy and paste the characters. Wingdings is another font to look at.
    1 point
×
×
  • Create New...