   WinProc - identifying MSG source window?
  HI,WinProc provided the HWND handle to the window that the message being processed comes from.However what should hwnd be compared to in WinProc?At the moment I have declared 3 HWND variables globally and so can compare them directly:In WinProc... (Haven''t tested it yet  )   if (hwnd == TileDisplay)do this;if (hwnd == LevelDisplay)do that;But I''d rather declare the HWNDs in WinMain and compare part of the HWND struct.I was thinking I could compare hwnd.pText to the window caption, but the caption may change. Or I could compare to the window class name, but several windows may be created off the same class.This has to be a really veg problem, but I can''t find the answer on google or in Petzold''s book.Any suggestions anyoneCheers Stephen   Turn Left 100m..........YES! That left back there! 
  You should be able to simply compare the HWNDs.   Colin Jeanne | Invader''s Realm;  I don''t think there''s any way around it aside from making them globals.  Or else you could put them in your window handler as static variables and create them when your window/dialogue/whatever is initialised (for dialogues there''s WM_INITDIALOG, I''m not sure about windows).You can also get the ID that you previously associated with the window or control.  It''s usually supplied through the wParam or lParam.cheerssam;  I have is partially worked out!Different windows classes can use different WinProc functions, as defined in the windows class init wndclass.lpfnWndProc   = winproc; so if each window is from a different WNDCLASSEX is no probs.Not sure about when several windows use the same windows class, but have different contents.Cheers stephen   Turn Left 100m..........YES! That left back there! 