Click here to Skip to main content
15,889,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Disable Events of HTMLElement Pin
Perisic, Aleksandar3-Mar-09 10:12
Perisic, Aleksandar3-Mar-09 10:12 
GeneralRe: Disable Events of HTMLElement Pin
vikrant kpr3-Mar-09 10:13
vikrant kpr3-Mar-09 10:13 
GeneralRe: Disable Events of HTMLElement Pin
vikrant kpr3-Mar-09 10:21
vikrant kpr3-Mar-09 10:21 
GeneralRe: Disable Events of HTMLElement Pin
Perisic, Aleksandar3-Mar-09 10:38
Perisic, Aleksandar3-Mar-09 10:38 
GeneralRe: Disable Events of HTMLElement Pin
vikrant kpr3-Mar-09 10:53
vikrant kpr3-Mar-09 10:53 
GeneralRe: Disable Events of HTMLElement Pin
vikrant kpr3-Mar-09 11:07
vikrant kpr3-Mar-09 11:07 
GeneralRe: Disable Events of HTMLElement Pin
Perisic, Aleksandar3-Mar-09 11:11
Perisic, Aleksandar3-Mar-09 11:11 
QuestionDriving a 3rd-party app from my app. Pin
davidjaybrown3-Mar-09 5:46
davidjaybrown3-Mar-09 5:46 
Hello from a self-taught MFC bumbler...

I have to prototype a simple dialog-based MFC app which will serve as a front-end to an old dinosaur 3rd-party
MDI GUI app. Without naming names, lets call the 3rd-party app ABF. (More background at the bottom)

I have been able to inventory the main system windows for the main ABF window, and all its child windows, including the MDI frame,
menu bars, status line, and various pop-up output windows (CEdits) which show the user success/failure messages. Ive been successful
sizing/min/maxing all these windows, so I can pretty much drive what the user sees in ABF from my MyAPP, which, btw, appears
to the user simply as a clamped-on toolbar on the right of the main ABF window.

Ive been mostly successful driving all the necessary ABF menu pulldowns, providing the input keystrokes and Mouseclicks, and then
reading the output window(s) for success/failure strings. All except for a few specific cases. These problem cases are why
Im posting here. Essentially, I have been successful with...

*) Finding the main ABF window, and any/all child windows owned by such.
*) popping ABF to the top, and sending keys to invoke menu pulldowns, fill in edit boxes with
data, and send {ENTER} to OK and close the dialog.
*) Finding and reading the new output window that tells the success/failure of the operation. (& creates disk files)

Here are the rough (extracted ) lines from my code to do this.

<br />
DWORD tWNDthread = ::GetWindowThreadProcessId(hwndTARGET,0);                 // Get hwndTARGET's main thread. hwndTARGET is ABFs main window<br />
BOOL  bAttached  = AttachThreadInput(GetCurrentThreadId(),tWNDthread,TRUE);  // attaches to the thread (just to SetFocus)<br />
 ::SetForegroundWindow(hwndTARGET);                                          // send ABF to the front (just so I can see for now)<br />
 ::SetFocus(hwndTARGET);                                                     // give it kbd focus so I can send it keystrokes.<br />
                   AttachThreadInput(GetCurrentThreadId(),tWNDthread,FALSE); // detaches (I dont need to stay attached to do Sendkeys)<br />
 ::SendInput(KBn,&KBa[0],sizeof(INPUT));                                     // Sends my keystrokes to invoke menus, fill in data, and hit OK<br />


...After that, like I said, I can inventory all child windows of hwndTARGET, and find the new output window, which has a main CEdit. I read
this CEdit, and it tells me the success or failure of the operation I just invoked.

Like I said this works, MOSTLY. The only time it doesn't work is when the user invokes a menu-pulldown of his own, and a big fat
dialog box is already presented to the user. When this is the case, My apps normal SendKeys dont make it to the main window, nor the
child dialog. (I dont know where they end up). What I do know, is that my interface is hosed. What Id like to do is prefix my SendKeys
with a few ESCAPES, so I can close all child dialogs before I try and invoke my own pulldowns. But this doesnt work. I dont know why.

So, before I spend far too many of my man-days trying to debug this, I thought Id post here and get some expert opinion.

So, here are my specific questions.

A) When ABF has some dialog window sitting in front, it DOESNT appear anywhere in the Main-ABF-Window's child window list. (???) Thus, I
dont know that it even exists (so I cant detect the problem state). What calls can I use to know if such a window is on-top.
B) Are these dialog windows totally invisible to me? Or can I do some inventory of windows owned by the ABF THREAD, (and not the
main ABF WINDOW). Is this where I should be focusing my strategy?
C) Ive been able to read CEdits (only) from some other ABF Main-Window-owned child dialogs, but there are [X]checkboxes that I need to read
the state of. I can change the state of them (because mostly everything has an accellerator key thankfully), but I dont know how to READ
the state of the checkboxes when the dialog is on top. Same goes for comboboxes and other std dialog elements.

