|
will give me all key strokes on all child windows on a CFrameWnd derived class... i need to have capture function key strokes also and have the ability to decide whether they pass through or not
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Just a guess
Try looking into PreTranslateMessage()
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Thomas George wrote:
i need to have capture function key strokes also and have the ability to decide whether they pass through or not
I think you need OnKeyDown or PreTranslateMessage
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I do this using PreTranslateMessage().
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Hello,I need a full list of the windows hooks, could someone tell anything abaut this?
thanks
|
|
|
|
|
Anonymous wrote:
I need a full list of the windows hooks
That doesn't mean much IMO...
What do you mean a ful list of windows hooks...???
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
documentation here.
This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2002 Microsoft Corporation. All rights reserved.
|
|
|
|
|
Can you delete a toolbar icon from inside the Toolbar Resource Editor?
It seems the Resource Editor can only create them, but not remove them.
Thanks.
William
|
|
|
|
|
You can delete them. Just drag the button outside of the toolbar and drop it.
Shog9
------
No one's immune now, from a world of problems
No one's exempt now, from a world of pain
That's the way that it goes
when you're down here with the rest of us...
|
|
|
|
|
Thanks. I appreciate it.
William
|
|
|
|
|
Is there a way to do a bulk insert into an Access database that has no system DSN? I've created the DB on the fly with ADOX and now I want to be able to do a bulk insert using VC++. I know that there is a BULK INSERT command for SQL Server and I believe it is supposed to work with Access, however, I only see examples in the context of having a DSN defined. I just want to do so on the fly using a file path to the database. Any help would be greatly appreciated.
Thanks.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
I am trying to get a tooltip to show up for an entire window, not just a control. I know I am creating the window correctly, so I think it must be the values I am putting into the Toolinfo structure. If any one has any insight to what might be causeing the AddTool call to be failing I would appreciate it!
Here is my exact code of how I am doing it:
HWND hwndTT; // handle to the ToolTip control
TOOLINFO ti;// struct specifying info about tool in ToolTip control
WCHAR wszTTtext[]= L"This is your ToolTip string.";
/* INITIALIZE MEMBERS OF THE TOOLINFO STRUCTURE */
ti.cbSize = sizeof(TOOLINFO);
ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND;
ti.hwnd = hwnd;
ti.hinst = _Module.GetModuleInstance();
ti.uId = (UINT_PTR)hwnd;
ti.lpszText = (LPTSTR)wszTTtext;
// ToolTip control will cover the whole window
ti.rect.left = rect.left;
ti.rect.top = rect.top;
ti.rect.right = rect.right;
ti.rect.bottom = rect.bottom;
if(!SendMessage(hwndTT,TTM_ACTIVATE,(WPARAM)TRUE,0)){
WriteLog(_T(" > Could not Activate TooltipControl\r\n"));
}
/* SEND AN ADDTOOL MESSAGE TO THE TOOLTIP CONTROL WINDOW */
if(!SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti)){
WriteLog(_T(" > Did not Create TooltipControl\r\n"));
}
|
|
|
|
|
I'm programming winsock. In my app i'm building in a feature for sending multiple files over the internet. In the filesend request i set up a loop where i send the filename and -size of the files the user has chosen to send. My problems is this: the second time the sender of the files calls the recv function to receive the "GETSIZE" string, then, instead of receiving "GETSIZE" it receives the "GETSIZE" string but shifted one place to the right, so it's actually "\0GETSIZE" without a terminating null but with a starting null instead. Here are the loops how they look on the sender's and the receiver's side.
Receiver's side:
<font face="Courier New" size=2>
char szTempChar[512];
DWORD dwTotalFileSize = 0;
char szFileName[MAX_PATH+1];
bool bStop = false;
char szRecvBuff[513];
i = send(sckClient, "GETFILENAME", 12, 0);
i = recv(sckClient, szRecvBuff, 512, 0);
while (bStop == false)
{
strcpy(szFileName, szRecvBuff);
i = send(sckClient, "GETSIZE", 8, 0);
i = recv(sckClient, szRecvBuff, 512, 0);
dwTotalFileSize = dwTotalFileSize + atoi(szRecvBuff);
sprintf(szTempChar, "%s, %s bytes\r\n", szFileName, szRecvBuff);
AddText(ghMultipleWnd, IDC_MULTIPLEFILENAMEREQUEST, szTempChar);
i = send(sckClient, "GETFILENAME", 12, 0);
i = recv(sckClient, szRecvBuff, 512, 0);
if (!strcmp(szRecvBuff, "\\DONE"))
bStop = true;}
}
</font>
and the sender's side (szCompleteFileName is an array of char * pointing to a string that is the path to one of the files the user wants to send. GetFileName is a function that strips the path away from the complete filename
<font face="Courier New" size=2>
HANDLE hCheckFile
char szTempChar[512];
DWORD dwCurrentFileSize = 0;
char szFileName[MAX_PATH+1];
bool bStop = false;
char szRecvBuff[513];
int iFileCount = 0;
DWORD dwCurrentFileSize = 0;
i = recv(sckClient, szRecvBuff, 12, 0);
while (iFileCount+1 <= SendMessage(GetDlgItem(ghWnd, IDC_FILES), LB_GETCOUNT, 0, 0))
{
if (!strcmp("GETFILENAME", szRecvBuff))
{
strcpy(szRecvBuff, szCompleteFileName[iFileCount++]);
GetFileName(szRecvBuff);
send(sckClient, szRecvBuff, strlen(szRecvBuff)+1, 0);
i = recv(sckClient, szRecvBuff, 8, 0);
if (!strcmp("GETSIZE", szRecvBuff))
{
if ((hCheckFile = CreateFile(szCompleteFileName[iFileCount], GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != ERROR_SUCCESS)
dwCurrentFileSize = GetFileSize(hCheckFile, NULL);
else
dwCurrentFileSize = 0;
CloseHandle(hCheckFile);
sprintf(szRecvBuff, "%d", dwCurrentFileSize);
send(sckClient, szRecvBuff, strlen(szRecvBuff)+1, 0);
i = recv(sckClient, szRecvBuff, 12, 0);
}
}
}
</font>
The strange thing that happens is that the second time the sender's function runs the "i = recv(sckClient, szRecvBuff, 8, 0);" the result in the szRecvBuffer is "\0GETSIZE" without a termunating null. Now everytime the loop has run the string gets shifted one place to the right, so the second time the sender tried to receive "GETSIZE" it received "\0\0GETSIZ" and the same thing happens with the "GETFILENAME" it gets shifted one to the right afer each loop. I've beed fiddling with this for a long time now but can't figure it out, any ideas?
Thankyou
-Rune Svendsen
|
|
|
|
|
send(sckClient, "GETSIZE", 8, 0);
There are only 7 chars in this. I do not know what the behaviour will be in
this case.
you have to send a null character if you want it to go.
i would assume
send(sckClient, "GETSIZE", 7, 0);
would be more appropriate
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I believe the server and client are out sync. Use a diagram to plot your algorithm and make sure the server sends the exact size and the exact data; and the client receives the correct size and read the exact data.
Kuphryn
|
|
|
|
|
Hello!
How can I make to mark as selected the entire line on a CListCtrl Box.
When the first column was clicked, this was mark as selected, but I need that the line must be complete mark as selected like on a CListBox control.
Thanks.
Walote
|
|
|
|
|
Use the LVS_EX_FULLROWSELECT extended style:
pListCtrl->SetExtendedStyle(pListCtrl->GetExtendedStyle()|LVS_EX_FULLROWSELECT);
Shog9
------
No one's immune now, from a world of problems
No one's exempt now, from a world of pain
That's the way that it goes
when you're down here with the rest of us...
|
|
|
|
|
Thank you Shog9 for you answer, but I see another problem.
SetExtendedStyle and GetExtendedStyle is not supported for my compiler (Visual C++ 5.00), the style LVS_EX_FULLROWSELECT can not be found on the Help for this compiler. (Visual Studio C++ 5.00)
Must to be inserted a new class or any include file with the definition for this extended style.
Thank you again.
Walote
|
|
|
|
|
You may need to upgrade your version of Visual C++, or at least install the (free) Platform SDK. From my commctrl.h :
#define LVS_EX_FULLROWSELECT 0x00000020 // applies to report mode only Good luck!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
As Ravi stated, you should consider upgrading, or downloading the platform SDK. But for the moment, here's the info you need:
#define LVS_EX_FULLROWSELECT 0x20
#define LVM_SETEXTENDEDLISTVIEWSTYLE (LVM_FIRST+54)
#define LVM_GETEXTENDEDLISTVIEWSTYLE (LVM_FIRST+55)
::SendMessage(hWndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0,
(LPARAM) ::SendMessage(hWndList, LVM_GETEXTENDEDLISTVIEWSTYLE, 0,
0)|LVS_EX_FULLROWSELECT);
Shog9
------
No one's immune now, from a world of problems
No one's exempt now, from a world of pain
That's the way that it goes
when you're down here with the rest of us...
|
|
|
|
|
I don't know how to insert an icon into menu bar. In stead of showing the caption of item in menu bar, I want to show the icon to make it more beautiful.
Thank you for your reading.
Don't forget drop me some lines after reading.
|
|
|
|
|
DrawIcon() inside of DrawItem()
Make your menu item owner drawn and go nutts!!!
[edit]Your probably gonna wanna look at MeasureItem() also...[/edit]
Your not gonna need owner drawn if you just wanna have a small icon inside the menu item with normal text, just use bitmaps instead...and you'll have menus that look like VC++...Owner drawn is beautiful...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
How to write a simple application that can changed the DATE FORMAT.
I want to change the date format using my application instead of using Control Panel>Regional Option>Date to do.
|
|
|
|
|
|
I've just seen this in some code (CLabel from CodeProject).... i've nver seen syntax like this before but it works!!
m_monty
.SetFontName("Arial")
.SetFontSize(12)
.SetTextColor(RGB(255,255,0))
.SetFontUnderline(TRUE)
.SetBkColor(RGB(0,0,0))
.SetFontItalic(TRUE)
.SetFontBold(TRUE)
.SetBorder(TRUE)
.SetSunken(TRUE);
is this standard C++ or just a vc++ thing?
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|