|
-
August 25th, 1999, 02:56 AM
#1
Why doesn't this work???? HELP!
Here's my code:
[ccode]
char strTitle[101];
HWND hWnd = NULL;
HWND hwnd = NULL;
hWnd = ::FindWindow(NULL, "DlgTitle");
hwnd = ::GetDlgItem(hWnd, IDC_EDIT);
::SetWindowText(hwnd, "test");
Everything compiles fine, and it runs fine, except for my edit control doesn't say 'test'
why not?
I've debuged it and all the HWND's get the proper handles, and none of the functions fail...
so what could be the problem?
thank you..
Cube
-
August 25th, 1999, 04:30 AM
#2
Re: Why doesn't this work???? HELP!
Perhaps are you in the case described by the doc:
"However, SetWindowText cannot change the text of a control in another application."
HTH
K.
We're talking ****, 'cause life is a 'biz
You know it is
Everybody tryin' to get rich
God ****!
All I wanna do is live !
KoRn, Children of the Korn
-
August 25th, 1999, 04:39 AM
#3
Re: Why doesn't this work???? HELP!
use setdlgitemtext instead
-
August 25th, 1999, 04:46 AM
#4
Re: Why doesn't this work???? HELP!
Or ::SendMessage(hwnd, WM_SETTEXT, 0L, (LPARAM)(LPCSTR)lpszText)
Rail
------------
Recording Engineer/Software Developer
Rail Jon Rogut Software
http://home.earthlink.net/~railro/
[email protected]
-
February 19th, 2001, 03:02 PM
#5
Re: Why doesn't this work???? HELP!
This works fine if you want to send a string from CmyListCtrl to CMyListDlg
Make sure that your DlgTitle is correct tipped
//// Sample
#define IDC_EDIT 4321
GetDlgItem(IDC_EDIT)->GetWindowText(m_String);
//// Sample
HWND hWnd = NULL;
HWND hwnd = NULL;
hWnd = ::FindWindow(NULL, "DlgTitle");
hwnd = ::GetDlgItem(hWnd, IDC_EDIT2);
::SetWindowText(hwnd, m_String);
//
or
SetDlgItemText(IDC_EDIT2 , m_String);
-
February 19th, 2001, 03:12 PM
#6
Re: Why doesn't this work???? HELP!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|