ZenMastah Posted April 10, 2012 Share Posted April 10, 2012 Hi, I would like a script that is similar to the 1 below but what i want is when the process pauses, i want a message box to open and when i press the OK button that message box the process resumes. Func _ProcessSuspend($dekaron.exe) $processid = ProcessExists($dekaron.exe) If $processid Then $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid) $i_sucess = DllCall("ntdll.dll","int","NtSuspendProcess","int",$ai_Handle[0]) DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) If IsArray($i_sucess) Then Return 1 Else SetError(1) Return 0 Endif Else SetError(2) Return 0 Endif EndFunc Func _ProcessResume($dekaron.exe) $processid = ProcessExists($dekaron.exe) If $processid Then $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid) $i_sucess = DllCall("ntdll.dll","int","NtResumeProcess","int",$ai_Handle[0]) DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) If IsArray($i_sucess) Then Return 1 Else SetError(1) Return 0 Endif Else SetError(2) Return 0 Endif EndFunc Link to comment Share on other sites More sharing options...
JohnOne Posted April 10, 2012 Share Posted April 10, 2012 Assuming those functions work then write your own pause function Something like Func _Pause($dekaron.exe) _ProcessSuspend($dekaron.exe) MsgBoX(Blah) _ProcessResume($dekaron.exe) Endfunc AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
ZenMastah Posted April 10, 2012 Author Share Posted April 10, 2012 Assuming those functions work then write your own pause functionSomething likeFunc _Pause($dekaron.exe)_ProcessSuspend($dekaron.exe)MsgBoX(Blah)_ProcessResume($dekaron.exe)EndfuncIm no good at writing scripts.Hence why i am posting this in the Help & Support section....your post did not help and was useless....Please if u havent got help for me then dont post Link to comment Share on other sites More sharing options...
JohnOne Posted April 10, 2012 Share Posted April 10, 2012 No it was'nt, it is a near enough complete function you melt. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
guinness Posted April 10, 2012 Share Posted April 10, 2012 Im no good at writing scripts.Hence why i am posting this in the Help & Support section....your post did not help and was useless....Please if u havent got help for me then dont postPardon? You have no right to tell users who can and can't post, this isn't how the Help forum works I'm afraid, which by the way JohnOne did provide an answer. Also I did a little searching and 'dekaron' appears to be a game, so I suggest you read the Forum rules before you start your time here on the forum. Thanks. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
ZenMastah Posted April 10, 2012 Author Share Posted April 10, 2012 Ok, well......With the script i have managed to get from this forum all i got is thisexpandcollapse popupDo $processid = ProcessExists($process) Until $processid = 1 Func _ProcessSuspend($process) If $processid = 1 Then $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid) $i_sucess = DllCall("ntdll.dll","int","NtSuspendProcess","int",$ai_Handle[0]) DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) MsgBox ( 262144, @ScriptName, "Processes have been suspended!`n`n Press OK when you are done" [, [, hwnd]] ) If IsArray($i_sucess) Then Return 1 Else SetError(1) Return 0 Endif Else SetError(2) Return 0 Endif EndFunc Func _ProcessResume($process) $processid = ProcessExists($process) If $processid Then $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid) $i_sucess = DllCall("ntdll.dll","int","NtResumeProcess","int",$ai_Handle[0]) DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) If IsArray($i_sucess) Then Return 1 Else SetError(1) Return 0 Endif Else SetError(2) Return 0 Endif EndFuncBut when i run it....it gives me this error http://img221.imageshack.us/img221/9806/errorpdunqvt.pngIf i have it set to this...Func _ProcessSuspend($process) Do $processid = ProcessExists($process) Until $processid = 1...the script just automatically closes less than 1 millisecond after starting.What am i doing wrong to make it automatically close or give me that error Link to comment Share on other sites More sharing options...
JohnOne Posted April 10, 2012 Share Posted April 10, 2012 This Do $processid = ProcessExists($process) Until $processid = 1 Is the only part of the script that does anything, and it should give you an error about not knowing what $process is. Then if you do have a process assigned to that, the PID is unlikely to be 1. First thing you should do is open the help file on the page of any function you are attempting to use and read and understand it with the help of it's example before you continue. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
yones7x Posted April 10, 2012 Share Posted April 10, 2012 (edited) Are you want this? expandcollapse popup$ProcessName = "mspaint.exe" ;Microsoft Paint _ProcessSuspend($ProcessName) MsgBox(262144+64, "yones7x", "press OK For Resume Process !") _ProcessResume($ProcessName) Func _ProcessSuspend($ProcessS) $processid = ProcessExists($ProcessS) If $processid Then $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid) $i_sucess = DllCall("ntdll.dll","int","NtSuspendProcess","int",$ai_Handle[0]) DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) If IsArray($i_sucess) Then Return 1 Else SetError(1) Return 0 Endif Else SetError(2) Return 0 EndIf EndFunc Func _ProcessResume($ProcessR) $processid = ProcessExists($ProcessR) If $processid Then $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid) $i_sucess = DllCall("ntdll.dll","int","NtResumeProcess","int",$ai_Handle[0]) DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) If IsArray($i_sucess) Then Return 1 Else SetError(1) Return 0 Endif Else SetError(2) Return 0 Endif EndFunc Edited April 10, 2012 by yones7x Link to comment Share on other sites More sharing options...
ZenMastah Posted April 10, 2012 Author Share Posted April 10, 2012 Are you want this? expandcollapse popup$ProcessName = "mspaint.exe" ;Microsoft Paint _ProcessSuspend($ProcessName) MsgBox(262144+64, "yones7x", "press OK For Resume Process !") _ProcessResume($ProcessName) Func _ProcessSuspend($ProcessS) $processid = ProcessExists($ProcessS) If $processid Then $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid) $i_sucess = DllCall("ntdll.dll","int","NtSuspendProcess","int",$ai_Handle[0]) DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) If IsArray($i_sucess) Then Return 1 Else SetError(1) Return 0 Endif Else SetError(2) Return 0 EndIf EndFunc Func _ProcessResume($ProcessR) $processid = ProcessExists($ProcessR) If $processid Then $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid) $i_sucess = DllCall("ntdll.dll","int","NtResumeProcess","int",$ai_Handle[0]) DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) If IsArray($i_sucess) Then Return 1 Else SetError(1) Return 0 Endif Else SetError(2) Return 0 Endif EndFunc I'll give it a try. Link to comment Share on other sites More sharing options...
yones7x Posted April 10, 2012 Share Posted April 10, 2012 I'll give it a try.Ok ! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 10, 2012 Moderators Share Posted April 10, 2012 ZenMastah,As guinness pointed out earlier, $dekaron.exe appears to be a game. Please read the Forum Rules before you post again. And if and when you post again, lose the attitude. M23 yones7x 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts