|
I am trying for a transpaerent radio button with colored text,
i tried so many options by overwriting WM_CTRL_CLR or WM_ERASE_BKGND etcc.. its working for static and buttons but radio buttons not working... can any throw a light on this.. how we can do it
|
|
|
|
|
From comctrl6,if theme enabled you cannot change the text color of the raido button usign the WM_CTLCOLOR color. AFAIK, one thing we can do is, disable theme only for radio button. After this your code in the CTL color will work.
eg:
SetWindowTheme( GetDlgItem( IDC_RAIOD_BTN_ID)->m_hWnd, L"", L"" );
where IDC_RAIOD_BTN_ID is the id of the radio button
|
|
|
|
|
Hope this may help
1.Create a CBrush member variable in Dialog class
CBrush m_brush;
2.In OnInitDialog, Create the brush with background color of the dialog
m_brush.CreateSolidBrush(RGB(200,100,0));
3.Handle the WM_CTLCOLOR message of the dialog and change the OnCtlColor function
HBRUSH CTestRadioDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
if(pWnd->GetDlgCtrlID()==IDC_RADIO1)
{
pDC->SetBkColor(RGB(200,100,0));
pDC->SetTextColor(RGB(0,100,200));
return m_brush;
}
return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
}
|
|
|
|
|
Have you tried
CDC::SetBkMode(TRANSPARENT) .
Regards,
Paresh.
|
|
|
|
|
What is the background of your dialog or window? A Image, or just filled with a color?
|
|
|
|
|
you can also use the radio button without text and paint the text yourself or in another static. Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi all,
i working on SMS sending application,
i able to send sms in Text mode by AT command,but some mobile not supported the Text mode format to sending sms,
so i want to send sms in PDU format.
please tell me how can i send sms in PDU mode by AT commands,
if possible please provide me any sample or example.
please tell me also how can create PDU code.
thanks in advance.
|
|
|
|
|
Hi
I am having listcontrol with different many columns in report view.
I need to setup a different color for a single columns depending upon the status such as started,finished etc.,
Kindly help me..
Regards
Ganesh.P
|
|
|
|
|
|
|
How can i add drag drop target line when drag an item from one tree and drop it in to the another tree?
|
|
|
|
|
You want CTreeCtrl::SetInsertMark or TVM_SETINSERTMARK.
To find out which item you should display the mark at, look at: CTreeCtrl::HitTest / TVM_HITTEST message, and the TVHITTESTINFO Structure.
For an application that does these things brilliantly, have a look at Dan.G.'s todo list article here on codeproject. If you look at one of the earlier versions so it's smaller, that may help you.
Good luck,
Iain.I have now moved to Sweden for love (awwww).
|
|
|
|
|
Forgive me if this has already been answered recently. I have a solution that I am ready to distribute. I want to package it with a licensing/registration utility to disperes as shareware. Your typical use for period then force registration. It doesnt need to be real hardcore protection as my application is not that big of a deal. But does need to be simple to implement. And appear to the user to be a decent product. I have been searching for some time and most of these are big bucks! I dont mind paying for this product, but not what most are charging. Also, I want to know that the program works well. I dont want people not being able to register my product. Any help in this matter is greatly appreciated. What programs would you recommend? What are you using?
Thank you very much for your time.
|
|
|
|
|
bump......nobody?
|
|
|
|
|
I have a program that maintains a log file. The file is created at the start of the program and appended to as needed. In normal operation this works fine, but I added the program to my "Run at windows startup" list, and while the program runs fine, the log file doesn't exist where I placed it. According to fstream::is_open, the file opened correctly and I have no error messages anytime I use the stream, but the file is just not there.
I know the simple solution is to keep the data in memory until it needs to be written to file (sometime far after windows startup), but I was more interested in why it won't create the file and why I don't get any errors. Is there anyway to account for this other than rewriting the where and when the file is opened?
|
|
|
|
|
Are you sure you're not getting errors? Are you checking? I'd suggest making the file stream throw exceptions on errors (it makes them harder to ignore):
fs.exceptions(ios::eofbit | ios::failbit | ios::badbit); Steve
|
|
|
|
|
I'm not too familiar with exceptions, I was checking return codes for any error messages. After a quick google though:
file.exceptions ( fstream::eofbit | fstream::failbit | fstream::badbit );
try
{
file.open("test.txt", ios::out);
file << "Test";
file.close();
}
catch (fstream::failure e)
{
MessageBox(NULL, "File Failed", "Error!", MB_OK);
}
I still don't receive an error though, and no file when windows starts up, but it does create it if I open it manually
|
|
|
|
|
Zacory wrote: file.open("test.txt", ios::out);
Give the absolute path while opening or creating the file. Use GetModuleFileName() function to create absolute path.
CString strPath;
char *pChPath=strPath.GetBuffer(_MAX_PATH);
GetModuleFileName(NULL,pChPath,_MAX_PATH);
strPath.ReleaseBuffer(_MAX_PATH);
int nPos=strPath.ReverseFind('\\');
strPath = strPath.Mid(0,nPos+1);
strPath+="test.txt";
pChPath = strPath.GetBuffer(_MAX_PATH);
MessageBox(pChPath);
strPath.ReleaseBuffer(_MAX_PATH);
This issue you are facing only in Start up because, the current working directory of the exe is not the actual path where the exe is located.
modified on Monday, March 22, 2010 5:32 AM
|
|
|
|
|
Thank you soo much, I never would have thought of that. Moving to absolute paths solved this little problem.
|
|
|
|
|
|
|
what kind of question it is?
|
|
|
|
|
because i need to distribution memory to write something,
if memory is not enough, tip to user
|
|
|
|
|
Try this[^]. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
im making a program that has a button on the dialog. When pressed, it pops up another dialog.It is a math calculator program. This specific button calculates square root. I need to have the thing go in a child window(modal dialog) because i have other formula buttons to add...
So i go in the class wizard, create a dialog of the CDIALOG BASE ....then i try to add a message handel.....
then on my main dialog, i add the code
CDialog aboutDlg(IDD_ABOUTBOX);
// Create and show the dialog box
INT_PTR nRet = -1;
nRet = aboutDlg.DoModal();
// Handle the return value from DoModal
switch ( nRet )
{
case -1:
AfxMessageBox("Dialog box could not be created!");
break;
case IDABORT:
// Do something
break;
case ID_SOMETHING:
MessageBox("hello", "bonjour(s)", MB_OK);
break;
case IDCANCEL:
// Do something
break;
default:
// Do something
break;
};
i know DOMODAL IS RESTRICTED in a few perimters but someone told me to create a class and make message handles...than override domodal with my code...nothing happens....message box does not appear
....i just lost though..nothing is working at all..please give me detials or a tutorial on how to create a class derived from CDIALOG than add message handles.
|
|
|
|