API Request

Plugin development, plugin requests, support for third party plugins, ...
CircleDock
Plugin Developer
Posts: 77
Joined: 13.06.2010 11:52:02
Contact:

API Request

Postby CircleDock » 03.11.2010 10:59:39

Can you please provide an API function as follows:

IntPtr WindowHandle = SendMessage(DexpotHandle, DEX_RETURNHWNDFROMPID, IntPtr ProcessID, ref IntPtr SearchFlag)

where

WindowHandle is a Pointer to the return value and is either Zero (no Window found) or a Window Handle.
ProcessID is a Pointer to a Process ID
SearchFlag is a Pointer to a flag value of Zero if only non-visible/non-minimsed Windows should be checked, or non-zero if all Windows are to be checked. Dexpot should replace this flag with a Pointer to a Desktop number (if Handle is non-zero) prior to return.

Patrick will have some idea why I need this function! ;) (Process IDs for tasks on Desktops other than the current one are accessible from the list of running processes but Dexpot appears to hide the Windows for Processes not running on the current Desktop. This function is to overcome that problem.)

Since you already know the Windows Handles for all the Windows open - and presumably store that information in a list of some description - it's a simple matter to get the owning Process ID:

Code: Select all

            int ProcessID = 0;
            int ThreadID = GetWindowThreadProcessId(hWnd, ref ProcessID);


:D

Mark

User avatar
Patrick
Developer
Posts: 7380
Joined: 04.03.2003 14:51:26

Re: API Request

Postby Patrick » 03.11.2010 19:05:54

No, I can't. Mostly for the technical reason that you can't use pointers like that in cross-process window messages in the WM_USER range. While most of the things you're marshaling as IntPtr are not actually pointers, the "SearchFlag" thing won't work.

Assuming we fix that, how would the function behave when the process has more than one window?


Return to “Plugins”

Who is online

Users browsing this forum: No registered users and 4 guests