|
Ok, after HOURS - I'm not going to tell you how many - of trying, I'm looking for help!!
I'm trying to write code to snoop at data in textboxes of an accounting application window for my application to automate some other processes.
From the master application window, I EnumChildWindows with my callback function and find the Dialog Window which contains the controls for the data I want. There are NO other child windows.
I can successfully talk to this window with WM_GetText and WM_GetTextLength and verify the window name.
Next I try to GetNextDlgTabItem ( found_window_handle, 0, 0) and it returns the same window handle I passed to it. If I attempt GetNextDlgTabItem ( found_window_handle, 0, 1) it always returns 0. (just changing previous / next)
I then tried to CHEAT and setup a procedure to use GetDlgItem ( found_window_handle, control_id ) - my cheat is to loop for every number between 0 and 99999999 for the control_id. Surprisingly every attempt returns ZERO.
I was reading about Windows Hooks and it stated sometimes messages can be missed because Windows passes them directly to the control rather than the parent dialog window.
If this is the case, Windows must have a table of controls! How do I access this table?!
IF I had not seen this done, I might have given up, but SnagIT -> Object -> Text capture can not only grab the present value of a dialog text object, but it also returns the programmers name for the object. I've also played with password discovery tools that reviel the value hidden behind a password character "*".
I think the solution is hidden somewhere in messaging the parent dialog window, or in discovering the control table or DLGTEMPLATE at runtime. But, the only starting point I have is the Handle of the Dialog Window itself.
Any suggestions, or better, anyone actually done this?!
|
|
|
|
|
Hi!
I don't know if it helps... but I think had a simmilar Problem.
CWnd * pWnd = FindWindow(0,"some name");
CWnd *pChild1 = pWnd->GetWindow(GW_CHILD);
CWnd *pChild2 = pChild1->GetWindow(GW_HWNDNEXT);
.
.
.
till you find the right window....
I used the Spy++ to check the Dialog for all the windows...
|
|
|
|
|
Hi wb,
I have located the CWnd of the window I want. It's the controls of this window that I can't access.
Do you know, are controls suppose to have window handles too?
GetWindow isn't seeing them. In testing Spy++ doesn't see them either. Someone suggested using EnumChildWindows instead, but it reports the same result.
Jim ô¿ô
|
|
|
|
|
I have a program writen on VC++,and it uses the VC++ graphic libraries,which I don't know.I've managed to understand somethings with the help od the MSDN pages,but there is one thing I can't: The program opens a fullscreen window,and inside it has three frames.I can't manage to edit the size of those three frames,and the top-left and the top-right ones are just a few inches,and the one at the bottom takes almost all the screen.So can you tell me what's the method or variable that controls this size? I'm working on an already writen program,that makes it more difficult...
|
|
|
|
|
No-one can answer this, you're asking us to poke around inside the code that you have, and we don't. What sort of frames, is it a splitter window, or ( as you seem to imply ) are they just drawn to the screen ? What's your OnPaint look like ? What graphics libraries, GDI, GDI+, or something external ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hi
I tried using Eran Yariv's 2-pass scaling filter (http://www.codeproject.com/bitmap/2_pass_scaling.asp) in my program (Visual C++ 6.0 on Win2k). The program works fine in debug mode, however, when I execute the release version, the scaling's result is not satisfactory, as the scaled images often have many unwanted horizontal green lines on them.
If I changed the preprocessor definition in the project settings to _DEBUG instead of NDEBUG and compile the release version, it works fine, although not the linker gives a warning about msvcrt.dll conflicting with other libraries. Further investigation reveals that the linker now uses msvcrtd.dll instead of msvcrt.dll.
I am curious to know why the program acts so strangely on the release version. Could someone point to me some possible causes for this? Thanks!
|
|
|
|
|
|
Hey guys,
I 'm having problem reading data from a text file.
Sample.dat contains
M
Bob
Dude
56
F
Carmen
Sandiago
33
VP
my code is suppose to read the .DAT file using ios::binary
and feed the information into a class.
example class...
class personInfo
{
char firstname[20];
char lastname[20];
int age;
char gender;
}
class femleInfo : public personInfo
{
char title[5];
}
acutally I have a polymorphic function that reads male info into a maleInfo Class and femaleInfo into a femaleInfo class.
The problem is,how do I read both male and female info seperately and load the appropriate class? (they both have differnt number of data members)....
I tried using seekg function and to move the pointer but I didnt really understand it,
Can someone pls help.
|
|
|
|
|
Create an iostream inserter/extracter for personInfo, have it return the appropriate type of object, based on the first data item read ( the sex ).
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
yes that is what Im doing,
the problem Im having is, how to read the the data into my class ???
I tried myDataFile.read(reinterpret_cast<char*> (&fObject),fObjSize);
and I thought this would copy each data item from the text file into the class varibales???
that doenst seem to be happening, am I missing something?
|
|
|
|
|
Yes, what you need to do is to stream in the variables one at a time. For starters, you've already read the first value out of the file, secondly, you're not allowing for whitespace, which also takes up room in the file. Oh, then you've got byte ordering of any number variable larger than a char, and the fact that that any number is stored not as a number value, but a line of chars.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
confused .......pls explain a little more.
are you saying that I have to read each varible line by line from the text file and load it onto my class? what function do I use? do I still use
inDataFile.read(reinterpret_cast<char*> ???
what would be the exact lines to use the above ?
thnks for ur help
|
|
|
|
|
Going back to where I started, you need to create an iostream inserter/extracter for the class, like this[^]. Then you'd need to do something like
personStruct a; // whatever your variable type was, it should really be a struct, in any case.
myStream >> a;
// Now check the data member that telss you if it's a female, and treat it accordingly. I'd be incline to use just one struct, and just null the data that is not appropriate, instead of the way you are doing things now.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
okey got it.
thanks a lot.
|
|
|
|
|
Just curious does anyone have a tutorial on how to make a macro in visual c++. I have this program called total recorder that records streaming audio and i have a radio show that comes on early in the morning. I'm usually not away so i wanted to write a c++ program that would launch total recorder say with shellexecute that part is easy. I just can't figure out how to make it click the mouse like a macro. Thanks for your help.
Talk to me like a baby cause when it comes to programming i still wear a training pants
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
You need to look into SendMessage, perhaps. It sounds messy to me though.
I thought you wanted to create a macro in C++, as in #define, I was ready to read you the riot act
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I think I can help U in it. But definately it needs detailed discussion. Time being. Every Microsoft windows has a class name and window text. and at any given instance Desktop will be parent of all windows. U can find these using Spy++ in windows. So just iterate from desktop as root windows using treeView to Ur target message. Using SendMessage or Postmessage pass WM_BCLICK or WM_LBUTTONDOWN or what ever.
hope it helps
|
|
|
|
|
I looked up SendMessage and post message but wasn't too clear on it.
How do i tell it which window to send it to?
I opened up spy++ and i found my message. I'm assuming i need to the window handle say 004f3c or whatever.
so would i put PostMessage(WM_LBUTTONDOWN,004f3c,NULL);
Sorry but confused i kinda understand what your saying but its new to me so i'm kinda lost.
thanks for the help by the way.
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
U can't depend upon handle as they R dynmaic. So derive Windows handle from FindWindow(class name, WinText) kind of API. Use this handle in Ur SendMessage.
Now U must be Pretty clear I think. Mind U there is no standard method of doing this. I derived this method after 2 months of shuffling with Charles Perzolt book. Highly recommended.
One more just read the query posted by codeCharmer "Enumerating Dialog Controls". U have to adopt almost similar Algo.
cheers
Siddharth
|
|
|
|
|
please tell me how can i initialize ITBasicCallControl
interface of tapi3lib.dll in VC.net
thanx....
babur
|
|
|
|
|
The ITAddress::CreateCall method creates the ITBasicCallControl interface.
HRESULT CreateCall(
BSTR pDestAddress,
long lAddressType,
long lMediaTypes,
ITBasicCallControl** ppCall
);
|
|
|
|
|
Using the Windows CColorDialog class, is it possible to select any of the custom colors that one saves? I am populating the custom colors before calling the DoModal class and the colors appear correctly. However, calling SetColor only seems to select the square that is in the basic color boxes. Is selecting a custom color programmatically possible?
|
|
|
|
|
Under MS-DOS, you used get_vect() and set_vect() to install an ISR to handle interrupts; for instance, if you used IRQ 10 for the PC-104 bus.
How do you do the same thing in WIN32? How do you get a hardware interrupt to call a function that you supply?
|
|
|
|
|
Hardware and interrupt handling under Win32 (specifically, Windows NT/2000/XP) is vastly different from MS-DOS and even Windows 3.x/9x.
User applications do not handle interrupts. Period. The best you can do is have a driver signal an event, and have a thread in a user application wait on that event. At that, the user application can't manipulate hardware directly (I/O instructions are prohibited to user applications).
You need to get a copy of the Windows Driver Development Kit (DDK). If you are using off-the-shelf hardware, contact the manufacturer for application programming information. Usually, if it's something special (data acquisition H/W, for example), they will provide the appropriate driver and an object library or interface DLL to talk to the hardware. If this is hardware you (or your company) are building yourself, you will need to learn driver development, which is distinctly non-trivial.
Software Zen: delete this;
|
|
|
|
|
Aahhh, interrupts. I remember them (nostalgic look on face).
Its surprising how coding in the windows environment can completely change your concepts of programming.
I Dream of Absolute Zero
|
|
|
|