|
Thanks so much for the response! I'm not very familiar with C++ functions. I know that SendMessage or PostMessage have many versions (all accept different parameters), but I have no experience in using them.
I know how to get the handle of a window/dialog (HWND), and pass the message constant WM_CLOSE, etc., but I'm not sure how to get the class of a text box, hence don't know how to loop through them. Is EnumWindows a function? And how do I use it? That below is what I think I'm most iffy about:
******************************************************************
-Loop through the text boxes inside IM (if more text boxes exists).
-When ever you get the text box from where you want to retrive the text
return TRUE from callback to terminate the enumeration. (one possible
approach to compare the text boxes is compare class name)
-EnumWindows must return you the HWND to (desired) text box.
******************************************************************
Could you please write me an example on how I would do that? THANKS!!
|
|
|
|
|
I am using Window CE emulator as a CPU choice to debug my eVC++ program.Can i able to open my PC's com port thrugh this emulator option.I am running this emulator in Window XP environment.
birajendu
CyberG India
Delhi
India
|
|
|
|
|
there is an example in VC samples, you can have a look.
open com port is by function CreateFile(...)
includeh10
|
|
|
|
|
ya...
I had tried CreateFile() function.I had not find any problem wen i ran my eVC++ code in window CE.Net board.
But my problem is I am tring to open the com port of my pc by a program written in eVC++ by building that program through Window CE Emulator.My pc has windows XP as current OS.
thanx in advance
birajendu
CyberG India
Delhi
India
|
|
|
|
|
I'm using Windows API. Usually i use the GetKeyNameText function, but i found that i'm not satisfied with it since it returns all upper case ascii, it return special character such as the enter and space as ascii "Enter" and "Space". Do you have recommendation about more suitable function or maybe a way to solve this (if there isn't any function like that)
thank you very much =)
|
|
|
|
|
Did you try
int ToAscii(UINT uVirtKey,
UINT uScanCode,
PBYTE lpKeyState,
LPWORD lpChar,
UINT uFlags
);
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Have you tried --- "GetAsyncKeyState" ?
Cheers,
Vishal
|
|
|
|
|
The GetAsyncKeyState function determines whether a key is up or down at the time the function is called, and whether the key was pressed after a previous call to GetAsyncKeyState.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
thank you, i tried the ToAscii function but got stuck: how can i supply the first and the second parameters? i only have access to wParam and lParam of the messages.
thank you.
|
|
|
|
|
There is method called CopyTo(src_start,dst,dst_start, length) in class String (VS ++ .Net 2003) . While dst is a Char or __wchar_t array. What will be the best way to Copy part of First String to another String? For example, String *Str=S"dirName/filename", I would like just take the file name so I start copy from 8 from Str to another Char dst[]. But dst is not String instance.
Any better ideal? Thanks
|
|
|
|
|
Hi,
How to make bi directional microcontroller program(keil,like c).
|
|
|
|
|
What do you want to be bidirectional?
-Prakash
|
|
|
|
|
Hi,
in my project i have to develop a GUI to control
configuration of a microcontroller. I developed GUI
using VC++6.0 and microcontroller programs in Keil.
These both programs will run on same pc, and now i
have to make communication beween these both programs.
If anyone have any idea kindly advice me .
Thanking you
with regards
sheshidar patnam
|
|
|
|
|
The application that you have developed and compiled in kiel, does it work in some emulator or a standalone application.
-Prakash
|
|
|
|
|
Hi there,
How can i make a Brush with default window color ?!
I just tried below code, but it doesn't work :
HBRUSH hBrush = ::GetSysColorBrush( COLOR_WINDOW );
When i use below code to make the brush (with XP default window color), it just works fine (as u see, the i passed the color HANDY (!!), i'm looking for code that make that automatically. ) :
HBRUSH hBrush = CreateSolidBrush( RGB( 236, 233, 210 ) );
I want to use the brush for painting a Static Control (Custom control) background ... (in CtlColor function, ON_WM_CTLCOLOR_REFLECT() msg)
Please help
Regards,
Hadi
|
|
|
|
|
YESSS !
The problem has been solved
ROCK ON !!!
Regards,
Hadi
|
|
|
|
|
Now thats what I call a good answer!
INTP
Every thing is relative...
|
|
|
|
|
I want to get my Computer IP.How can I do it?
Agh
|
|
|
|
|
go to www.whatismyipaddress.com to see it at once.
includeh10
|
|
|
|
|
includeh10 wrote: go to www.whatismyipaddress.com to see it at once.
This will give you the public ip if you are behind a proxy.
-Prakash
|
|
|
|
|
He posted his question in the Visual C++ forum.
--
Pictures[^] from my Japan trip.
-- modified at 16:09 Sunday 1st January, 2006
|
|
|
|
|
The best way to grab a list of all the ip addresses attached to your local system is using the IPHelper[^] library. You'll need to include the IPHlpApi.h and winsock2.h header files, then add iphlpapi.lib and ws2_32.lib to your list of import libraries.
MIB_IPADDRTABLE *pIPAddrTable = NULL;
DWORD dwSize = 0;
DWORD dwRetVal = 0;
if (GetIpAddrTable(pIPAddrTable, &dwSize, 0) != ERROR_INSUFFICIENT_BUFFER )
{
printf( "Error getting buffer size." );
}
else
{
pIPAddrTable = ( MIB_IPADDRTABLE * ) malloc ( dwSize );
if ( (dwRetVal = GetIpAddrTable( pIPAddrTable, & dwSize, 0 ) ) != NO_ERROR )
{
printf("GetIpAddrTable failed.\n");
}
for( int i = 0; i < pIPAddrTable->dwNumEntries; i ++ )
{
in_addr add;
in_addr subnet;
ZeroMemory( & add, sizeof( in_addr ) );
ZeroMemory( & subnet, sizeof( in_addr ) );
add.S_un.S_addr = pIPAddrTable->table[ i ].dwAddr;
subnet.S_un.S_addr = pIPAddrTable->table[i].dwMask;
printf("IP Address: %s\n", inet_ntoa( add ) );
printf("IP Mask: %s\n\n", inet_ntoa( subnet ) );
}
free( pIPAddrTable );
}
Gavin Taylor
w: http://www.gavspace.com
-- modified at 12:11 Sunday 1st January, 2006
|
|
|
|
|
Hi,
This works for me,
CString sLocalIp;<br />
HOSTENT *hs = NULL;<br />
UCHAR ch[4] = {0};<br />
CHAR szHostName[50]={0};<br />
<br />
if ( SOCKET_ERROR == ::gethostname((LPSTR)(LPCTSTR)szHostName, 50) )<br />
{<br />
return GetLastError();<br />
}<br />
<br />
<br />
hs = gethostbyname((LPSTR)(LPCTSTR)szHostName); <br />
<br />
if ( hs == NULL )<br />
{<br />
return GetLastError();<br />
}<br />
<br />
<br />
memcpy(ch, hs->h_addr,4); <br />
<br />
sLocalIp.Format("%d.%d.%d.%d", ch[0], ch[1], ch[2], ch[3]);
Hope this is also correct method.(((??)))
Jetli
Constant Thing In World Is Change.
|
|
|
|
|
The problem with that method is that it will only pullback one IP, the question was how do you retrieve the IP address for my local computer, it's quite possible to have several NIC's all with several IP addresses. The server sitting under my desk has 3 different IP's for instance.
But yeah, your way does work aswell
Gavin Taylor
w: http://www.gavspace.com
-- modified at 7:59 Monday 2nd January, 2006
|
|
|
|
|
Thats True
Many thanks Gavin.
Jetli
Constant Thing In World Is Change.
|
|
|
|