Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Windows Application Web
Is Anyone tell me how to read Messagebox or AlertBox content in .net
I don't want HeaderText. I need Content of AlertBox or MessageBox.
 

Thank you in Advance
Posted 24-May-13 1:32am
Arun Vasu1.7K
Edited 28-May-13 2:31am
v3
Comments
Prasad Khandekar at 24-May-13 6:45am
   
Hello Arun,
 
You can use Windows API for this purpose. Please see this MSDN documentation (http://msdn.microsoft.com/en-us/library/ms632627(VS.85).aspx). Also look at the ManageSpy code sample (http://msdn.microsoft.com/en-us/magazine/cc163617.aspx) or have a look at this link (http://msdn.microsoft.com/en-us/magazine/cc301438.aspx).
 
Regards,
Arun Vasu at 24-May-13 7:11am
   
i refer all site which you gave me.. but sorry.. i not find any exact solution
Prasad Khandekar at 24-May-13 7:32am
   
What you are really trying to do is called screen scraping. The sites I referred contains information on how to do this. Basically AlerBox or a MessageBox are windows and you need to retrieve the text present in one of the labels of that window. The typical steps to do this are
1. Find the matching window (by say title)
2. Get a list of child controls
3. Go through each and get the text content if supported.
 
This is one more link (http://stackoverflow.com/questions/5978879/how-do-i-read-messagebox-text-using-winapi)
ryanb31 at 28-May-13 9:01am
   
Can you explain why so that we can understand how to help properly?
Arun Vasu at 31-May-13 1:23am
   
My need is:
I have one web application. After One process a page shows one message box, it may successfully inserted, or updated or its return guid() value or if any exception in process it will show in that application. My requirement is i want to read that message box content using that i need to take some action. for this i need the solutions.
 
ryanb31 at 31-May-13 7:33am
   
Are you sure it is an alert() from javascript? If so, you'll have to do what Prasad suggested, use the Windows API to get a handle on that window. I doubt that will be easy. Or, could it be a div that is displayed? Either way, it sounds like a hack to get this to work. Is there no other way to do it? You can't have the person who created the website create a webservice for you?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 474
1 ridoy 420
2 DamithSL 180
3 OriginalGriff 179
4 Richard MacCutchan 160
0 OriginalGriff 8,033
1 DamithSL 6,179
2 Sergey Alexandrovich Kryukov 5,538
3 Maciej Los 5,508
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 28 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100