|
Howdy all.
First, I want to apologize for what I am about to do. Yes, I am going to ask a how to related question.
See, I am messing with CListCtrl objects and find that I want to insert an image in a subitem. I can do this, it isn't hard. My problem is that once the subitem image is added, the main item also seems to be forced to have an image. I was wondering if anyone else had this happen to them.
Thank you.
|
|
|
|
|
I messed around with it for a few minutes, and it looks like just doing a ListView_SetImageList() call forces every column 0 item to have an icon.
I.e., if you do:
LVITEM i = {0};
i.mask = LVIF_TEXT;
i.pszText = _T("blah");
ListView_InsertItem ( hwndList, &i );
The "blah" item gets image #0 in the image list, even though LVIF_IMAGE wasn't in the mask.
|
|
|
|
|
Hi.
Please, i want to add two different color lines to a EditBox, dunno if it's possible, i want by example, one red and one blue.
Can anyone show me the code on how to do this?
Thanks in advance.
Regards, James.
|
|
|
|
|
I want to download a file using WinInet API/MFC. I can't use FTP. File might be any type such as bmp, dwg, or doc. Any ideas???
Thanks in advance.
|
|
|
|
|
|
I ran your exe. I got error download failed: Error 80004004 during download. I tried to download asp and dwg files. I tried to download file http://www.mindcracker.com/my/mh.dwg
Any ideas?
Thanks for your help.
Mahesh
|
|
|
|
|
I'm having one of those "stupid" problems.
I have a basic ATL ActiveX control with a child TreeView. In the control's message map, I handle WM_NOTIFY for TVN_KEYDOWN, with the intent of catching VK_F5 and VK_DELETE. However, my handler is never called for these key presses.
I do process PreTranslateMessage(), and allow these keystrokes to reach the control, just as I do VK_LEFT/RIGHT/UP/DOWN, which do make it into my TVN_KEYDOWN handler.
Spy shows that the control isn't sourcing a WM_NOTIFY for those keystrokes. ??? Why the heck not?? Is my container messing with me? The listview control is receiving WM_KEYDOWN/UP messages for all keys.
Regards,
Nick Hodapp
|
|
|
|
|
I haven't fixed this problem yet, but I think I understand the issue. I think that my container -- including the Test Container, has an accelerator table defined to map keystrokes to commands. The tree control, upon receiving WM_KEYDOWN is calling TranslateMesssage(), and upon finding that the keystroke is mapped, discontinues processing.
Ugh. Fine. I will unleash my subclassing power upon the meek and prevail.
Nick
|
|
|
|
|
I had a big problem with Enter Key in tree control.
I found a bug report on MSDN.
You may try article "Q130691"
or http://support.microsoft.com/support/kb/articles/Q167/9/60.asp
hope it can help.
larry
|
|
|
|
|
Hi every body,
During long processing, i display a modeless dialog like this :
CModelessDlg * DlgAttente; // CModelessDlg is my class
DlgAttente = new CModelessDlg;
DlgAttente->Create(IDD_DIALOG_ATTENTE,this);
DlgAttente->ShowWindow(SW_SHOW);
DlgAttente->m_Message="Please wait, processing is being......";
DlgAttente->UpdateData(FALSE);
m_message is a variable bind to CStatic control ( label ). It shows my messages.
This code work well, but if i display another window, for example, windows explorer, Bloc Notes, then close it, my modeless dialog don't refresh. The message show on it by my CStatic disappear without trace.
Can anybody help me ??
Thanks in advance
|
|
|
|
|
You need to process waiting Windows messages during your "long processing". If your long processing is a loop, simply add code like this inside the loop:
MSG msg;
while (::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
::DispatchMessage(&msg);
This will periodically dispatch waiting messages -- including the WM_PAINT messages that are waiting to be processed for your dialog.
Alternatively, do your "long processing" on a separate thread.
Regards,
Nick Hodapp
|
|
|
|
|
I know that somehow you can draw a unicode character from a font that contains the character using the glyph index. MSDN contains a brief article about a tehcnique for mapping the unicode number to a glyph index so it can be rednered using exttextout - however I can not get this technique to work. Can someone please lend a hand and provide a simple example of how to draw a foriegn character on a dc in windows 95/98. Ie can do this, there must be a way
|
|
|
|
|
You can use ExtTextOut and glyph index to display any glyph in a font;
Or you can use TextOutW or ExtTextOutW to display UNICODE string without using glyph index.
http://www.amazon.com/exec/obidos/ASIN/0130869856
|
|
|
|
|
How can I get serial number of hard drive in Win32?
|
|
|
|
|
G'day Vaslieyev,
One way that I know of is with the ::GetVolumeInformation() function. There may be other ways though.
Hope this helps.
Steve
|
|
|
|
|
Check out the GetVolumeInformation() win32 api function...
CString sRootPath = "C:\\";
char sVolumeNameBuffer[MAX_PATH];
char sFileSysNameBuffer[256];
DWORD nFileSystemFlags = NULL;
DWORD nVolSerialNumber = NULL;
DWORD nMaxFNameLen = NULL;
::SetErrorMode(SEM_FAILCRITICALERRORS);
::GetVolumeInformation((LPCTSTR)sRootPath,
sVolumeNameBuffer,
sizeof(sVolumeNameBuffer),
&nVolSerialNumber,
&nMaxFNameLen,
&nFileSystemFlags,
sFileSysNameBuffer,
sizeof(sFileSysNameBuffer));
|
|
|
|
|
I'm having a hard time forcing my ATL control to size itself.
I tried SetWindowPos and MoveWindow. They each return 1, meaning "OK", but the control never changes size.
Is there something else I need to do to make the resize happen?
(i'm testing it on an MFC dialog app, but i want to be able to use this anywhere).
-c
|
|
|
|
|
When Creating you ATL Control make sure that you expose the AutoSize Stock Property. Then in the InitialUpdate or InitDialog Function of your app set the AutoSize Property = false; I suppose that alternately you can find some mechanism to set it inside the control to always be false, but I just did a quick run through and didn't dig to deeply.
|
|
|
|
|
(I hope this is in the right forum).
I want to get the contents (in source code) of a CHTMLView after it has loaded into a CString. I am currently overriding the OnDownloadComplete virtual function, and attempting to get the documnts html using the GetHtmlDocument() function. The only problem is that it is of type IDispatch rather than a CString, so I can't use how I wanted to.
Can anybody help me to get the contents of the CHTMLView into a CString?
Thanks in advance,
James Corrie
|
|
|
|
|
Hi everyone,
I need help with converting Text Files into Access table and hope you can help me out.
I have 2 TEXT FILES, first that contains the table name, and its attribues, and the SECOND file contains the values of the table.
So if the first TEXT FILE that has the following table values:
tablename
field1, integer
field2, string
field3, integer
field4, string
then another TEXT FILE will contains the values for the table:
1, john, 6, smith
2, steve, 7, clark
3, carrie, 8, wayne
4, dan, 9, chait
5, erin, 10, alan
what i need to do is to read the values from the FIRST TEXT FILE that contains the table attributes and create the table.
Then i need to read the SECOND TEXT FILE and plug in the values. so at the end, i'll have a Access table like:
field1 field2 field3 field4
1 john 6 smith
2 steve 7 clark
3 carrie 8 wayne
4 dan 9 chait
5 erin 10 alan
But i need the readings of BOTH TEXT FILES to be dynamic so it'll work if the TEXT FILE has x number of columns, and x number of rows.
and i also need the reading to be dynamic so it can read the values from the SECOND TEXT FILE no matter what kind of values it contains, ie, integer, string, char, etc...
If anyone can help me out, Please let me know.
Thanks in Advance.
Steve
|
|
|
|
|
I have problem of finding the curson's position!! When the curson is not inside the program that I create!!!!
|
|
|
|
|
Check out the AttachThreadInput() Win32 API call.
Sorry, that's the best I can provide without spending a lot of time trying it out myself.
|
|
|
|
|
The following code gets the current mouse position :
POINT point;
GetCursorPos(&point);
The problem is to get this code called whenever the
mouse moves. WM_MOUSEMOVE only generates messages
when in the application window. The only way I have
found to do it is as follows:
1) add a WM_TIMER message to your application
2) code it as follows :
void YOUR_CLASS::OnTimer(UINT nIDEvent)
{
CDialog::OnTimer(nIDEvent);
POINT point;
GetCursorPos(&point);
3) start the timer :
SetTimer(1,200,NULL);
|
|
|
|
|
But is it possible to create a rebar that is permanently attached at the bottom edge of the frame, just above the status bar (and support show/hide also)?
|
|
|
|
|
How do convert an BSTR to an LPSTR.
I got the wrong value with this code:
CComBSTR strChatter("asdf");
char *cmdLine;
cmdLine = (char *) strChatter.m_str;
Im new on this and look forward to an answer.
Regards Jonas
|
|
|
|