Thread: FindWindow()

  1. #1
    Refugee face_master's Avatar
    Join Date
    Aug 2001


    Could somebody show me how to use FindWindow based on the last 30 or so characters of the title string?

  2. #2
    Me want cookie! Monster's Avatar
    Join Date
    Dec 2001
    Don't know, just make your own function with the GetTopWindow,
    GetNextWindow, IsWindow and GetWindowText functions.


  3. #3
    Join Date
    Jan 2002
    I'm not sure if you can use this. The FindWindow function requires 2 parameters, the class name and the window name. So it needs the full window text in order to find a window with that title. If you only have one instance of your window running, just set the window name paramater to NULL:

    HWND hWndToFind=FindWindow(MyWndClassName,NULL);

    where 'MyWndClassName' is the class name of your target window.

    which should return the handle to the wnd of 'MyWndClassName'.

    If all you have to work with is the last 30 characters of a wnd then maybe you need to use 'EnumWindows' or 'EnumDesktopWindows'. In this scenario you would enumerate through all the desktop windows, interrogate their titles and test for a match with those '30 or so last characters'.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. alternate to FindWindow() ?
    By Dash_Riprock in forum Windows Programming
    Replies: 6
    Last Post: 10-08-2006, 10:47 AM
  2. FindWindow inconsistency
    By CondorMan in forum C++ Programming
    Replies: 7
    Last Post: 06-22-2006, 04:35 AM
  3. Geting "hwnds" without FindWindow
    By lala123 in forum Windows Programming
    Replies: 16
    Last Post: 08-15-2005, 07:07 PM
  4. Findwindow Sendmessage Help
    By Coder87C in forum Windows Programming
    Replies: 26
    Last Post: 08-12-2003, 01:28 AM