|
Its an ID of a combo-box control
|
|
|
|
|
monsieur_jj wrote: Its an ID of a combo-box control
So is this a CComboBoxEx control, since you are casting the notification structure to NMCOMBOBOXEX type?
If so then you've got to handle notifications...
CBEN_BEGINEDIT, CBEN_ENDEDIT.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
|
The CBN_SELCHANGE message is send with WM_COMMAND where as TVN_SELCHANGED was with WM_NOTIFY. That why we have to use NOTIFY_HANDLER for handling the TVN_SELCHANGED. So if you want to handle the CBN_SELCHANGE, the macro to be used is COMMAND_HANDLER
COMMAND_HANDLER( IDC_UPDATEDAY, CBN_SELCHANGE , OnSelChanges )
and the proto of OnSelChanges should be
LRESULT OnSelChanges(WORD wNotifyCode,WORD wID,HWND hWndCtl,BOOL& bHandled );
|
|
|
|
|
|
when i read from file1 then write to athor file2, file 1 writen on file 2 but if file 2 contain lines more than file 1 ,this lines stay in the file 2
don't empty the file2 then write on
is there any solove to this problem?
|
|
|
|
|
Hi,
I don't think it behaves like you seem to imply.
most file systems I have encountered have this behavior:
- for sequential writing, when a file gets opened normally, it gets truncated to
zero length, then grows according to the new data; the exception is when it gets
opened for "append", in which case all new data comes at the end of the existing data.
- for random-access writing, all pre-existing data remains where ever you don't
write new data; and you could truncate at will.
I am pretty sure both good old C file system, and .NET File class, behave as explained
above, so I suggest you revisit your observations.
|
|
|
|
|
Please post the relevant code.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I am actually using Hans Dietrich's XListCtrl, but the question I have is general CListCtrl.
When I press the mouse in my CListCtrl resource, I don't know exactly which message I should be trapping and handling the event for. There are like HUNDRES of LVM_, LVN_, NM_, ...) messages.
I want to trap the message, do my operation, and then pass the normal message-handling onto the associated message in XListCtrl class.
I just want to trap a Left-Mouse Click, check the row/col (iItem, iSubItem), get which row was clicked, and then pass along to XListCtrl operation....
Thanks,
John John
|
|
|
|
|
john john mackey wrote: I just want to trap a Left-Mouse Click
You mean like NM_CLICK ?
led mike
|
|
|
|
|
If that be the one (obvious), then I will give it a try.
Thanks.
John John
|
|
|
|
|
Im writing a function that draws a titleblock in the bottom corner of the page and have it all drawn and still need to place a bitmap in the titleblock. Is there a simple way to do this, all my searches have come up with really complicated explanations.
|
|
|
|
|
Are you drawing a bitmap on a bitmap or drawing a bitmap to a window?
Are the bitmaps DDBs or DIBs (or something else)?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Drawing on a window page, similar to a visio page. Im just wanting to take a logo, either jpeg,bmp or some other picture file and be able to insert it into the title block I drew.
|
|
|
|
|
I suppose the easiest way is using GDI+
#include <gdiplus.h>
#pragma comment(lib, "gdiplus.lib" )
...
ULONG dwToken;
Gdiplus::GdiplusStartupInput input;
Gdiplus::GdiplusStartupOutput output;
Gdiplus::Status status = Gdiplus::GdiplusStartup(&dwToken, &input, &output);
if(status == Gdiplus::Ok)
{
Gdiplus::Bitmap SrcBitmap(L"c:\\my.jpg", FALSE);
Graphics DestGraphics(hwndWindowToDrawOn);
DestGraphics.DrawImage(&SrcBitmap, 0, 0);
Gdiplus::GdiplusShutdown(dwToken);
}
Note that if you use gdi+, all that initialization code only needs to be done once at application
startup and shutdown, so it really only takes 3 lines of code to load and render a bitmap.
Mark
|
|
|
|
|
Also, if you don't want to mess with GDI+ code directly yourself, there's
a handy ATL wrapper class CImage:
#include <atlimage.h>
...
CImage SrcBitmap;
SrcBitmap.Load(_T("e:\\test.jpg"));
SrcBitmap.Draw(hdc, 0, 0);
|
|
|
|
|
Using Visual C++ MFC in SDI application
I would like to read what other programs have displayed on my monitor screen. For example, if I have a webpage displayed by a browser, is there some way I can read from my C++ program what is shown on that browser's window?
Thanks ahead of time
|
|
|
|
|
You can use interfaces in MSHTML.h
Find the window handle of your browser. and then by using below interfaces you can get whole HTML of the web page which is open.
IHTMLDocument2
IHTMLWindow2
IHTMLElementCollection
IID_IHTMLDocument2
IHTMLElement
etc..
|
|
|
|
|
on my pc there is no file called MSHTML.h Where does not get this? I'm using Visual C++ 6.0. What do I need to upgrade to?
Thanks
Rahul Vaishnav wrote: You can use interfaces in MSHTML.h
Find the window handle of your browser. and then by using below interfaces you can get whole HTML of the web page which is open.
IHTMLDocument2
IHTMLWindow2
IHTMLElementCollection
IID_IHTMLDocument2
IHTMLElement
etc..
|
|
|
|
|
I have a web page already, but I don't know how to install the "Download" capabilities. Is there a tutorial somewhere on this?
A C++ programming language novice, but striving to learn
|
|
|
|
|
Larry Mills Sr wrote: How do you include "Download" capabilities in a Web Page?
Using Visual C++? You have created a Web Page using Visual C++?
led mike
|
|
|
|
|
No, but I do have a web page. I need to include "Download" capabilities for it but I don't have a clue as to how. I was hoping someone out there knew of a tutorial or something to show me how.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Hi,
I have created a win console application. When I run this application ..it just runs and disappears. If i use getch() before main return, then it waits for a key press. That is only when we press a key application closes.
So now I don’t want to use getch(). Is there any other way to hold the application, so that will not just disappear.
Thanks
Nandu
|
|
|
|
|
Several options here.
1. Open a command window first, then run your program from there.
2. Right-click on your executable and look at properties. Click on the Program tab, and clear the checkbox that says "Close on Exit".
3. If you have a shortcut (on the desktop for instance) do step 2 to the shortcut.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Hi,
I have tried the above points,
1. but still the window closes.
2. Right clicl on the exe dose not have an program tab or "close on exit" option as well.
So please suggest if there is any other option avilable.
Thanks
Nandu
|
|
|
|