|
Try using this member function of the dialog
<br />
ModifyStyle(WS_CAPTION,0);<br />
::SetWindowPos(m_hWnd,HWND_TOP,0,0,cx,cy,SWP_SHOWWINDOW);<br />
to get it back:
<br />
ModifyStyle(0,WS_CAPTION);<br />
::SetWindowPos(m_hWnd,HWND_TOP,0,0,cx,cy,SWP_SHOWWINDOW);<br />
good luck my friend
k_dehairy
|
|
|
|
|
Thanks for your help, k_dehariy!
Meanwhile, how can I set the caption of the title bar dynamically?
|
|
|
|
|
|
I would like to embed a simple streaming audio player similiar to LaunchCast Radio in an application. Where should I start? There are so many different types of methods that I am unsure of the cost/benefits of the different interfaces.
Can someone give me a breakdown of what I would do to start playing a stream from a site?
Languages would be C++/MFC for initial implementation, then later on a new client in C#.
.............................
There's nothing like the sound of incoming rifle and mortar rounds to cure the blues. No matter how down you are, you take an active and immediate interest in life.
Fiat justitia, et ruat cælum
|
|
|
|
|
You should definitely check out Bass[^]. (The site is currently temporarily unreachable, but keep trying).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I have an application that uses anonymous pipes to communicate with the child process which is altogether a separate application. I was using anonymous pipes in this context but the problem is with the blocking read which leads to the GUI hang. I want to use the same anonymous pipe with Non-blocking read. In unix i was able to do this with select system call but in windows this API seems to be socket specific. Please help.
|
|
|
|
|
How do I create a DSN programmatically?
thanx
|
|
|
|
|
Use SQLConfigDataSource() .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
How do i make a combo box non-editable
|
|
|
|
|
Go into the properties of your combobox -> 'style' Tab and select 'DropList' in the 'Type' combo.
|
|
|
|
|
Hi all.
Got a little Problem...
I have 4 Views (CFormView) with a TreeCtrl in it..
now i moved the tree into a Splitterwindow (created by CChildFrame).
Wehn User selects a DataView from the Menu I call OpenDocumentFile() whitch
call's afer ObCreateClient() where I switch between the View's...
Question :
How I get Access from CLeftView to the CChildFrame to change the View (wndSplitter->CreateView() or call funtions whitch Show Data within the CFormView ??
Thx. for Help !!!
|
|
|
|
|
Got it by myself after spending hours...
Hier the code I used to get rid of it.... hope it helps someone...
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
{
// Unterteiltes Fenster erstellen
if (!m_wndSplitter.CreateStatic(this, 1, 2))
return FALSE;
// create a new left pane !!
if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(200, 200), pContext))
{
AfxMessageBox("Failed to create Client Frame Window!");
m_wndSplitter.DestroyWindow();
return FALSE;
}
CString m_Classname = pContext->m_pNewViewClass->m_lpszClassName;
// AfxMessageBox(m_Classname);
// selct the view
if (m_Classname == "CFrmAdressen")
{
// AfxMessageBox("Class ist CFrmAdressen");
if (!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CFrmAdressen), CSize(200, 200), pContext))
{
m_wndSplitter.DestroyWindow();
return FALSE;
}
return TRUE;
}
if (m_Classname == "CFrmArtikel")
{
if (!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CFrmArtikel), CSize(200, 200), pContext))
{
m_wndSplitter.DestroyWindow();
return FALSE;
}
return TRUE;
}
if (m_Classname == "CFrmAuftrag")
{
if (!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CFrmAuftrag), CSize(200, 200), pContext))
{
m_wndSplitter.DestroyWindow();
return FALSE;
}
return TRUE;
}
if (m_Classname == "CFrmInfoBox")
{
if (!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CFrmInfoBox), CSize(200, 200), pContext))
{
m_wndSplitter.DestroyWindow();
return FALSE;
}
return TRUE;
}
}
Leftview Treehandling :
void CLeftView::OnTvnSelchanged(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMTREEVIEW pNMTreeView = reinterpret_cast<lpnmtreeview>(pNMHDR);
CChildFrame *m_Child = ((CChildFrame*)GetParentFrame()->GetActiveFrame());
CWnd *p_Wnd = m_Child->m_wndSplitter.GetPane(0,1);
if (m_Child->GetRuntimeClass() == RUNTIME_CLASS(CFrmInfoBox))
{
CFrmInfoBox* m_Info = DYNAMIC_DOWNCAST(CFrmInfoBox, p_Wnd);
m_Info->OnTvnSelchangedTree1(pNMHDR, pResult);
}
}
*pResult = 0;
}
So I can Display and change view as before... but without using Tree in the FormView...
After I just a add a function to update the tree as I need...
C'ya
|
|
|
|
|
i have made a program using VC++ 7.0 MFC
and i included in my package all the MFC Dlls
and this program is running under windows XP
but when i try to open it from windows 98
a message error occurs telling me that
"C++ library runtime error"
does any one know how to solve this problem
|
|
|
|
|
Problem is that you have created DLL that Support MFC70.dll and Win98 support till MFC42.dll.
this only cauing teh Problem,only solution is to compile the library on 98 platefrom
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi everyone
i'm working on a DLL with 2 Callback Functions but i really have no clue why it isn't working:
//MainClass.h (It's the DLL)
typedef void (__stdcall *LP_CREATEHANDLER_FUNC)(HANDLE, CString);
typedef void (__stdcall *LP_TERMINATEHANDLER_FUNC)(HANDLE);
class CMainClass
{
public:
__declspec(dllexport) void SetCreateHandler(LP_CREATEHANDLER_FUNC p_Handler);
__declspec(dllexport) void SetTerminateHandler(LP_TERMINATEHANDLER_FUNC p_Handler);
};
//ClientDlg.cpp TheMainApp
BOOL CClientDlg::OnInitDialog()
{
CDialog::OnInitDialog();
...
m_cls.SetCreateHandler(CreateHandler);
m_cls.SetTerminateHandler(TerminateHandler);
}
void __stdcall CClientDlg::CreateHandler(HANDLE hPID, CString strFilename)
{
}
void __stdcall CClientDlg::TerminateHandler(HANDLE hPID)
{
}
I get the following error:
error C2664: 'CMainClass::SetCreateHandler' : cannot convert parameter 1 from 'void (HANDLE,CString)' to 'LP_CREATEHANDLER_FUNC'
error C2664: 'CMainClass::SetTerminateHandler' : cannot convert parameter 1 from 'void (HANDLE)' to 'LP_TERMINATEHANDLER_FUNC'
what am i doing wrong ?
MFG
RedDragon2kx
Unix and C are the ultimate computer viruses.
|
|
|
|
|
you can't reference a non-static class member function via a function pointer.
Software | Cleek
|
|
|
|
|
Chris Losinger wrote:
you can't reference a non-static class member function via a function pointer.
unless you use something like FastDelegate: http://www.codeproject.com/cpp/FastDelegate.asp[^] Boost also has libraries which can do this, but FastDelegate is simpler and works incredibly well.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
HellO!!
I don't really know what happened or i might have edited accidentally the afxwin.h or another file. When I compile my Project even when I start a new MDI MFC skeleton application... i get this message:
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxwin.h(3970) : error C2501: 'CScrollView::CRectTracker' : missing storage-class or type specifiers
Is there anyway i can solve this before i can do reinstallation of VS .NET?
|
|
|
|
|
HellO!!
I don't really know what happened or i might have edited accidentally the afxwin.h or another file. When I compile my Project even when I start a new MDI MFC skeleton application... i get this message:
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxwin.h(3970) : error C2501: 'CScrollView::CRectTracker' : missing storage-class or type specifiers
Is there anyway i can solve this before i can do reinstallation of VS .NET?
|
|
|
|
|
I'd like to have my tabbed dialog application using XP themes like "My Computer-> properties" in the win XP - the dialog inside the TAB control should use gradient background.
My problem is that static controls and check box buttons are not drawn properly -> background of the text is erased by default dialog background color (text background has OPAQUE mode). I've tried to handle the WM_CTLCOLOR message in the dialog, but this solved only the problem with text static controls, not with the group rectangle static box (it's text was drawn over the rectangle line when I've set text background mode to TRANSPARENT).
I hope there is some easier way than to code my own owner drawn controls, when windows GUI is using this.
Any suggestions ?
Thanks !
rrrado
|
|
|
|
|
Looks strange because when an XP theme is active, all text labels are drawn transparently; in fact, no WM_CTLCOLOR handling is necessary. Does your app have a manifest resource in it that enables theming (the XP look) when a theme is active?
The gradient that you see in "My Computer-> properties" is NOT a feature of a themed Tab control, it's how the theme handles property sheets - it applies a gradient background to each of the dialog in the sheet. If you create your own tabbed dialog, you can do it by handling WM_ERASEBKGND in each of your dialogs.
Consider the following code excerpt; perhaps you will get some ideas on your group boxes (BTW, they belong to window class BUTTON, not STATIC):
BOOL myGroupBox::OnEraseBkgnd(CDC* pDC)
{
CRect rcCtrl;
GetClientRect(rcCtrl);
if (GetUXThemeState().IsThemeActive())
pDC->FillSolidRect(rcCtrl, ColorAdjustLuma(afxData.clrBtnFace, 750, TRUE));
else
pDC->FillSolidRect(rcCtrl, afxData.clrBtnFace);
PrintClient(pDC, PRF_CLIENT);
return 1;
}
void myGroupBox::OnPaint()
{
PAINTSTRUCT ps = {0};
::BeginPaint(m_hWnd, &ps);
::EndPaint(m_hWnd, &ps);
}
One always gets the deserved.
http://www.silveragesoftware.com/hffr.html Update your source code with my tool HandyFile Find And Replace!
|
|
|
|
|
Thank you very much for your response. I'll try your code. I don't use property sheets besause of it's limitations. I have tab control which has child dialogs. I'm handling the child dialog's onEraseBackgroud where I do nothing, so oridinal tab control's background remains.
I have manifest file in my resources, so all buttons, group boxes, etc. looks like in Win XP theme.
So I don't know why my static controls are not drawn transparently by default
I'm also calling InitCommonControls(); in the app's InitInstance() as recommended ...
rrrado
|
|
|
|
|
Could you make a small screenshot of the text label portion of a group box and give a link? this can make the native Windows drawing procedure more clear.
Oh... I think all you have to do is give your group boxes sensible ID's (other than -1 /IDC_STATIC /), check them in the WM_CTLCOLOR handler, call pdc->SetBkColor() for these ID's and return a brush of a proper color. Do not set the background mode to TRANSPARENT .
One always gets the deserved.
http://www.silveragesoftware.com/hffr.html Update your source code with my tool HandyFile Find And Replace!
|
|
|
|
|
I create some functions in vcpp. i want to use these function in vb.
for ex. i wrote a DrawArrow function which takes 2
parameters(point1,point2); ... i want to use this in VB. So i want to
create an Activex control for this, can i use MFC Activex controls.
And similary i create one dialog based form in vc++. and i want to
create entire application into an Activex control can i to that.
i wrote all the methods to resize that dialog and different event.
but i have to create a ocx control to use in VB 6.0.
so plz help me
thanks in Advance.
Surya prakash.
|
|
|
|
|