Accessing a form's "close" button using win32 API

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2009
Posts: 7
Reputation: adamf07 is an unknown quantity at this point 
Solved Threads: 0
adamf07 adamf07 is offline Offline
Newbie Poster

Accessing a form's "close" button using win32 API

 
0
  #1
Jun 5th, 2009
Hello all, I recently was assigned to a project that requires me to take an unorthodox approach to handling a web page. I have been using win32 API calls such FindWindowEx() and SendMessage() to access dialog boxes and the buttons within. Everything has been running smoothly except for the final call I have to make. At this point I am done with the dialog box and I want to close it. I have tried using the standard approach for finding the window and button inside (a FindWindowEX() using the title of the window, then using FindWindowEx() to get the handle of the button I'm trying to activate), however this isn't working. I have also tried using the destroyWindow() function on the handle, which returns a bool indicating whether or not the destroy was successful.

I was wondering if maybe every window has access to a close or exit button of some kind. So far I've tried {close, &close, c&lose, exit, &exit, e&xit}, none of which return a valid handle.

Any ideas?
Last edited by adamf07; Jun 5th, 2009 at 8:38 pm.
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 898
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Solved Threads: 27
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: Accessing a form's "close" button using win32 API

 
0
  #2
Jun 5th, 2009
Have you tried using Spy++? Check out this article: http://www.c-sharpcorner.com/UploadF...ingCSharp.aspx
-Ryan Hoffman

.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 7
Reputation: adamf07 is an unknown quantity at this point 
Solved Threads: 0
adamf07 adamf07 is offline Offline
Newbie Poster

Re: Accessing a form's "close" button using win32 API

 
0
  #3
Jun 6th, 2009
Originally Posted by Tekmaven View Post
Have you tried using Spy++? Check out this article: http://www.c-sharpcorner.com/UploadF...ingCSharp.aspx
No, I hadn't seen that before. Thanks, I'll try it out!
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 898
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Solved Threads: 27
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: Accessing a form's "close" button using win32 API

 
0
  #4
Jun 6th, 2009
Cool. If you don't know how to get Spy++, I believe I read that it is included in the Windows SDK.
-Ryan Hoffman

.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC