1

Problem: Need to read/capture the text of Windows pop-up messages that is generated by non-VB applications.

Situation: I've a VB6 app, part of which requires processing an excel workbook. A non vb-6 pop-up window (as attached screen) "FILE CONVERSION IN PROGRESS" comes up, while opening an new version of excel-sheet from an old MS Excel app. And automatically it closes alos.

Requirement: I want to capture that pop-up occurance in the code. And then write a conditional statement code for the 'cancel' button click event of that non vb-6 pop-up. non vb6 pop up window

Can anyone suggest something?

2nd

M Granja
  • 845
  • 8
  • 26
Kings
  • 1,551
  • 12
  • 32
  • 52

1 Answers1

0

You can access other applications with the following APIs:

FindWindow() to locate the main window of what you're looking for http://msdn.microsoft.com/en-us/library/windows/desktop/ms633499%28v=vs.85%29.aspx

GetWindow() to navigate through the HWNDs of the application so you can get to the button http://msdn.microsoft.com/en-us/library/windows/desktop/ms633515%28v=vs.85%29.aspx

GetWindowText() to access the text from a control (it cannot be an Edit control) http://msdn.microsoft.com/en-us/library/windows/desktop/ms633520%28v=vs.85%29.aspx

You'll want to use Spy++ (which can be downloaded) to see what the class name you're looking for when it comes up and to figure out the hierarchy to navigate properly.

You'll need to use the API Text Viewer to get the API declarations so you can use them in VB6 properly.

Mike Weir
  • 3,094
  • 1
  • 30
  • 46