|
Cristian Ionitoiu wrote:
And in general is there a methodology (a guessing procedure) that one would employ in querying/altering non-standard controls (not only ListBoxes)?
Most can use GetWindowText() (WM_GETTEXT ). List boxes use the LB_GETTEXT message.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hi,
GetWindowText would not work for windows form other applications. For this one has to use SendMessage with the apropriate Message type. See some of the spy programs available on this site. However, if the control is not standard then it will nto answer to standard messages, so one needs another way to "get inside it" and extract the info.
Cristian
|
|
|
|
|
Cristian Ionitoiu wrote:
GetWindowText would not work for windows form other applications.
Sure it would.
Cristian Ionitoiu wrote:
For this one has to use SendMessage with the apropriate Message type.
Just what is it that you think GetWindowText() does? It sends a WM_GETTEXT message to the target window.
Cristian Ionitoiu wrote:
However, if the control is not standard then it will nto answer to standard messages, so one needs another way to "get inside it" and extract the info.
You just answered your own question. Non-standard controls are not guaranteed to respond to standard messages.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I am not loosing my time with this pin-pong of question-answers of no value. If you understood the question from the beginning and know a solution to this reverse-enginering issue then please answer.
The MSDN clearly states that GetText does not work for windows of other threads (and it is tested by me). This is a change in XP. Study it and then make your comments.
If you want a solution to work for all window versions and for all cases you must use SendMessage.
|
|
|
|
|
Cristian Ionitoiu wrote:
I am not loosing my time with this pin-pong of question-answers of no value.
So don't ask generic questions if you don't want a generic answer.
Cristian Ionitoiu wrote:
If you understood the question from the beginning and know a solution to this reverse-enginering issue then please answer.
What is it exactly that you want(ed) reverse-engineered? This is the first you've mentioned such a requirement.
Cristian Ionitoiu wrote:
The MSDN clearly states that GetText does not work for windows of other threads (and it is tested by me).
Don't tell me that you believe everything that is in MSDN. It makes a nice starting point, but it gets proven wrong quite often.
Cristian Ionitoiu wrote:
If you want a solution to work for all window versions and for all cases you must use SendMessage.
I'll say it slowly. While GetWindowText() is a wrapper around SendMessage(WM_GETTEXT) , it only sends the message if the target window belongs to the current process. So, you must use SendMessageTimeout(WM_GETTEXT) instead. The reason for this is it allows applications to call GetWindowText() without hanging if the target window's process is hung. I can't make it any clearer than that.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hi,
I need to read/write the text of a custom control. I only have the following information: it's ID, it's HWND, it's class name and that's all. It does not answer to messages like WM_GETTEXT, etc. I need a fairly generic procedure to do this, on different type of windows versions.
The id and class name are the constant bits, that do not vary with execution. For example, a FLEXLIST control is listed by Visual C++ (when loading the EXE file and looking into the Dialog resource directory) as a ListBox control, but it does not answer to any LB_ messages.
A possible generic (and very convoluted) solution for reading would be to obtain the bitmap of the control and execute some ocr on it.
Any other ideas?
|
|
|
|
|
I have one main dialog. In that I have to show another child dialog. The child dialog's height is more than parent dialog. I have to impliment scrollbar. How to impliment. Seniors, any help. Thanks.
Nice talking to you.
|
|
|
|
|
Ohhhh....... greate.
I got good solution.
here
Thank you code project.
Nice talking to you.
|
|
|
|
|
we are calling a function in a 3rd party DLL that will return an allocated structure :
Struct {<br />
member* 1stMember;<br />
member* 2ndMember;<br />
member* 3rdMember;<br />
};<br />
Struct* MyStruct = NULL;<br />
MyStruct = someDLLFunction();
on Windows 2000, the last member of the structure (3rdMember) is set to NULL, and on Window XP, the last member is set to 0xabababab, for the same input values.
As I understand from various google search, 0xabababab is set by a call to LocalAlloc and is used by the memory allocation bookkeeping.
I'm kind of at loss at what is happening there, I'm trying to contact the DLL vendor to see if they can reproduce the behaviour.
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Try reverse engineering the dll to find out what causes the problem.
Don't try it, just do it!
|
|
|
|
|
I'm updating a project from Visual C++ 6 / MFC 6 to Visual C++ 2003 / MFC 7. The solution has 5 projects, consisting of an exe and some dll's. Everything's gone pretty well, and I've recompiled and linked the dll's. I've now ran into a problem with the exe. It's compiled it okay, but it won't link. I get a LNK1104 error: "cannot open file mfc42d.lib'"
Obviously, I don't want to link with mfc42d.lib - I'm moving on to MFC 7. So I want to delete the reference the project has to this lib. And here's my problem: I can't find that reference. I've been through the settings (Project -> Properties -> Linker -> Input) and there's no mention of mfc42d. I've also searched all the files in the directory for the text "mfc42d", and there's no sign of it (except my build errors log). Where on earth is it getting mfc42d from? And how can I get rid of it?
-Dy
|
|
|
|
|
One other way that library references get into your code is through the #pragma comment(lib, ...). Admittedly your find-in-files should have picked this up - unless the pragma's hidden in a library header outside of your project.
To help track it, turn on 'verbose' mode on the linker tab - it spews out a huge amount of essentially useless information, but buried in there may be a handy clue as to why the linker thinks it needs your 'retro' DLL! Happy hunting!
Matt Godbolt
Engineer, ProFactor Software
StyleManager project
|
|
|
|
|
Thanks, that's really helpful, I had no idea that was there. It's told me that the mfc42d reference is in a thrid party lib in another directory all together (..\..\ ...). On the next challenge then....
-Dy
|
|
|
|
|
Hi All,
I am searching for a way to fading black the entire screen to do some effects.
Is this possible to programmatically control contrast and luminosity with the graphic card (maybe DirectX?) or to fade to black the desktop window?
Thanks.
|
|
|
|
|
One way to do this is to overlay the desktop with a new window (that paints itself black). Then, change the transparency of that window from completely transparent to completely opaque.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
In fact, I had this solution in mind, but I wanted to know if another way could exist.
Thanks for your reply.
|
|
|
|
|
Hi,
I'm wondering whether Visual Studio .Net 2002/2003 has a similar feature, which I used sometimes in Borland CBuilder quite extensively. When debugging an application, all valid breakpoints were marked in the debugger view of the source editor. This way, one could easily find unused / never called functions. Visual Studio only sets a breakpoint to the next valid position, if one accidentially tries to set a breakpoint to an unused codesection.
Is there an easy solution to setting up the editor to show all compiled codelines ? Or are there any AddIns, which manage that? This would be a great help for code cleanup, when trying to remove unused #idef switches, functions, etc.
Thanks,
Florian
|
|
|
|
|
VS.NET does not need to detect unused routines because in release mode they are not included in the executable (removed by the linker).
Don't try it, just do it!
|
|
|
|
|
Hi,
Alexander M. wrote:
VS.NET does not need to detect unused routines because in release mode they are not included in the executable (removed by the linker).
well, that's not my main problem. I want to use the information what is NOT compiled to do some refactoring and cleanup of the source code. Therefore it would be extremely useful to see all codelines marked, which are really existing in the binaries. Of course, this is just one small step into refactoring old code.
Any tools or settings known to achieve this ? This was really nice in CBuilder.
Bye,
Florian
|
|
|
|
|
Hi, I need to know the status of a process? I launch a simulation programm that runs about 1 minute. During that time, I must find a way to question the process to know if it's actif or not. I know that I can use WaitForSingleObject(process, INFINITE); to wait until it's finish, but for some personnal reason, I can't use it for my project.
How can I find the status of a process? I would like to have a function like GetStatus(process, ID) of somme sort. True if it'a still actif and false if finish!
HANDLE process;
process=launchViaShellExecute(path,CommandDOS);
//GetStatus(process) (Actif or not)
Thanks
JS
|
|
|
|
|
GetExitCodeProcess
However, I hope you can overcome your 'personnal' reason, because without using WaitForSingleObject you are now actively avoiding the proper and recommended manner to detect that the process has exited.
|
|
|
|
|
I agree totally with Blake's sentiments here; but another (possibly as ugly) alternative is to call WaitForSingleObject(handle, 0); - this checks the state of the object wihtout blocking.
A return code of WAIT_TIMEOUT would mean the process is still running, otherwise the process has exited.
Matt Godbolt
Engineer, ProFactor Software
StyleManager v1.00 now released!
|
|
|
|
|
I create combo box dynamically
<br />
CComboBox *combo;<br />
combo = new CComboBox;<br />
CRect rt(10,0,100,10);<br />
combo->Create(WS_CHILD|WS_VISIBLE|WS_VSCROLL|CBS_DROPDOWN, rt, this, IDC_COMBO3);<br />
but when I click on the drop down arrow, the drop list don't appear. Only a thin narrow black line is shown below. How can i extend the drop down list?
thanks.
|
|
|
|
|
If you are using Visual studios go into the Resource view, and find you dialog box. open the box then put the cursor over the down arrow that would normally open the list. This will cause a outline of your drop-down list box to show up make the outline larger, for some reason the default setting "even though it looks big enough to show information" is so small it will not display anything.
|
|
|
|
|
I can't customise it through controls and resource view, the combo box is created dynamically , not in resources.
|
|
|
|