Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getwindowthreadprocessid
Message
 
To
24/07/2003 17:33:23
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00813312
Message ID:
00813379
Views:
6
>I am utlizando this function so that it returns me I number it of the
>PID, but this so this returning one I number negative. What this
>making of missed? If they alguem will be able to help, I am thankful
>me.
>
>Declare INTEGER GetWindowThreadProcessId IN win32api INTEGER hwnd, INTEGER @lpdwProcessId
>
>test_thread_id = GetWindowThreadProcessId(test_hwnd, @test_pid)
>where
>
>since ja I am thankful

Gilciel,

Try using bitor(m.test_pid, 0) to cast the result properly for comparison with a known PID, as in the following snippet:
STORE 0 TO ProcId, ThreadId	&& initialize return variables
ThreadId = GetWindowThreadProcessId(m.nexthwnd, @ProcId)	&& get PID & TID
if bitor(m.procid, 0) = ;
  bitor(m.lookforpid, 0)	&& window belongs to known PID
    newhwnd = m.nexthwnd	&& found the new HWND for given PID
    exit			&& done with loop
endif
Mike
Montage

"Free at last..."
Previous
Reply
Map
View

Click here to load this message in the networking platform