Solved

why won't destroywindow work?

Posted on 2000-03-10
3
177 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
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
craig_capel earned 5 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

820 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