   Finding a window without error... how?
  Hi, im trying to implement some code that save info about a window, mostly the window's caption and class name, to use later with FindWindow(), but im not sure if this can always work. I though about saving this data and all of the window parent's captions and class name in a vector or something, then look them up in one or anoter order, to confirm that this windows is really the good one, a simple button for example.For example, the output text i have if i click on one of the windows explorer window is:# of Windows: 6Window Info: Caption:    02 Class Name: ExploreWClass Index: 36   Caption:  Class Name: SHELLDLL_DefView   Index: 4Caption:    Class Name: DUIViewWndClassNameIndex: 0  Caption: Class Name: DirectUIHWND  Index: 0    Caption:   Class Name: CtrlNotifySink    Index: 0 Caption:    FolderView Class Name: SysListView32 Index: 0The index simply represent the number of sibling the windows have, but it seem to be inconsistent so i cant use that number...Anyone got a better idea to make sure i can find a specific windows without error(or almost)?   
  What exactly are you trying to accomplish here? It seems to me like you're relying on a fairly fragile hack to do something, but without knowing why you need this code it's hard to say if there's a better method available.   ;  Why not just keep the HWND around?   ;  This is because i want to be able to replicate some user input (mouse/keyboard) for later use, to "play" them back.   