Windows Messages Help

Posted on 2005-04-15
Medium Priority
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
  • 2
LVL 15

Expert Comment

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

Expert Comment

ID: 13796601

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 34

Expert Comment

ID: 13797909
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 34

Accepted Solution

Slick812 earned 2000 total points
ID: 13797943
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Integration Management Part 2
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

862 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