|
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.
|
|
|
|
|
Open a command window.
go to Start->Run, type in "cmd" and click OK
In Command window type in "ipconfig" click ENTER key
You can see the IP address here.
|
|
|
|
|
He posted his question in the Visual C++ forum.
--
Pictures[^] from my Japan trip.
-- modified at 16:10 Sunday 1st January, 2006
|
|
|
|
|
I think he would like to get ipaddress using Visual C++ code instead of go cmd line.
|
|
|
|
|
mehrdadov wrote: I want to get my Computer IP.How can I do it?
gethostbyaddr
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|