Jump to content
thevalo

Help needed

Recommended Posts

thevalo

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

 

 

Share this post


Link to post
Share on other sites
JLogan3o13

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
thevalo

Thank you for response.

Actually as I see the WinGetProcess only gets PID of window/titles, I want to get PID of process.

 

Share this post


Link to post
Share on other sites
thevalo

Thank you too, can you show me an example how to get PID using ProcessExists?

Share this post


Link to post
Share on other sites
Melba23

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
thevalo

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?

Share this post


Link to post
Share on other sites
Melba23

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Jos

Is it really that hard to read and understand?

Return Value

Success: the PID of the process.
Failure: 0 if process does not exist.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
jvds

i would fail to understand if i was new xD

ProcessExists("somefile.exe") returns the pid, so you need to capture that some where, try a consolewrite, msgbox, or a $variable maybe

tip: search in help file for consolewrite, msgbox, variables and ProcessExists

Share this post


Link to post
Share on other sites
thevalo

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.

Share this post


Link to post
Share on other sites
kylomas

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×