Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/24/2016 in all areas

  1. controlspy is almost 10 years old and not sure how you can use this for all .NET stuff See some references here I collected till about 2012 http://ewildsch.home.xs4all.nl/testautomation.htm Nowadays on windows I would use the IUIAutomation stuff (see examples section) as that covers most things you do with control spy To complete your post Control spy Spy Exposes the Clandestine Life of Windows Common Controls, Part I http://www.microsoft.com/msj/0798/controlspy.aspx Control Spy Exposes the Clandestine Life of Windows Common Controls, PartII http://www.microsoft.com/msj/0998/control/control.aspx Spy Exposes the Clandestine Life of Windows Common Controls, Part III http://www.microsoft.com/msj/1298/controlspy3/controlspy3.aspx API Hooking http://www.codeproject.com/Articles/2082/API-hooking-revealed
    2 points
  2. This mysterious is your AV software Add "C:\Users\usrname\AppData\Local\AutoIt v3\Aut2exe" To exceptions.
    2 points
  3. according to: https://en.wikipedia.org/wiki/Menu_key and https://msdn.microsoft.com/pl-pl/library/ms927178.aspx VK_APPS 5D Applications key on a Microsoft Natural Keyboard So this example should looks like this: #include <Misc.au3> #include <MsgBoxConstants.au3> Local $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("5D", $hDLL) Then Sleep(100) msgbox(0,"Test", "Pressed!") Sleep(250) EndIf WEnd DllClose($hDLL) btw. HelpFile for _IsPressed() should be extended, I mean this following information: VK_APPS 5D Applications key on a Microsoft Natural Keyboard should be added.
    1 point
  4. water

    Problem with the .exe

    Do not turn it off, just exclude the directory/exe causing the problem. Check the AV logs and see what it tells you. BTW: Which AV software do you run?
    1 point
  5. water

    Problem with the .exe

    Insert a MsgBox statement at the top of your script so you know it is started at all. If you do not get a MsgBox then it might be a problem with your Antivirus software.
    1 point
  6. Thanks argumentum, I hadn't thought of that even though I sometimes use 2 monitors myself. I've changed the code but it might not survive long.
    1 point
  7. Example with callback... #include <WinAPIRes.au3> #include <WinAPISys.au3> #include <WindowsConstants.au3> Local Const $sClass = 'MyWindowClass' Local Const $sName = 'Test ' & StringReplace(@ScriptName, '.au3', '()') Global $g_bExit = False ; Get module handle for the current process Local $hInstance = _WinAPI_GetModuleHandle(0) ; Create a class cursor Local $hCursor = _WinAPI_LoadCursor(0, 32512) ; IDC_ARROW ; Create a class icons (large and small) Local $tIcons = DllStructCreate('ptr;ptr') _WinAPI_ExtractIconEx(@SystemDir & '\shell32.dll', 130, DllStructGetPtr($tIcons, 1), DllStructGetPtr($tIcons, 2), 1) Local $hIcon = DllStructGetData($tIcons, 1) Local $hIconSm = DllStructGetData($tIcons, 2) ; Create DLL callback function (window procedure) Local $hProc = DllCallbackRegister('_WndProc', 'lresult', 'hwnd;uint;wparam;lparam') ; Create and fill $tagWNDCLASSEX structure Local $tWCEX = DllStructCreate($tagWNDCLASSEX & ';wchar szClassName[' & (StringLen($sClass) + 1) & ']') DllStructSetData($tWCEX, 'Size', DllStructGetPtr($tWCEX, 'szClassName') - DllStructGetPtr($tWCEX)) DllStructSetData($tWCEX, 'Style', 0) DllStructSetData($tWCEX, 'hWndProc', DllCallbackGetPtr($hProc)) DllStructSetData($tWCEX, 'ClsExtra', 0) DllStructSetData($tWCEX, 'WndExtra', 0) DllStructSetData($tWCEX, 'hInstance', $hInstance) DllStructSetData($tWCEX, 'hIcon', $hIcon) DllStructSetData($tWCEX, 'hCursor', $hCursor) DllStructSetData($tWCEX, 'hBackground', _WinAPI_CreateSolidBrush(_WinAPI_GetSysColor($COLOR_3DFACE))) DllStructSetData($tWCEX, 'MenuName', 0) DllStructSetData($tWCEX, 'ClassName', DllStructGetPtr($tWCEX, 'szClassName')) DllStructSetData($tWCEX, 'hIconSm', $hIconSm) DllStructSetData($tWCEX, 'szClassName', $sClass) ; Register a window class _WinAPI_RegisterClassEx($tWCEX) ; Create a window _WinAPI_CreateWindowEx(0, $sClass, $sName, BitOR($WS_CAPTION, $WS_POPUPWINDOW, $WS_VISIBLE), (@DesktopWidth - 400) / 2, (@DesktopHeight - 400) / 2, 400, 400, 0) While 1 Sleep(100) If $g_bExit Then ExitLoop EndIf WEnd ; Unregister window class and release unnecessary resources _WinAPI_UnregisterClass($sClass, $hInstance) _WinAPI_DestroyCursor($hCursor) _WinAPI_DestroyIcon($hIcon) _WinAPI_DestroyIcon($hIconSm) DllCallbackFree($hProc) ; Func _WinAPI_DefWindowProcW($hWnd, $iMsg, $wParam, $lParam) ; Local $aRet = DllCall('user32.dll', 'lresult', 'DefWindowProcW', 'hwnd', $hWnd, 'uint', $iMsg, 'wparam', $wParam, 'lparam', $lParam) ; If @error Then ; Return SetError(1, 0, 0) ; EndIf ; Return $aRet[0] ; EndFunc ;==>_WinAPI_DefWindowProcW Func _WndProc($hWnd, $iMsg, $wParam, $lParam) Switch $iMsg Case $WM_CLOSE $g_bExit = True Case $WM_CREATE ConsoleWrite("Create" & @CRLF) Case $WM_PAINT ConsoleWrite("Paint" & @CRLF) EndSwitch Return _WinAPI_DefWindowProcW($hWnd, $iMsg, $wParam, $lParam) EndFunc ;==>_WndProc Saludos
    1 point
  8. Simple snowfall using GDI+ & ASM. Thanks to Eukalyptus for the ASM codes. If the script runs too slow reduce the amount of flakes in line 115. You can switch now between local MP3 stream and internet stream. Further you can also set the scrolling text. Command line options: -local "<path to local MP3 file>" -url "<URL to a MP3 file>" -text "<your individual text>" Max. text length are 500 chars. Don't forget the double quotes after the parameters! Download: click me Happy snowing and romantic moments...
    1 point
  9. water

    Local Static Var

    Me too. Posting the final solution to a problem is helpful for others users in the future. It's forum Netiquette.
    1 point
  10. mikell

    Local Static Var

    Yes, and also insist when solved on posting the final working code In this case it would be explanatory to see this 'running smooth' one
    1 point
  11. argumentum, Brilliant! and here I was attempting to stuff json into an array with little success. Attached is an example of my data - it takes some time but then the end is an array of over 20,000 lines. So much better and reliable than parsing using regular expressions etc. Thanks ever so... cma-cases.json
    1 point
  12. Danyfirex

    Hbitmap draw to picture

    Hi. something like this. #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <ScreenCapture.au3> Example() Func Example() Local $hGUI, $hBMP, $hBitmap, $hGraphic,$hImagePic ; Capture upper left corner of screen $hBMP = _ScreenCapture_Capture("", 0, 0, 300, 300) ; Create GUI $hGUI = GUICreate("GDI+", 800, 600) $hImagePic=GUICtrlCreatePic("",30,30,300,300) GUISetState(@SW_SHOW) ; Initialize GDI+ library _GDIPlus_Startup() ; Draw bitmap to GUI $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBMP) $hGraphic = _GDIPlus_GraphicsCreateFromHWND(GUICtrlGetHandle($hImagePic)) _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 0) ; Clean up resources _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_BitmapDispose($hBitmap) _WinAPI_DeleteObject($hBMP) ; Shut down GDI+ library _GDIPlus_Shutdown() ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>Example Exit Saludos
    1 point
  13. At first, you forgot to initialize the Enter and Escape key. Because of that, it would never do anything. I have rewritten your Example and Edited my UDF, so you can pass your own Accelerator-Array (Except Enter and ESC. There you must give a function instead of the Control) At the moment I have not enough time to edit the whole UDF, but after 16.02.2016 you can look there, I think I will add multiple Guis and Remove the use of Accelerators then. YourProject.zip
    1 point
  14. Xandy

    Backup Script

    WARNING: I never tried this on a root directory, I should probably write a fix for that case. EX: There is no C:\..\ I don't know how many of these there are on this forum and I know Tidy is real nice for making backups. I have a few dislikes relying on the Tidy backup: 1 I'm not crazy about the backup folder it creates in project folder. 2. If no Tidy edits are performed script is not backed up on Tidy. I can't rely on that when I request a backup. 3. If I want to backup a select group of files without backing up the entire project folder, it is somewhat tedious to select each file and Tidy. Now this is just a very simple script that I felt I could use to simplify backing up my project. I'm not asking you to code it for me, but I welcome feedback. If you think you can make it better or know of something better please share. I know of Github it's overkill for me, I'm not comfortable, and I won't use it as much as I need to. So here it is: You place it in the source folder, open it in Scite. Change: Global $gBackup_dir_path = "..\Backup\" to wherever you want you backup folder Path to be. in the main() add some backup("file_name") calls remember to remove file extension. and it should make a new backup file for each backup("file_name") every time you run the script. Test it out make sure it's working and you're good to go. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: To copy files to a backup folder. #ce ---------------------------------------------------------------------------- #include <File.au3> Global $gBackup_dir_path = "..\Backup\" ; Todo ; Add notes, options notes in file name main() func main() ; File list remember to remove extentions from file_name ; or add file extention as second parameter backup("Map_Editor") backup("DW_Server") EndFunc Func backup($spFile_name, $spFile_ext = ".au3") Local $error = 0 Local $iFile_num = 0 ; Make source file path Local $sFile_path_source = $spFile_name & $spFile_ext Local $sFile_path_dest = "" ; Sample the contents of the backup directory before creating a file there Local $aFile = _FileListToArray($gBackup_dir_path, $spFile_name&"*"&$spFile_ext, $FLTA_FILES) $error = @error If $error = 0 Then $iFile_num = $aFile[0] EndIf out("Found: " & $iFile_num & " files named: " & $spFile_name) Do ; Incroment file_num to find available file_name $iFile_num += 1 ; Path to Write File Copy $sFile_path_dest = $gBackup_dir_path & $spFile_name & "_" & $iFile_num & $spFile_ext ; Refuse to Overwrite File If FileExists($sFile_path_dest) = 0 Then ExitLoop EndIf ; Am I right? Sleep(30) Until 0 ; Create the file FileCopy($sFile_path_source, $sFile_path_dest, $FC_CREATEPATH) $error = @error If $error Then out("FileCopy() error: " & $error) out("sFile_path_source: " & $sFile_path_source & " sFile_path_dest: " & $sFile_path_dest) EndFunc ;==>backup Func out($output = "", $user = 0);debug tool ConsoleWrite(@CRLF & $output);to console new line, value of $output EndFunc ;==>out Backup_Script.au3 The script isn't authorized to overwrite files, and tries to create the next number of file_name available. The 'p' in my variable names stands for parameter.
    1 point
  15. New version uploaded: Added a basic scroller for some warm words and enabled command line options. You can switch now between local MP3 stream and internet stream. Further you can also set the scrolling text. Command line options: -local "<path to local MP3 file>" -url "<URL to a MP3 file>" -text "<your individual text>" Max. text length are 500 chars. Don't forget the double quotes after the parameters! Now "We wish you a merry christmas" is the default MP3 internet stream. -> Thx goes to Chimp! Adding chimney smoke was not possible because it takes too much CPU usage and the FPS will dramatically decrease.
    1 point
  16. here you can find nice free music... http://incompetech.com/ for those who like classic christmas music here is a link to go: http://incompetech.com/music/royalty-free/mp3-royaltyfree/We%20Wish%20You.mp3 i like this as background... http://incompetech.com/music/royalty-free/mp3-royaltyfree/OctoBlues.mp3
    1 point
×
×
  • Create New...