thevalo Posted July 14, 2015 Share Posted July 14, 2015 Hello everyone.I just registered on this forum. Well, as I see AutoIt fits my needs, but I need a little help over here. I'll try to explain as best as I can.How it is possible to:With AutoIt, get PID of process, then, save that PID as a label or whatever, then send %PID% to a program.Definitely - Get PID from image name, then send THAT PID to program of which location is C:\someprogram.exe. Yours,thevalo Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 14, 2015 Moderators Share Posted July 14, 2015 Hi, thevalo, welcome to the forum. Look at WinGetProcess in the help file to get a PID. Try out the example for yourself, and then if you have issues, please post your code and we will do our best to assist. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
thevalo Posted July 14, 2015 Author Share Posted July 14, 2015 Thank you for response.Actually as I see the WinGetProcess only gets PID of window/titles, I want to get PID of process. Link to comment Share on other sites More sharing options...
JohnOne Posted July 14, 2015 Share Posted July 14, 2015 ProcessExists 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...
thevalo Posted July 14, 2015 Author Share Posted July 14, 2015 Thank you too, can you show me an example how to get PID using ProcessExists? Link to comment Share on other sites More sharing options...
JohnOne Posted July 14, 2015 Share Posted July 14, 2015 There is one right there in the help file. 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...
Moderators Melba23 Posted July 14, 2015 Moderators Share Posted July 14, 2015 thevalo,Look in the Help file - there is a good example on the ProcessExists page.And could you please give your threads meaningful titles in future - everyone posting here needs help.M23 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...
thevalo Posted July 14, 2015 Author Share Posted July 14, 2015 I am so sorry. Next time I'll do it better.; Retrieve the PID of Notepad using the window handle returned by WinWait. Local $iPID = WinGetProcess($hWnd)Okay, this gets PID of notepad.exe using window handle, but how can I modify it to get process's PID that has no window? Link to comment Share on other sites More sharing options...
JohnOne Posted July 14, 2015 Share Posted July 14, 2015 lol 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...
Moderators Melba23 Posted July 14, 2015 Moderators Share Posted July 14, 2015 thevalo,That snippet uses WinGetProcess which you have already said does not work for you. You have been told that ProcessExists is what you need - so look at that example in the Help file.M23 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...
thevalo Posted July 14, 2015 Author Share Posted July 14, 2015 If ProcessExists("somefile.exe") ThenWhat to include after this to get somefile.exe PID which has no window? Link to comment Share on other sites More sharing options...
Developers Jos Posted July 14, 2015 Developers Share Posted July 14, 2015 Is it really that hard to read and understand?Return ValueSuccess: the PID of the process.Failure: 0 if process does not exist.Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
jvds Posted July 14, 2015 Share Posted July 14, 2015 i would fail to understand if i was new xDProcessExists("somefile.exe") returns the pid, so you need to capture that some where, try a consolewrite, msgbox, or a $variable maybetip: search in help file for consolewrite, msgbox, variables and ProcessExists Link to comment Share on other sites More sharing options...
thevalo Posted July 14, 2015 Author Share Posted July 14, 2015 Yes, that's hard for newbies. If it would be easy, I would not ask for help.The return value is always "-1" although process exists. Link to comment Share on other sites More sharing options...
JohnOne Posted July 14, 2015 Share Posted July 14, 2015 Yes, that's hard for newbies. If it would be easy, I would not ask for help.The return value is always "-1" although process exists.What process are you querying that returns -1? 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...
kylomas Posted July 15, 2015 Share Posted July 15, 2015 This is the part where you post the code for more help... Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now