|
draw a sdi or any app
but base class should be viewHtml and it has OnInitialUpdate()
fun automaticlly change site name only
code is:
void CMyHtmlAppView::OnInitialUpdate()
{
CHtmlView::OnInitialUpdate();
Navigate2(_T("msdn.microsoft.com/visualc/"),NULL,NULL);
}
i think it help u
|
|
|
|
|
thank u so much.. it worked.. i m creating one application to make task of filling timesheet bit easier for my team members...
thank u once again.
Megha
|
|
|
|
|
Use ShellExecute to open the website in internet explorer in the following way -
ShellExecute (0, L"open", L"iexplore.exe", L"www.codeproject.com", NULL, SW_SHOWNORMAL);
|
|
|
|
|
NishantB++ wrote: ShellExecute (0, L"open", L"iexplore.exe", L"www.codeproject.com", NULL, SW_SHOWNORMAL);
nope, for 2 reasons.
1) dont force the user to use internet explorer if he defined firefox (or any other) to be the default browser.
2) don't use the L extension unless you're certain that UNICODE is defined. read my other post[^] about that point.
|
|
|
|
|
toxcct wrote: dont force the user to use internet explorer
I already mentioned that - "open the website in internet explorer "
The second reason was only because of C PY PASTE. Sorry for that.
|
|
|
|
|
but why do you not let the system choose the default browser ?
|
|
|
|
|
some people dont want choice it seems...
|
|
|
|
|
Hi,
I have an SDI application. I want to display the current mouse position in the view onto the Main frame status bar.
I have declared the variable m_ptCurrentPositon in the Main frame class which will contain the current mouse coordinates and I am updating it in the OnMouseMove() and OnNcHitTest() of my View class.
All I want is once the mouse moves out of the view window(client area), I should be able to detect that so that I could set the m_ptCurrentPositon value to (0,0), because currently when I mouse out of the view, I am still displaying the non-zero value in my Status bar.
How do I achieve the above mentioned?
|
|
|
|
|
Do the following:
1. Declare bool m_bMouseInside in class and initialize it as false.
2. In OnMouseMove()do the following.
if( !m_bMouseInside )
{
m_bMouseInside = true;
TRACKMOUSEEVENT tme = { 0 };
tme.cbSize = sizeof( tme );
tme.dwFlags = TME_LEAVE;
tme.hwndTrack = m_hWnd;
_TrackMouseEvent( &tme );
}
3. Map WM_MOUSELEAVE as OnMouseLeave or something
It will be called when the mouse leaves the client area.
- NS -
|
|
|
|
|
Hi to all!
If I was to change the appearance of scroll bars in my CListCtrl (from boring windows style to something else witch will match my background color) would it need to be an custom or owner drown control. If custom is enough (I hope because mine is), would it be on a 'OnCustomdrawList' function? Or it can not be done like that but by creation a new scrollbar members and build it in CListCtrl?
Please help!
|
|
|
|
|
Scrollbar customization is very much different than customizing a control, because the scrollbar is a part of the window and it is in the non-client area. So you have to manage it differently.
There are many articles in CP regarding this, having a look at them may help you a lot.
- NS -
|
|
|
|
|
Thanks for replay!
So I need to change it's appearance before and 'pass' them to my CListCtrl?
|
|
|
|
|
No you cant do so. Scrollbar is not a separate control. It is the part of the window. So the OS is drawing scrollbar. Having a look at the CP articles will help you in understanding more regarding this. And there are many solutions too.
- NS -
|
|
|
|
|
how to perform insert / delete in a file with out reading all the content and update whole content back in to the file.
//for eg;
//myfile.txt
[names]
name1
name2
name2
name3
name5
name2
.
.
.
[/names]
is it possible to delete name2 and insert name4 after name3. If i open a file and try to insert a text its allways replaces the existing content.
Thanks & Regards
|
|
|
|
|
No, you can't. You'll need to import the file in memory, modify it there and then save it back to the file afterwards. You could in your case read the file and store it in memory as a list of strings.
|
|
|
|
|
Hi.
I am really lost in using ADO with C++. Can anyone direct me to a site with information for beginners for database access.
Thanks.
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
Did you see Database section on the codeproject?
|
|
|
|
|
i hand't thought of that. Thanks
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
I want to make flexigrid non- editable in VC++.net2003.can anyone suggest me how
|
|
|
|
|
hi, all
I paint a bitmap image on picturebox control using Bitblt() function .
now but i want to do . I want to resizing the image and moving the image
on the picture box control with the help of the mouse. can any one help
me in this topic . any sample code or article . a search a lot on google
not find nay sample and idea how to start it .
Trioum
|
|
|
|
|
For change size of image you can use of StretchBlt (but it decrease quality of image) and with mouse you have two events WM_LBUTTONDOWN and WM_LBUTTONUP you can use of them.
|
|
|
|
|
About the size, use the function in the other answer.
About the movement, you can use those messages (OnMouseDown/Up) to set/reset a bool variable and then change the coordinates of the bitmap while mouse moving. Something like:
BOOL bAllowDragDrop
CPoint m_cpDragOffset;
void CMyView::OnLButtonDown(UINT nFlags, CPoint point)
{
cpDragOffset = cpBitmapCoord - point;
bAllowDragDrop = TRUE;
}
void CMyView::OnLButtonUp(UINT nFlags, CPoint point)
{
if (bAllowDragDrop)
{ cpBitmapCoord = point - cpDragOffset;
bAllowDragDrop = FALSE;
}
Invalidate ();
UpdateWindow ();
}
This would not move the bitmap while mouse moving, just take coordinates by downclicking and saving the new ones by upclicking. If you wanna see the movement, insert the OnMouseMove and do the same as by upclicking.
This is a way. Hope it helps
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
For the resizing, look up CRectTracker
It provides the pieces needed for moving or resizing a rectangular object. You still have to provide some of the plumbing but it gets the job done.
|
|
|
|
|
Hi all,
I have a board (embedded device) that send RAW data over USB to the PC, it also expects to receive some data and commands from USB, anybody knows how to write a program to send data from PC to USB and receive data from USB to PC?? any samples, articles or any kind of help is appreciated..
Thank you very much
Mohammad Gdeisat
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
USB doesn't work the same way as standard serial port (COM port) work. You cannot open the USB and send/receive data on it.
Instead, ýou'll need to open the driver associated with your device (using CreateFile) and then you'll be able to read/write data (using ReadFile/WriteFile) to your device. You'll be also be able to send specific command codes to your driver using DeviceIOControl.
Normally, you should have received documentation with your board (and the driver also). Everything should be explained ther (because for example IO control codes are specific to the driver).
|
|
|
|