Solved

why won't destroywindow work?

Posted on 2000-03-10
3
168 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

16 Experts available now in Live!

Get 1:1 Help Now