|
|
For get or set text you need to handle(hwnd) do you have any CWnd of that window if you have you can use of this code if you run this code on your program it change text of all controls to 123 and vice versa for get text of control (if you have code can you show it dont need to post all code)
for(CWnd* pWnd = GetTopWindow(); pWnd;pWnd = pWnd ->GetNextWindow())
{
pWnd ->SetWindowTextW(_T("123"));
}
|
|
|
|
|
I have only hwnd of main window, and enumchildwindows doesn't return any child windows, but I can see them on form. Please read my first post carefully.
|
|
|
|
|
Can you use of FindWindow ?
|
|
|
|
|
Hi All.
I have a problem regarding disappearance of cursor.
Lets say, I have 2 windows [or Text editors] in an application. I also have a frame that take care of some HTML pages.
Now, when I swap in between above mentioned 2 windows, I used to get a cursor on the clicked window.
----PROBLEM----
In case I have the focus on Window 1 and then if I click on the frame, my focus still stays on Window 1. Cursor disappears, thats normal. But when I click back on this window, I am not able to get my cursir back. Also, in that case, if I click on Window 2 and then back on Window 1, I get muy cursor back.
Any pointer/hint will be helpful.
Thanks
PanB
|
|
|
|
|
Hi,
I need to somehow make my dialog start up hidden. I have a line of code in my own DoModal function that creates the dialog and then executes my own function, which fades the window from completely transparent to opaque. Unfortunately, the CreateDlgIndirect function (which is used to create the dialog) has to be executed BEFORE my fading function, since my function needs to access the created window to do the fade. But what happens is, the window is created and made visible, and THEN my function is executed, which results in a nasty flicker before the fading. Here is my line of code:
if (CreateDlgIndirect(lpDialogTemplate, CWnd::FromHandle(hWndParent), hInst) && CloseSmoothly(m_hWnd, FALSE))
Now, I'm wondering if there is any way to modify lpDialogTemplate so the dialog starts up hidden and nothing flickers. I've tried lpDialogTemplate->style=SW_HIDE , except I get an error: error C2166: l-value specifies const object .
So, is there any way to stop the CreateDlgIndirect function from making the window visible after it is created?
Thanks in advance.
|
|
|
|
|
Have you tried:
lpDialogTemplate->style <big>|=</big> SW_HIDE
??????
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I get an error when I do that. The error says "l-value specifics constant object."
|
|
|
|
|
I think the error comes because the parameter has to be set before creation. For example, I use it (like that) in my CChildFrm inside PreCreateWindow(CREATESTRUCT& cs), but this is not valid for dialogs, just for views/windows (I'm not 100% sure about this last sentence).
I can not tell you a right solution, but a bypass/trick that could work is to use the MoveWindow or SetWindowPos inside your OnInitDialog and set the coordinates in a value that ensures it goes outside the area of desktop, or do it so small that is not seen.
For example.
BOOL CMyDlg::OnInitDialog ()
{
MoveWindow (3000, 3000, width, height, FALSE);
MoveWindow (0, 0, 1, 1, FALSE);
}
Hope it helps
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I am trying to use function CCmdTarget::OnEvent(...). I do not know what parameters I have to input. Please help me with a sample. Thank you.
|
|
|
|
|
Have you try it on MSDN. I can't found such a member function on CCmdTarget:: at all on MSDN Library 2005.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Hi all,
If you guys know a best resource (a book, tutorials, e-books, etc) which I can use to learn MFC from the basis pleas let me know.
Thanks a lot....
I appreciate your help all the time...
Eranga
|
|
|
|
|
This [^] & this[^] might help you a lot. I would better suggest you to read some books like Programming in MFC, WIN32 - Charles Petzold to start with and then move on to more intricate and complicated things.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Actually I used C++ How To Program by Deitel and Deitel. Actually there are lots of theories, need more time to come across with it. It is great for long way to go. But I'm looking some materials which explain both coding as well as the use of GUI. Right now I use Visual Studio .Net 2003.
Thanks
I appreciate your help all the time...
Eranga
|
|
|
|
|
You dont want to start to learning c++ you know some things but what?
|
|
|
|
|
Actually I know some basis on Win32 applications. I want to learn MFC as well, basically to develop interfaces for my code(ie. for my applications)
I appreciate your help all the time...
Eranga
|
|
|
|
|
You have two options if you want to start with MFC so my suggestion is using of MSDN for start because you can find articles on the Codeproject or Codeguru or Codersource but generally they are for time you know some things of MFC.(and also if you can provide a book about MFC will be helpful for you)
|
|
|
|
|
|
If you dont have a computer at home its good idea that print documents and see them at home however for test some things you need to computer.;)
|
|
|
|
|
Of course I need a computer to test those things. Right now what I've done is read them and write my test code a paper and later test them when I found a machine
I appreciate your help all the time...
Eranga
|
|
|
|
|
|
Thanks pal, I'll try my best to learn those stuff really well.
I appreciate your help all the time...
Eranga
|
|
|
|
|
|
Thanks pal,
I use Visual Studio .Net 2003 and really looking for tutorials with GUI base explanations. Do you have such links with you.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Codeproject is good place for you it has a lot articles that are helpfuls for you.
|
|
|
|