943,733 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 2606
  • C# RSS
Jun 5th, 2009
0

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

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
adamf07 is offline Offline
7 posts
since Jun 2009
Jun 5th, 2009
0

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

Have you tried using Spy++? Check out this article: http://www.c-sharpcorner.com/UploadF...ingCSharp.aspx
Moderator
Reputation Points: 322
Solved Threads: 28
The C# Man, Myth, Legend
Tekmaven is offline Offline
914 posts
since Feb 2002
Jun 6th, 2009
0

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

Click to Expand / Collapse  Quote originally posted by Tekmaven ...
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!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
adamf07 is offline Offline
7 posts
since Jun 2009
Jun 6th, 2009
0

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

Cool. If you don't know how to get Spy++, I believe I read that it is included in the Windows SDK.
Moderator
Reputation Points: 322
Solved Threads: 28
The C# Man, Myth, Legend
Tekmaven is offline Offline
914 posts
since Feb 2002

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Decompress large file
Next Thread in C# Forum Timeline: Writing Bits with c#





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC