?
Solved

why won't destroywindow work?

Posted on 2000-03-10
3
Medium Priority
?
183 Views
Last Modified: 2010-04-04
I can't get the API call destroywindow to work and i have to use a call like it because i am not dealing with a process.... i keep getting error 216.

Any help would be much appreciated, i'll increase the points on the question when i get some more.
0
Comment
Question by:frangers99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
craig_capel earned 20 total points
ID: 2604065
//destroywindow
//sendmessage(form1.handle,wm_destroy,0,0);
sendmessage(form1.handle,wm_close,0,0);


Intresting.... I invoked destroy window like this, and watch the icon in the top left corner as you use wm_destroy....

You can use Sendmessage to close the window or you can do this....

var
wnd2 : hwnd;
ProcessID,cpid : Cardinal;
begin
wnd2:=findwindow('Shell_TrayWnd',nil); //handle of window

ProcessID := GetWindowThreadProcessID(wnd2,@cpid);
TerminateProcess(OpenProcess(PROCESS_TERMINATE,false,cpid),1);
end;

Ok... hope thats worth 5 points :)
0
 

Author Comment

by:frangers99
ID: 2604083
Craig you are an absolute champion, sendmessage(form1.handle,wm_close,0,0);
 worked perfectly, finally...i spent so long trying to figure that out, you get the 5 points. You might have spotted my other message with a similar title....
it's pretty similar if you can work out the second part then i spose i owe you 175 points.
0
 

Author Comment

by:frangers99
ID: 2604092
sorry i'm outta points but i'd give you 100 if i had them. This is one of the best repsonses i've seen on this experts advice thing. Thanks a heap!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

771 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