Get the Handle of the current Form

  • Thread starter Thread starter Chris Botha
  • Start date Start date
C

Chris Botha

I want the Handle of the current form using the Compact Framework. Using the
WinApi calls GetActiveWindow or GetForegroundWindow sort of work, except
when the SIP is visible, then I get the Handle of the SIP instead.

Thanks.
 
The most-reliable way is to have the window you're trying to get the handle
for take the focus, then call GetFocus(), then set it back to whatever was
focused before. I think that the SDF does this a couple of places...

Paul T.
 
Actually, the preferred way (least interference) is Capture = true, then
GetCapture()
 
Back
Top