Windows Messages Help

Posted on 2005-04-15
Last Modified: 2010-04-05
Hiya Experts

I am using FindWindowEx function on a window and am sending a certain class displaying an animated picture the
wm_close message. It seems to work fine but after sending the message to the class the picture doesnt disappear like i want it to. I tried to UpdateWindow and RedrawWindow but they both dont seem to do what I want. If I cant wipe the dead image away
is it possible to send it a resize command so I can update the pages coordinates and trim it off? Ever better, is it possible to insert my own object (page or image) into that control (by classname)?

Question by:Thor371
    LVL 15

    Expert Comment

    You could try and do form.invalidate to see if that helps, or turn on the doublebuffered property of the form and components.
    LVL 2

    Expert Comment


    A FindWindow() and FindWindowEx() functions doesn`t result the descent classes like some Memos, Edits etc. They can only return a handle to the main forms of applications - not the controls in.

    If we try to find a seconds forms of application by FindWindow, it return handle of main form of this application.

    So: you have to

    1) FindWindow of main application
    2) Find the control by GetWindow() function, for example:

    hwndChild = GetWindow(hwndWindow, GW_CHILD); // return first child of window
    GetWindow(hwndChild, GW_HWNDNEXT); // return next control with the level same as hwndChild etc.
    LVL 33

    Expert Comment

    hello  Thor371, , I do not understand what you are doing ? ? You say - " am sending a certain class displaying an animated picture the wm_close message". . . But I do nt know what that means? ?

    Can you show us the code you use for this. . .

     I do not understand your  "class displaying an animated picture" I do not know what the class is or how you placed it in a window?
    LVL 33

    Accepted Solution

    I am guessing this window is in a different process?  If you created a window and placed it in to another window , then the WM_CLOSE will not work on a child window to destroy it, , you might try the DestroyWindow(hNewWindow) function

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
    Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now