Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you compare two HWND pointers?

Tags:

windows

winapi

Is it possible to do

if(HWND1 == HWND2)

or is there a function that I need to use to see if two hwnd point to the same window?

like image 775
teatope2 Avatar asked Jan 21 '10 20:01

teatope2


2 Answers

A HWND is just a long value, so yes you can compare them that way.

like image 81
TheSmurf Avatar answered Oct 28 '22 17:10

TheSmurf


Depends how stale your data is. Windows re-uses hwnds (eventually), so there's no guarantee that 1005A is both a valid window and the window you expected, it might be another window that re-used 1005A.

like image 35
Bob Moore Avatar answered Oct 28 '22 15:10

Bob Moore