|
Does anyone know how I can temporarily disable the Windows keys (the ones that trigger the start menu)?
I tried a SetWindowsHookEx(WH_KEYBOARD,...) but my callback function never got called. (a snippet of sample code would be nice )
Thanks,
Marc.
|
|
|
|
|
Check your code. WM_KEYDOWN message with code VK_LWIN/VK_RWIN can be hooked (if use WH_GETMESSAGE). I think, WH_KEYBOARD can hook this keys too.
|
|
|
|
|
Thanks..
Actually I just forgot to put AFX_MANAGE_STATE(AfxGetStaticModuleState()); inside my callback proc so i couldn't see the TRACE output .
Now I see the WM_KEYDOWN messages for VK_LWIN and VK_RWIN in both the WH_GETMESSAGE and WH_KEYBOARD hooks, but I still can't figure out how to disable those messages once I intercept them?
...anyone please?
Cheers!
Marc.
|
|
|
|
|
My code looks like this:
CFileDialog m_FileDialog(FALSE);
m_FileDialog.m_ofn.Flags = OFN_HIDEREADONLY;
m_FileDialog.m_ofn.lpstrFilter = "Rich Text Format (*.rtf)\0*.rtf\0");
m_FileDialog.m_ofn.lpstrDefExt = "*.rtf";
m_FileDialog.DoModal(); <-------------------
Why do I get an assertion failed on DoModal() ???
|
|
|
|
|
Please show me where to put a *.lib file so that it will work? Right now, I put the library file in the same folder as the header file is, but the vc++ compiler still does not see the library file.
Thanks
|
|
|
|
|
There's at least a couple of ways to do it. The one I like most is simply to add the lib to the project, as you would do with a regular .cpp file.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Please show me how to import a *.lib file into my MCF project?
Is it possible to view a *.lib file using VC++ ?
|
|
|
|
|
Project / Settings | Link, Import Object/Modules
peter ho wrote:
Is it possible to view a *.lib file using VC++ ?
if you mean "can i find out which functions are available?" then no, there is no way to do that from VC. you will need the header files (.h)that should be included with any library.
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
peter ho wrote:
Is it possible to view a *.lib file using VC++ ?
No. As Chris pointed out, you'll need the library's header file to call functions in the lib. If you're just curious and want to know what functions are exported, you can use the "nm" command that's part of the MKS toolkit.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I need to process certain Ctrl+<char> key presses in an Edit control while disabling some of the standard behavior (for e.g. Ctrl-X). Is there a way to handle these even when the app has accelerator table defined? Is handling PreTranslateMessage() the only way to go about this?
Any pointers would be appreciated. Thanks.
Chen Venkataraman
|
|
|
|
|
I would do it in the WM_KEYDOWN handler. check if the key you want is pressed and use GetKeyState(VK_CONTROL) < 0 to check if the control key is down. If both these conditions are present, call your handler, or else call the default WM_KEYDOWN handler.
HTH
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Orgasms are universal!! -- Mike Mullikin in The Lounge 21:27 15 May '02
|
|
|
|
|
Hello,
Does anyone know where I can find an example (or could someone post an example) of how to Double Buffer my MDI ClistView? I have done extensive searches on Codeproject and Codeguru but all I can find is examples for CListCtrl's which dont seem to work with the CListView. (esp. when I resize the window).
Thanks
Rob
|
|
|
|
|
Have you tried subclassing the underlying list control (accessible with GetListCtrl ) and doing the double buffering stuff there?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I've never had enough trouble w/ flicker to bother, but really, the process should be the same as for a CListCtrl - at heart, that's what CListView is. What have you tried?
--------
This is what we've waited for
This is it boys, this is War! --Shog9 --
|
|
|
|
|
Perhabs you could also try to suspend redrawing when changed occurs:
send WM_SETREDRAW with a boolean flag to the list do the work
|
|
|
|
|
That sounds like a good suggestion. You might want to reply to the original poster though, so he gets email notification.
--------
This is what we've waited for
This is it boys, this is War! --Shog9 --
|
|
|
|
|
Hi.
I am in the debugging phase of a simple message program using Winsock API. The program has both server and client features. The user can choose to be a server or a client. Anyways, everything works including server start, stop, accept client, and send data. However, I am having problems receiving data. WSARecv fail with the error WSAEFAULT.
-----
// WSAEFAULT: "Bad address"
-----
I have tested both sides. I get the same error no when I try to receive data from the server end and from the client end. Again, sending the data works fine, its just that I cannot receive the data.
Here is the function to read the data.
-----
if (socket != INVALID_SOCKET)
{
DWORD bufferSize = 0, receivedSize = 0;
WSABUF bufferHDR,
bufferDATA;
char *header = new char[4], *data;
bufferHDR.len = 4;
bufferHDR.buf = header;
// The program never makes it pass this point
if (WSARecv(socket, &bufferHDR, 1, &receivedSize, 0, 0, 0) == 0)
{
bufferSize = static_cast<dword>(*bufferHDR.buf);
data = new char[bufferSize];
bufferDATA.len = bufferSize;
bufferDATA.buf = data;
receivedSize = 0;
DWORD bufferProgress = 0;
while (receivedSize < bufferSize)
{
if (WSARecv(socket, &bufferDATA, 1, &bufferProgress, 0, 0, 0) == 0)
{
newData += bufferDATA.buf;
receivedSize += bufferProgress;
}
else
{
DetermineErrorWSARecv();
receivedSize = bufferSize;
}
}
UpdateAllViews(NULL);
}
else
DetermineErrorWSARecv();
delete [] data;
delete [] header;
}
-----
Have you experienced a similar problem?
Thanks,
Kuphryn
|
|
|
|
|
I'm not sure about this, but maybe you need to provide an lpFlags parameter (initialized to 0).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks.
JuNC brought up that point at GameDev as well. I tried to pass ni MSG_OOB, but I believe WSARecv wants a LPDWORD. I am not sure about how to convert MSG_OOB to an LPDWORD variable.
Kuphryn
|
|
|
|
|
Okay. The solution to set declare a DWORD and pass that variable into the function (referece).
-----
// DWORD flags = 0;
// WSARevc(socket, &bufferHDR, 1, &receivedSize, flags, 0, 0);
-----
Kuphryn
|
|
|
|
|
Hi!
Anybody know how can insert menu and menu items on Visual C++ Ide, like Checkbounds does?
I'm looking in MSDN but I can't find information
Thanks in advance.
|
|
|
|
|
Check Nick Hodapp's superb article Undocumented Visual C++.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
i write this code for delete 0.0.0.0 like route delete 0.0.0.0 , in winxp this code work fine,but in win98 not work...return invalid param...
look this code i help me please
PMIB_IPFORWARDROW pRow = NULL;
ULONG dwSize = 0;
DWORD dwStatus = 0;// Allocate some memory to store the row
inpRow = (PMIB_IPFORWARDROW)malloc(sizeof(MIB_IPFORWARDROW));
if (!pRow) {
MessageBox( NULL,TEXT("Malloc failed, Out of Memory!\n") , NULL, MB_OK );
exit(1);
}
pRow->dwForwardDest = inet_addr("0.0.0.0");
pRow->dwForwardNextHop = inet_addr("192.168.0.220");
pRow->dwForwardMask = inet_addr("0.0.0.0");
pRow->dwForwardIfIndex = 2;
pRow->dwForwardType = 4;
pRow->dwForwardProto = MIB_IPPROTO_NETMGMT;
pRow->dwForwardAge = 0;
pRow->dwForwardMetric1 = 1;
dwStatus = DeleteIpForwardEntry(pRow);
if (dwStatus == NO_ERROR)
MessageBox( NULL,TEXT("Route Added Successfully!\n") , NULL, MB_OK );
else
if (dwStatus == ERROR_INVALID_PARAMETER)
MessageBox( NULL,TEXT("Invalid Parameter!\n") , NULL, MB_OK );
// Free resources
if (pRow)free(pRow);
|
|
|
|
|
any idea ???
i try change all parm but in in w98 not work i have error "invalid param.." in winxp this work fine O_O
|
|
|
|
|
How do you put letters in a matrix instead of numbers? Char? Will it be able to convert to int?
|
|
|
|