Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

why won't destroywindow work?

Posted on 2000-03-10
3
Medium Priority
?
187 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

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…
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

604 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