|
|
Hello,
I have got a handle to a window:
HWND hWndAddEditWindow = NULL;
hWndAddEditWindow = FindWindow(NULL,_T("New/Edit"));
I then open the window using the handle but I then need to populate the text boxes on the window who's names and ID's change each time.
I have been told that there is a way to get a handle to the first textbox, followed by the second textbox and so on, but I have not been able to work out how.
Please could someone help me out by telling me how I can get a handle to the first two textboxes in the window and send some text to them.
Many thanks
Willertron
www.willertron.com
|
|
|
|
|
The EnumChildWindows function enumerates the child windows that belong to the specified parent window by passing the handle to each child window, in turn, to an application-defined callback function. EnumChildWindows continues until the last child window is enumerated or the callback function returns FALSE.
You then could use the GetClassName function retrieves the name of the class to which the specified window belongs on each hWnd to make sure it is a text box.
|
|
|
|
|
after you get the handle to that window, use FindWindowEx() to go through the children. If you're using MFC, use mfc's CWnd version of FindWindowEx(). that way you can get a CWnd*, cast it to CEdit* and do whatever you want with it.
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
I start a new W32 console VC++ project from VC++ .net and
add a class (one .cpp and one .h files) to this project.
It gives an error when compiling:
fatal error C1010: unexpected end of file while looking for precompiled header directive
It doesn't happen in VC++ 6.0.
Could anybody pls help me on this?
|
|
|
|
|
try adding ...
#include "stdafx.h"
.. to the top of your .cpp
Software | Cleek
|
|
|
|
|
|
Hi im searching an alternative Function for ReadProcessMemory. Someone got an idea ?
|
|
|
|
|
Start by telling us why ReadProcessMemory isn't any good for you.
|
|
|
|
|
Im trying to Read the memory from a Game that blocks the ReadProcessMemory function so I ne an Alternative.
|
|
|
|
|
I have placed an WM_ONCHAR message in my view class handled by OnChar().
I would like to be able to call the OnChar() from my main class.
I have tried the "Access View Class from Anywhere" artical, but could not even get the example code to work.
Perhaps I could do as the thread below suggests, "Accessing property pages" (but I don't know what a property page), where data is placed in another class, where the view class could call and obtain it?
What I want to do is to send a character from the serial port (from my main class) to the OnChar() in the view class.
Thanks
John
|
|
|
|
|
Cant you try a PostMessage to the View Object
ViewObject->PostMessage(WM_ONCHAR , ....)
|
|
|
|
|
Thank you for that. That should work, I just don't know how to obtain the ViewObject part.
|
|
|
|
|
CMainFrame* pMainFrmWnd = (CMainFrame*)AfxGetMainWnd();<br />
ASSERT(pMainFrmWnd != NULL);<br />
CYourViewClass* pYourView = NULL;<br />
CWnd* pchildWnd = pMainFrmWnd->GetWindow(GW_CHILD);<br />
ASSERT(pchildWnd->GetSafeHwnd() != NULL);<br />
while(childWnd->GetSafeHwnd() != NULL)<br />
{<br />
ASSERT(childWnd->GetSafeHwnd() != NULL);<br />
if(childWnd->GetRuntimeClass()->m_lpszClassName == "CYourViewClass")<br />
{<br />
pYourView = (CYourViewClass*)childWnd;<br />
break;<br />
}<br />
childWnd = childWnd->GetWindow(GW_HWNDNEXT);<br />
}<br />
ASSERT(pYourView != NULL);
Rahim Rattani
Software Engineer,
Matrix Systems (Pvt) Ltd.,
Karachi - Pakistan
|
|
|
|
|
Hi
I need some help for fuzzy logic and how
i can implement the fuzzy set in c++ code
.
Any help can help me
Thanx for u.
On Earth nothing impossible,
while your mind running.
Faroqtam
|
|
|
|
|
hi did u implement the fuzzy code ??? i need your help
|
|
|
|
|
Time and again I have wanted to use the Doc View Arcitecutre in my apps , but the simplicity of Dialog apps has prevented me from doing this . Here is a scenario which I think calls for using the Doc View
I need two views objects (v1 and v2) of the same class VT that contains some tabular information (like a giant table of data) . v1 and v2 need to have the same representation but their data sources differ , otherwise UI wise they are exactly the same .
I need the following functionality
1. Individual display for V1 and v2
2. Vertical tiling of V1 and v2
3 Common Print preview functionality for information in v1 and v2 that I guess calls for a new View class VC
4 I do not need a Document class
What path (SDI ? MDI ? ) should i take as both do not provide for a Doc with multiple views .
Need some input
Thanks for your patience .
Engineering is the effort !
|
|
|
|
|
If you click the below link to 'My Articles', I have one I did called 'QuickQuery'. This is an SDI that starts off using a CFormView, but can switch to CListView. It's not the best code in the world, but it switches view types.
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
Really nice article . I might need that functionality . Thank you . Now I can practise my SQL using ur tool !
|
|
|
|
|
|
Hi frnz,
Thanks for ur Response but solution u all gave is for Dialog..but i need to store my data in Database so i need to support SDI...not Dialog.Can u help me in making SDI app into to SystemTray Icon apps...
waiting for ur Earliest reply
|
|
|
|
|
|
I have a property sheet. I use this one here:
http://www.codeproject.com/property/wizardpropertysheet.asp
Within the property sheet are several property pages. Lets
say Im in PropertyPage2. How can I access a value from
PropertyPage1? Im stumped. I know I can save a value to
an ASCII file and then open that in the other propertypage,
but Im looking for a more direct route and cant get anything
to work.
Please, please, any response any one can give me will be
greatly appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
You could hold all values for all pages within a class or struct eg CPropertiesData. If you instantiate this class within the property sheet it will be accessable from all property pages.
When you alter any properties for any page you can then set the appropriate property within the CPropertiesData class.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
And you can read from your CPropertiesData class in each of the OnSetActive method of the property pages and write it back out to the CPropertiesData class in the OnKillActive, in case a different property page has modified some of the data in between the visit to each page.
|
|
|
|