|
Thanks, it works with KEYDOWN
|
|
|
|
|
Give the button a different ID and a new handler for this ID, than it should work.
To catch up ESCAPE you need to catch the WM_KEYDOWN Event.
But it is important where the PreTranslateMessage.
Try to catch the WM_KEYDOWN event in your Dialog class.
|
|
|
|
|
how to change the background color of the radio button to be same as window color
|
|
|
|
|
See
HBRUSH CDialogDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
pDC->SetTextColor(RGB(20,120,220));
pDC->SetBkColor(RGB(20,120,220));
return hbr;
}
|
|
|
|
|
how to handle this OnCtlColor class and to set the background color
i think will not work for buttons. it chnages only the static label background.
-- modified at 4:36 Saturday 3rd March, 2007
|
|
|
|
|
You must insert WM_CTLCOLOR message to your program and for radio button its working and again a short help
BEGIN_MESSAGE_MAP(CDialogDlg, CDialog)
ON_WM_CTLCOLOR()
END_MESSAGE_MAP()
HBRUSH CDialogDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
pDC->SetBkColor(RGB(20,120,220));
pDC->SetTextColor(RGB(255,255,220));
return hbr;
}
public:
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
|
|
|
|
|
thank you very much its working well.
|
|
|
|
|
You're welcome
|
|
|
|
|
Hi,
I want to switch from 5 window splitter to 3 window, using the same object of CSplitterwnd, is it possible for me to reintialise or recreate the same object of CSplitterwnd, so that i can change the number of rows and columns in the same application.
|
|
|
|
|
Are you trying to do this at runtime?
|
|
|
|
|
Yes, i want to do it Run time when i will click on certain button.
|
|
|
|
|
Hello everybody!
Is there any specific way to run an exe when a system wants to logoff!
Or will the system forcefully closes all active applications before logoff?
|
|
|
|
|
You can get a notification to an already running exe but i am not aware of any method to run an exe.
|
|
|
|
|
Systems send WM_QUERYENDSESSION to each application window when log off process is initiated. You can do any specific task here. Returning FALSE in response to this message causes log off operation to stop.
|
|
|
|
|
Hi all.
How can I get the pointer/handle to the horizontal and vertical scroll bars from list box?
I tried it using…
CListBox *pList = (CListBox *) GetDlgItem(IDC_LIST);
if( NULL == pList->GetSafeHwnd() )
return;
CScrollBar* pVertScroll = pList->GetScrollBarCtrl(SB_VERT ) ;
But it is returning NULL.
Also how I can trap the events like WM_MOUSEMOVE over scroll bar arrows?
Thanks
Sameer Thakur
|
|
|
|
|
Sameer_Thakur wrote: CScrollBar* pVertScroll = pList->GetScrollBarCtrl(SB_VERT ) ;
But it is returning NULL.
Did you see MSDN?
From the MSDN
This member function does not operate on scroll bars created when the WS_HSCROLL or WS_VSCROLL bits are set during the creation of a window
|
|
|
|
|
Hi.
Yes I saw that point mentioned in MSDN..
Thats why I asked for the method to get handle to the Scroll bars of Listbox.
Is there any way to get it?
Thanks
-- modified at 4:47 Saturday 3rd March, 2007
Sameer Thakur
|
|
|
|
|
Can you say what do you need,excatly?
|
|
|
|
|
Sure.
In my application I have added a list box on a dialog box. This list contain so many numbers of string elements that user has to scroll too much to see all the contents.
I want to minimize the scrolling efforts of user and I want to provide auto scrolling to the list box. The elements of the list box should get scroll automatically when user movies the mouse pointer over scroll bar arrows of the list box.
For that I want to …
1. Get the pointer or handle to the Scroll bars of list control.
2. Trap the event when mouse is moved over the scroll bar arrows and kept there for some predefined time say 2 sec.
3. Scroll down or up the list with some specified speed.
How I can proceed to achieve these sub tasks?
Thanks
Sameer Thakur
|
|
|
|
|
I have a suggestion for you disable VERT and HORZ of list and insert two static control for list and when use want to use of scrollbar use of static ontrol,but you can desgin apparent of these static like scrollbar and another my suggestion is better you use of listctrl instead listbox
|
|
|
|
|
Sameer_Thakur wrote: Also how I can trap the events like WM_MOUSEMOVE over scroll bar arrows?
Look for CWnd::OnNcHitTest .
|
|
|
|
|
hi have anyone used the class CxShadeButton (downloaded from code project only) . i am having a radio button in cSampleDlg class. how to call the settextcolor function from CxShadeButton class.
COLORREF CxShadeButton::SetTextColor(COLORREF new_color)
{
COLORREF tmp_color=m_TextColor;
m_TextColor=new_color;
return tmp_color; //returns the previous color
}
i have to call this function and assign the color to radio button. how can i do this
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
I didnt use of CxShadeButton but this function get a new colorref and return a colorref but it dosent have SetTextcolor or SetbkColor how do you want to change color
|
|
|
|
|
Add a member variable to your radio button, which is of type CxShadeButton . For example, may it be m_radio1 . Now call SetTextColor , from InitDialog as follows:
m_radio1.SetTextColor(RGB(100,100,100));
Please make it a point to ask such questions pertaining to an article at the bottom of the article itself.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Hi
Im a beginner in Windows Programming Enviroment
Couldnt understand the reason for following:
1. Why are we suppossed to write WINAPI in WinMain declaration?
2. What is meant by CALLBACK? See u soon!
Spread wat u Know!
|
|
|
|