Ask Your Question
3

What is the method for obtaining the PID of a PyWin32 PowerPoint procedure?

asked 2022-03-09 11:00:00 +0000

huitzilopochtli gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-11-19 00:00:00 +0000

david gravatar image

To obtain the PID of a PyWin32 PowerPoint procedure, you can use the following steps:

  1. Use the win32process module to import the GetCurrentProcessId() function:
import win32process
  1. Use the win32com.client module to create a PowerPoint application object:
import win32com.client
ppt = win32com.client.Dispatch("PowerPoint.Application")
  1. Use the win32process module to get the process ID of the PowerPoint application:
pid = win32process.GetWindowThreadProcessId(ppt.HWND)[1]

This will give you the PID of the PowerPoint process.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-03-09 11:00:00 +0000

Seen: 9 times

Last updated: Nov 19 '22