OK, I guess thats enough to get me going again.

All answers are much appreciated. Remember, I havent had any formal MS education. My windows knowledge is all self-taught
through MFC-by-example books and the likes.

Dave (from Pittsburgh)

p.s. Running MFC6.0 on NTsp2

(p.p.s. If you're in Pittsburgh, a little *paid* consultation time might be considered. Wink | ;-) Im behind schedule)
DaveB 412-374-6781

-----more background------

ABF is a 15 year old product that we paid a boxcar full of money to have qualified for use in a safety-critical
development process. Its designed to have a user in front of it, who reads inputs through his eyes. He will then
do ABF menu pulldowns, which invoke dialog boxes where he enters the data he sees, etc. In the end, the outputs go
through a tedious validation and verification process. Its very painful and tedious, and very prone to human error,
because the operator has enter roughtly 175000 data-items for a typical job. We're pretty locked-in to this
product. Because of this, we're assured that the ABF product is NEVER going to change, or be upgraded for us.
Also, because of our formal development process, I cannot just hack the ABF fileformat. Im FORCED to enter data through the
ABF tool. It provides a ton of unknown data-checks and conversions. I just want to bypass the error-prone user-input part.

I was awarded some research funds to try and develop an APP which will try and drive ABF from another dialog app.
If I can get even a modest prototype functioning, my Co will sponsor a rigorous development plan which will employ some real
programmers to design a formal-interface. Ive got to proof the concept first, however.

"Help Me Obi-Wan-CodProjbi, you're my only hope."
AnswerRe: Driving a 3rd-party app from my app. Pin
Stuart Dootson3-Mar-09 6:19
professionalStuart Dootson3-Mar-09 6:19 
GeneralRe: Driving a 3rd-party app from my app. Pin
davidjaybrown3-Mar-09 7:45
davidjaybrown3-Mar-09 7:45 
GeneralRe: Driving a 3rd-party app from my app. Pin
Stuart Dootson3-Mar-09 8:05
professionalStuart Dootson3-Mar-09 8:05 
AnswerRe: Driving a 3rd-party app from my app. Pin
vikrant kpr3-Mar-09 6:30
vikrant kpr3-Mar-09 6:30 
GeneralRe: Driving a 3rd-party app from my app. Pin
davidjaybrown3-Mar-09 8:10
davidjaybrown3-Mar-09 8:10 
GeneralRe: Driving a 3rd-party app from my app. Pin
vikrant kpr3-Mar-09 8:24
vikrant kpr3-Mar-09 8:24 
QuestionHow can I get the VISIBLE part of the client area in a window? Pin
Joseph Marzbani3-Mar-09 4:52
Joseph Marzbani3-Mar-09 4:52 
AnswerRe: How can I get the VISIBLE part of the client area in a window? Pin
Code-o-mat3-Mar-09 5:13
Code-o-mat3-Mar-09 5:13 
GeneralRe: How can I get the VISIBLE part of the client area in a window? Pin
Joseph Marzbani3-Mar-09 8:21
Joseph Marzbani3-Mar-09 8:21 
AnswerRe: How can I get the VISIBLE part of the client area in a window? Pin
Stuart Dootson3-Mar-09 6:14
professionalStuart Dootson3-Mar-09 6:14 
GeneralRe: How can I get the VISIBLE part of the client area in a window? Pin
Joseph Marzbani3-Mar-09 8:25
Joseph Marzbani3-Mar-09 8:25 
GeneralRe: How can I get the VISIBLE part of the client area in a window? Pin
Stuart Dootson3-Mar-09 8:39
professionalStuart Dootson3-Mar-09 8:39 
GeneralRe: How can I get the VISIBLE part of the client area in a window? Pin
Iain Clarke, Warrior Programmer3-Mar-09 22:43
Iain Clarke, Warrior Programmer3-Mar-09 22:43 
GeneralRe: How can I get the VISIBLE part of the client area in a window? Pin
Stuart Dootson3-Mar-09 22:48
professionalStuart Dootson3-Mar-09 22:48 
Questionproblems about Template using Pin
jeansea3-Mar-09 4:02
jeansea3-Mar-09 4:02 
AnswerRe: problems about Template using Pin
Cedric Moonen3-Mar-09 4:08
Cedric Moonen3-Mar-09 4:08 
GeneralRe: problems about Template using Pin
jeansea3-Mar-09 4:15
jeansea3-Mar-09 4:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.