|
You want to use CTabCtrl::GetItem ; something like:
TCITEM tcitem;
tabctrl->GetItem(0, &tcitem);
Then to get the tab label you use tcitem.pszText .
Documentation here
Hope this helps,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
|
|
|
|
|
Hi,
I my dialog i have many controls. I am disigning this in 1024*768 resolution. Now my problem is in this resolution it doesnt need any scroll bars all the control will fix in the screen exactly. But if i change the resoltion to 800*600 some part of dialog is becoming invisible. So to add scrollbars i have used ScrollDialog given in this http://www.codeguru.com/cpp/w-d/dis...icle.php/c1859/ . In this code by default Maximize and restore buttons are enabled. I have tried so many ways to diable those. but it is not working. Can any one help me?
Thanks in advance.
|
|
|
|
|
does ModifyStyle(WS_MAXIMIZEBOX,0); help??
Regards,
Sandip.
|
|
|
|
|
Thank you it is disabling the maximize button. But how to disable the resize option.
|
|
|
|
|
hari_honey wrote: resize option.
Quote Selected Text
do you mean resize by dragging the window ??
I am not sure but you can try removing following styles using same function
WS_THICKFRAME/WS_SIZEBOX. Let me know if it works.
Regards,
Sandip.
|
|
|
|
|
Yes i f we use WS_SIZEBOX with the same function it will remove resize also.
|
|
|
|
|
Hi there
I need to make an application which saves the output as a XML file. Can you recommend me a good XML lib?
I'm using VC++. I don't know MFC, and I prefer an API based lib. I've find limxml2, but I have problems installing it.
Can you also provide me a good link or resource about how can I use such libraries?
many thanks
|
|
|
|
|
I used tinyXML[^] before. It's a quite easy to use and lightweight library.
|
|
|
|
|
u can use a c# dll into ur vc++ program for reading / writing xml using .net classes like XmlSerializer (System.Xml.Serialization)
only thing u need to compile using /clr option
Pras
enjoy
|
|
|
|
|
|
Hello,
I've created an implementaion of virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) for my CFrameWnd derived class. In this way, I can later vary which view is displayed:
BOOL CChildWnd::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
m_pReportView = new CReportView;
m_pReportView->Create(NULL, NULL, 0L, CFrameWnd::rectDefault, this,
VIEW_REPORT, pContext);
SetActiveView(m_pReportView);
m_pReportView->ShowWindow(SW_SHOW);
m_pReportView->SetDlgCtrlID(AFX_IDW_PANE_FIRST);
return TRUE;
}
This works, and works well. However, when I do this, for whatever reason I lose the Frame's previous style - The toolbar becomes sunken. Commenting out my implementation, the style immediately returns to normal. How can I do all this, while not having the toolbar become sunken?
Thanks,
Sternocera
|
|
|
|
|
My CToolbar derived class is created like this - I'm not sure how relevant that is, but I include it case it is:
int CChildWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | TBSTYLE_TRANSPARENT | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_CHILD_FRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// attach the hicolor bitmaps to the toolbar
AttachToolbarImages (IDB_HICOLORTOOLBAR_CHILD,
IDB_HICOLORTOOLBARDISABLED_CHILD,
IDB_HICOLORTOOLBARHOT_CHILD);
return 0;
}
Thanks,
Sternocera
|
|
|
|
|
Problem solved. Merely had to append this to int CChildWnd::OnCreate(LPCREATESTRUCT lpCreateStruct):
...
CWnd::OnCreate(lpCreateStruct);
DWORD dw = ::GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE);
dw &= ~WS_EX_CLIENTEDGE;
::SetWindowLong(GetSafeHwnd(), GWL_EXSTYLE, dw);
}
|
|
|
|
|
hello frnds
plz help me regarding how to change font of Caption of Window Text.
Also whts the procedure to hide icon on task bar.
thanks
|
|
|
|
|
himuskanhere wrote: Hinding from TASK bar.
To prevent the window button from being placed on the taskbar, create the unowned window with the WS_EX_TOOLWINDOW extended style. As an alternative, you can create a hidden window and make this hidden window the owner of your visible window.
himuskanhere wrote: and font chang of caption TEXT.
See here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
modified on Thursday, August 7, 2008 5:24 AM
|
|
|
|
|
hi ,
I have an application where in i need to change the speed of the file ,
am able to change tat using MCIWNDSETSPEED() where in it is changing the pitch of the file along with the
speed,...but i need to change only the speed like in windows media player...where in speeding up the file just changes the frames per second of the file...
and also could anyone help me changing the speed of an wav file...
thanks in advance,
Hari
|
|
|
|
|
This isn't a direct answer to your question, but I've heard of a product called "Seventh String", which changes the speed of music WITHOUT changing the pitch. There was a discussion about the technology used, which involved forrier transforms.
|
|
|
|
|
can you show me a sample ???
|
|
|
|
|
|
Hi all
I need to clarify a point with the usage of mutex locking .
mutexlock(&mutexobj);
Function1(socket &lnk);
mutexunlock(&mutexobj);
In Function1()
{
mutexlock(&mutexobj);
globalvar1= globalvar2;
mutexunlock(&mutexobj);
}
My questions :
-> Is it right/necessary to mutex lock inside Function1()? I understand a global lock/unlock surrounding the call to Function1() will ensure that the whole code / critical resources are thread safe .
I find such occurance of such locking/unlocking in many areas of the code I am working with . Is it not a problem ? .
redindian
|
|
|
|
|
You can re-enter the same mutex twice from the same thread: as you are owning it, you won't block when you try to lock it from the same thread. This prevents deadlock situation (if it you block, then re-entering it would cause a deadlock).
|
|
|
|
|
Thanks . But what I am curious about is - why should there be a lock/unlock inside Function1() when the whole function call is already locked ?.
redindian
|
|
|
|
|
In that particular case it doesn't make any sense. But sometimes, when you have a function with multiple 'paths' and some of them call Function1(), then you would like to still lock the full function. But I agree, it is a bit messy...
|
|
|
|
|
In the case of Mutex, Multiple Lock will not be a problem, but Mutiple unlock creates some problem. The first mutexunlock ( I guess mutexunlock is internally calling ReleaseMutex() ) will release the mutex and so the rest of the code will not be having any effect of the mutex.
|
|
|
|
|
Naveen wrote: The first mutexunlock ( I guess mutexunlock is internally calling ReleaseMutex()) will release the mutex
No, this is not correct. From MSDN[^]:
After a thread obtains ownership of a mutex, it can specify the same mutex in repeated calls to the wait-functions without blocking its execution. This prevents a thread from deadlocking itself while waiting for a mutex that it already owns. To release its ownership under such circumstances, the thread must call ReleaseMutex once for each time that the mutex satisfied the conditions of a wait function.
|
|
|
|