Leaderboard
Popular Content
Showing content with the highest reputation on 10/14/2016 in all areas
-
FreeBasic Graphical Examples build 2019-05-08
argumentum and one other reacted to UEZ for a topic
Here some graphical examples written completely in FreeBasic just for fun. _WinAPI_SetWindowTitleIcon Check for Numeric Entry in an EditBox using RegEx CreateWindowEx (hGUI) Example FB 3D Starfield Rotating Flight FB File2Bas Code Generator FB Fire Particles FB Fireworks FB GFX Examples FB Image to Trapezoid Transformation FB Layered Parallax Effect FB Plasma FB Puristic Clock FB Rotating Cube FB Rotating Earth FB Rutt Etra Izer Effect FB Simple Recursive Tree Generator FB Snowfall FB Tunnel Flight FB Water Effect FMOD Examples GDI - GDI+ 3D Sinus Wave GDI - GDI+ Animated Pythagoras Tree GDI - GDI+ Bezier Lines GDI - GDI+ Particles - Repulsive Force Sim v2.0 GDI - GDI+ Plasma v5 Booster GDI - GDI+ Random Pattern GDI - GDI+ Space Flight GDI - GDI+ Tunnel Flight - WipeOut Style GDI Classic Raytraced Tunnel GDI Elastic Twister Effect GDI Exploding Pixels GDI Infinite Image Zoom Flight GDI Liquid Pixels GDI Mandelbrot GDI Particle Repulsion Grid GDI Particles Mouse Attraction GDI Starfield GDI The Nautilus Raymarcher GDI Worm Tunnel Flight GDI+ 3D Starfield Scrolling v1 Booster GDI+ 3D Starfield Scrolling v3 Booster GDI+ Convert Bitmap to ASCII GDI+ GIF Anim to ASCII Player GDI+ Image Painting GDI+ Impossible Possible GDI+ Kaleidoscope GDI+ Performance Test - Au3 vs FB GDI+ Polar Clock GDI+ Rotating Earth GDI+ Spiral Text GDI+ Star Wars Scroller GDI+ Streamer GDI+ Swiss Railway Clock GDI+ The MATRIX Ini Read - Write Rutt_Etra_Izer_Booster Stack TitchySID uFMOD Download: FreeBasic Examples build 2019-05-08.rar I will add new examples from time to time. FreeBasic source codes are also included.2 points -
Your uploaded image has a dim. of 624 x 796 pixels (96 dpi) -> 16.5 x 21.0 cm; 6.48 x 8.28 inches. On a DIN A4 paper and portrait format it takes approx. 66% of the paper. When you print that image from an ext. program such as IrfanView for example, how is the print out quality? From https://www.prepressure.com/library/paper-size/din-a4:1 point
-
Read Date From menu
abdulrahmanok reacted to AutoBert for a topic
You are mixing 2 difernetly ways to solve. If you would try my solution, than run script as i posted in https://www.autoitscript.com/forum/topic/185030-read-date-from-menu/?do=findComment&comment=1328997 using IE_Snipet.txt After change my script replacing line 3 with this 2 lines: $oIE=_IECreate('YourUrl') ;change to your real URL $sText=_IEBodyReadHTML($oIE) and run again. In both cases you get a array with the dates: IE_Snipet.txt1 point -
Hello. another example from a no regexp expert. Local $sText = '2016/10/14 07:31:09">07:31' MsgBox(0, "", _GetTime($sText)) Func _GetTime($String) Local $aReg = StringRegExp($String, '([0-9]+):([0-5][0-9]):([0-5][0-9])', 2) Return UBound($aReg) ? $aReg[0] : "" EndFunc ;==>_GetTime Saludos1 point
-
As I'm not a regex expert: Local $sText = '2016/10/14 07:31:09">07:31' MsgBox(0, "", StringRegExpReplace($sText, '.*\h(.+?)".*', "$1"))1 point
-
Hello. I did this. #include <Array.au3> Local $aDisk = _GetDiskName() _ArrayDisplay($aDisk) Func _GetDiskName() Local $iCount = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\disk\Enum", "Count") Local $sDiskKey = "" Local $sDiskName = "" Local $aDisk[$iCount] For $i = 1 To $iCount $sDiskKey = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\disk\Enum", String($i - 1)) $sDiskName = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\" & $sDiskKey, "FriendlyName") $aDisk[$i - 1] = $sDiskName Next Return $aDisk EndFunc ;==>_GetDiskName Saludos1 point
-
Don't encrypt strings. Why would you want to do that? Think outside the box. For example, does this work for you: #AutoIt3Wrapper_Run_AU3Check=n #include <GUIConstantsEx.au3> $_ = Execute $_ = ($_) (Chr(Random(64 + SRandom(-2139808481), 122, 1)) & Chr(Random(65, 122, 1)) & Chr(Random(65, 122, 1)) & Chr(Random(65, 122, 1)) & Chr(Random(65 + SRandom(-2139808481), 122, 1)) & Chr(SRandom(-2138722446) - 1 + Random(65, 122, 1)) & Chr(Random(65, 122, 1)) & Chr(Random(65, 122, 1)) & Chr(Random(65, 122, 1))) ("{EE09B103-97E0-11CF-978F-00A02463E06F}") $_(-1) = $_ $_(40) = $_(-1) $_(0) = GUICreate $_(1) = GUICtrlCreateButton $_(2) = GUISetState $_(3.1) = @SW_SHOW $_(Random(1, 1000, 1)) = Example $_(6) = $GUI_EVENT_CLOSE $_(7) = GUIDelete $_(8) = $GUI_EVENT_CLOSE $_(9) = "Example" $_(10) = "OK" $_(Random(1, 1000, 1)) = GUIGetMsg $_(Random(1, 1000, 1)) = $_(-1) $_(16 + 1) = -1 $_(13 + $_(20 - 3)) = $_(-1) (598) ($_(310)) () Func Example() Local $hGUI = ($_($_(-5 + 4) (-1 + 18)) (56 - 67 + 11)) (($_(91 - 82))) Local $idOK = ($_(1)) ((($_($_(598) (11 + 6))) (101 - 91)), 310, 370, 85, 25) ($_(-11 + 10) (1 + 1)) (($_(598) (3 + .1)), $hGUI) While 1 Switch ($_(598) (269)) () Case ($_(2 * 4)), $idOK ExitLoop EndSwitch WEnd ($_($_(10 + 7)) (7)) ($hGUI) EndFunc ...if yes then what's the code? This is super simple obfuscation method that makes it impossible to be passed through universal deobfuscator if implemented correctly. Variation of the method is used here for only a piece of the script. Can you deobfuscate it?1 point
-
Run this small example: #include <Array.au3> #include <GuiToolBar.au3> $sSearchtext='Lautsprecher: 100%' ;change to your needs $iButton=Get_SysTray_IconText($sSearchtext) MsgBox (64,'Searched Button','Button: '&$iButton&@CRLF&'Instance: '&@extended) Func Get_SysTray_IconText($sSearch) Local $hSysTray_Handle For $i = 1 To 99 ; Find systray handles $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:' & $i & ']') If @error Then ;MsgBox(16, "Error", "System tray not found") ExitLoop EndIf ; Get systray item count Local $iSysTray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSysTray_ButCount = 0 Then ;MsgBox(16, "Error", "No items found in system tray") ContinueLoop EndIf Local $aSysTray_ButtonText[$iSysTray_ButCount] ; Look for wanted tooltip For $iSysTray_ButtonNumber = 0 To $iSysTray_ButCount - 1 If $sSearch= _GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSysTray_ButtonNumber) Then _ Return SetError(0, $i, $iSysTray_ButtonNumber) Next Next Return SetError(1, -1, -1) EndFunc ;==>Get_SysTray_IconText Exit it returns: succes: the ButtonNumber and in @extended the instance of the toolbarwindow. failur: -1 @error -1 and @extended -11 point
-
Help with enter text in Internet Explorer
Muhammad_Awais_Sharif reacted to GeorgeSA for a topic
Thanks for the reply. As far as I can tell the input is in a frame called "Alpha_Wan" which is within a frame called "main". I suspect I need to tell autoit to look within these frames but I don't know how to do that.1 point -
Help with enter text in Internet Explorer
Muhammad_Awais_Sharif reacted to genius257 for a topic
Is the input ( "wan_PPPUsername" ) in a form? If yes, is the form within a iframe or something similar?1 point -
Descending sort order and this static row: Virtual ListViews.7z Since the structures are only being used for sorting, you can achieve a performance gain by replacing structures with arrays after the sorting. Then you can use arrays in the WM_NOTIFY function instead of structures. An array lookup is at least twice as fast as a structure lookup. The more columns you have, the bigger the performance gain will be. Also the SortChecks function will probably be twice as fast. But you'll need a little bit of logic to handle the static row.1 point
-
Yeah ...i know...my english is from hell1 point
-
1 point
-
#1 First of all please note that all the example above doesn't close the opened handle to the process. That'll be correctly: DllCall('kernel32.dll', 'ptr','CloseHandle', 'ptr',$ai_Handle[0]) #2 Second thing NtSuspendProcess and NtResumeProcess are undocumented functions - means that microsoft doesn't have them in their Win32-API documentation - >More[https://social.msdn.microsoft.com/forums/windowsdesktop/en-us/b5c5121c-bf48-47bd-b612-e2f61c5e5d82/ntsuspendprocess] A more 'official' way would be to use DebugActiveProcess(PID) + DebugSetProcessKillOnExit(0) and DebugActiveProcessStop(PID) to suspend or resume a process. See ->_ProcessSuspendResume2 in the following example (you'll maybe need to scroll down a little ) on how it's being used. #3 The direct use of literals like this ... 'OpenProcess', 'int', 0x1f0fff, ... is really ugly sloppy coding style - use constants or even better include them. Like this: #include <ProcessConstants.au3> ... 'OpenProcess', 'int', $PROCESS_ALL_ACCESS , ... it'll be much better readable. Okay now here it is a small usefull app to'll bring back the 'pause' key from the dos era into Windows. Pressing PAUSE will suspend the current active process(<= the currently active windows is running in ) Pressing PAUSE again will resume it. #include <WinAPI.au3> #include <ProcessConstants.au3> Func _ProcessSuspendResume($iPIDorName, $iSuspend = True) If IsString($iPIDorName) Then $iPIDorName = ProcessExists($iPIDorName) If Not $iPIDorName Then Return SetError(2, 0, 0) ; Consider using $PROCESS_SUSPEND_RESUME = 0x00000800 instead of $PROCESS_ALL_ACCESS Local $ai_Handle = _WinAPI_OpenProcess( $PROCESS_ALL_ACCESS, False, $iPIDorName ) ;Local $ai_Handle = DllCall("kernel32.dll", 'int','OpenProcess', 'int', 0x1f0fff, 'int',False, 'int',$iPIDorName)[0] ; Note: "NtSuspendProcess" is an undocumented API Local $i_sucess = DllCall("ntdll.dll","int","Nt" & ($iSuspend ? "Suspend" : "Resume") & "Process" _ ,"int",$ai_Handle) _WinAPI_CloseHandle($ai_Handle) ;DllCall('kernel32.dll', 'ptr','CloseHandle', 'ptr',$ai_Handle) If IsArray($i_sucess) Then Return 1 Return SetError(1, 0, 0) EndFunc ;==>_ProcessSuspendResume <-based on: http://autoitscript.com/forum/topic/32975-process-suspendprocess-resume-udf/ Func TogglePause() $g_bPaused = Not $g_bPaused ;~ $PIDorName = $TARGET_PROCESSNAME $PIDorName = WinGetProcess("[ACTIVE]") _ProcessSuspendResume($PIDorName, $g_bPaused) EndFunc ;==>TogglePause ; The more 'offical' & easy way (http://stackoverflow.com/a/11010508/3135511) Func _ProcessSuspendResume2($iPIDorName, $iSuspend = True) If IsString($iPIDorName) Then $iPIDorName = ProcessExists($iPIDorName) If Not $iPIDorName Then Return SetError(2, 0, 0) if $iSuspend then ;Note Opens Process with PROCESS_ALL_ACCESS DllCall('kernel32.dll','ptr','DebugActiveProcess','int',$iPIDorName) ; you may leave out DebugSetProcessKillOnExit; however then your supended App will also Exit when you quit this AutoIt App DllCall('kernel32.dll','ptr','DebugSetProcessKillOnExit','int',False) Else DllCall('kernel32.dll','ptr','DebugActiveProcessStop','int',$iPIDorName) EndIf EndFunc ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Global Const $APP_NAME = "Pause for Windows" Global Const $TARGET_PROCESSNAME = "Kingdom Rush.exe" ; Base on the 'HotKeySet' sample from the AutoIt help ; Press Esc to terminate script, Pause/Break to "pause" Global $g_bPaused = False HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("+!h", "ShowMessage") ; Shift-Alt-h While 1 Sleep(100) WEnd Func Terminate() Exit EndFunc ;==>Terminate Func ShowMessage() MsgBox($MB_SYSTEMMODAL, APP_NAME & " - Help", "Press the >Pause< Key to your keyboard to suspend the current Process" & @CRLF & _ "(= the one whose windows is active)." & @CRLF & _ "Press >Pause< again to resume it.") EndFunc ;==>ShowMessage ^-Really neat for games like Kingdom rush that doesn't have a pause function (or like this one the pause hides too much of the gaming screen) or image you've a cpu intensive app like a packer that doesn't have a 'Pause' Key. Limitiations of code above: * Does take care for the case that you might change to another process * Alt+shift+h gives an error to fix move the 'Global Const $APP_NAME' just to the beginning Man what a stupid limitation why global's can be a the end or between functions? Anyway In the attached file I already fixed this (But for the post this gets somehow much overhead - since the focus should be here on supend/resume a process) _________________________________________________________________________________ Offtopic And one other thing I noticed it's about the Ternary-operator like this: "Nt" & ($iSuspend ? "Suspend" : "Resume") in the current AutoIT Help file it is not missing in the section that 'talks' about operator precedence.(autoit.chm::/html/intro/lang_operators.htm) PauseForWindows.au31 point
-
Array delete blank element
beautifulsoup reacted to Bowmore for a topic
An example of how to remove blanks using only the original array. Func _ArryRemoveBlanks(ByRef $arr) $idx = 0 For $i = 0 To UBound($arr) - 1 If $arr[$i] <> "" Then $arr[$idx] = $arr[$i] $idx += 1 EndIf Next ReDim $arr[$idx] EndFunc ;==>_ArryRemoveBlanks ;Some code just to show it working #include <array.au3> Dim $arr1[10] $arr1[0] = "" $arr1[1] = "ABC" $arr1[2] = "" $arr1[3] = "xyz" $arr1[4] = "def" $arr1[5] = "" $arr1[6] = "" $arr1[7] = "ffr" $arr1[8] = "" $arr1[9] = "Z33" _ArrayDisplay($arr1, "Before") _ArryRemoveBlanks($arr1) _ArrayDisplay($arr1, "After")1 point -
If you have big arrays I suggest you to do the following: #include <array.au3> dim $arr1[4] $arr1[0]="" $arr1[1]="ABC" $arr1[2]="" $arr1[3]="xyz" $s_array = _ArrayToString($arr1, "|") $s_array = StringReplace($s_array, "||", "|") $arr2 = StringSplit($s_array, "|", 2) It is much faster than _ArrayDelete() because you don't have to redim the array all the time.1 point