|
Unless someone else has something to say, you're out of luck.
Interactions like this with controls are all done through messages, like SetWindowText() is an alias for PostMessage(WM_SETTEXT) , and it appears that GetComboBoxInfo() is an alias for CB_GETCOMBOBOXINFO[^], which as that MSDN page says is only implemented on Windows XP and later.
If this query message is not supported by the control on your platform then you are going to have a hard time getting the internal state.
Not sure if it will work, and if it will it is probably not a good idea, but you might be able to update the common control library from something like Windows XP, which should have all features of NT, plus more by copying and pasting.
|
|
|
|
|
Then perhaps you give me an alternative for this issue :
I need to have ComboBoxInfo.hwndList handle for the follow function :
void CComboBoxExt::PreSubclassWindow()
{
CComboBox::PreSubclassWindow();
COMBOBOXINFO ComboBoxInfo;
ComboBoxInfo.cbSize = sizeof(ComboBoxInfo);
GetComboBoxInfo(m_hWnd,&ComboBoxInfo);
m_List.SubclassWindow(ComboBoxInfo.hwndList);
SetProp(ComboBoxInfo.hwndList, WndPropertyComboBoxEx, this);
fNextListProc = (WNDPROC)SetWindowLong(ComboBoxInfo.hwndList, GWL_WNDPROC, (LONG)WinProcForList);
}
and implementation of WinProcForList is here :
LRESULT CComboBoxExt::WinProcForList(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
CComboBoxExt* pInstance = (CComboBoxExt*)GetProp(hWnd,WndPropertyComboBoxEx);
ASSERT(pInstance != NULL);
if(msg == LB_FINDSTRING)
{
TRACE("Replacing LB_FINDSTRING with LB_FINDSTRINGEXACT when looking for: \"%s\"\n", (LPCTSTR)lParam);
msg = LB_FINDSTRINGEXACT;
}
return CallWindowProc(pInstance->fNextListProc, hWnd, msg, wParam, lParam);
}
any help or hint I will very appreciated !
|
|
|
|
|
In fact , I try to deturn LB_FINDSTRING from dropdown list into LB_FINDSTRINGEXACT , and there must be an solution that function for Windows NT ...
|
|
|
|
|
i have two root object,each object contains many members but i take up only one string member(m_strTitle) as reference to merge two object and it also contains one vector (holds pointer of object ) to hold all children of object ..... any best algorithm other than linear comparison ?
example:
two objects are
m_objSource ( pointer of classObj )
m_objGuest (pointer of classObj )
structure of classObj is
{
CString m_strTitle;
...............
.............
vector <classobj*> m_vectChildFolder;
}
modified on Monday, February 28, 2011 2:13 AM
|
|
|
|
|
Hi guys... I want to show a shadow bitmap as a transparent in my application..
I have used alphablend() to do that.
m_blendfunc.BlendOp = AC_SRC_OVER;
m_blendfunc.BlendFlags = 0;
m_blendfunc.SourceConstantAlpha = 0;
m_blendfunc.AlphaFormat = AC_SRC_ALPHA;
I have changed the alpha transparency value as per intensity vaue. ( its a scrollbar value in my
application from which shadow will intense accordinagaly )
m_blendfunc.SourceConstantAlpha = int( m_intensity * 2.55 );
In OnPaint I have written..
AlphaBlend( hmemdc, prc->left - m_shadowPosX + Border, prc->top + m_shadowPosY + Border,
prc->right - prc->left + borderRatio, prc->bottom - prc->top + borderRatio,
hSrcDc, 0, 0, bmp.bmWidth, bmp.bmHeight, m_blendfunc );
In ReplaceColor() I have supplied shadow bitmp handle.. here _coldcolor and _cNewColor are used to
calculate a new color based on the current color( but I don't want that )..
void CPipWnd::ReplaceColor( HBITMAP &_hBmp, COLORREF _cOldColor, COLORREF _cNewColor,
bool _selectRange )
{
if ( _hBmp )
{
HDC hbufferDC = CreateCompatibleDC( NULL );
if ( hbufferDC )
{
HGDIOBJ hpreviousBufferObject = SelectObject( hbufferDC, _hBmp );
HDC hdirectDC = CreateCompatibleDC( NULL );
if( hdirectDC )
{
BITMAP bm;
GetObject( _hBmp, sizeof( bm ), &bm );
BITMAPINFO RGB32BitsBITMAPINFO;
ZeroMemory( &RGB32BitsBITMAPINFO, sizeof( BITMAPINFO ) );
RGB32BitsBITMAPINFO.bmiHeader.biSize = sizeof( BITMAPINFOHEADER );
RGB32BitsBITMAPINFO.bmiHeader.biWidth = bm.bmWidth;
RGB32BitsBITMAPINFO.bmiHeader.biHeight = bm.bmHeight;
RGB32BitsBITMAPINFO.bmiHeader.biPlanes = 1;
RGB32BitsBITMAPINFO.bmiHeader.biBitCount = 32;
UINT * ptPixels;
HBITMAP hdirectBitmap = CreateDIBSection( hdirectDC, ( BITMAPINFO* )&RGB32BitsBITMAPINFO,
DIB_RGB_COLORS, ( void** )&ptPixels, NULL, 0 );
if ( hdirectBitmap )
{
HGDIOBJ hpreviousObject = SelectObject( hdirectDC, hdirectBitmap );
BitBlt( hdirectDC, 0, 0, bm.bmWidth, bm.bmHeight, hbufferDC, 0, 0, SRCCOPY );
_cOldColor = COLORREF2RGB( _cOldColor );
_cNewColor = COLORREF2RGB( _cNewColor );
for ( int i = ( ( bm.bmWidth * bm.bmHeight ) - 1 ); i >= 0; --i )
{
if( _selectRange )
{
{
COLORREF clrRef = COLORREF( ptPixels[i] );
clrRef = COLORREF2RGB( clrRef );
BYTE r = GetRValue( _cNewColor );
BYTE g = GetGValue( _cNewColor );
BYTE b = GetBValue( _cNewColor );
BYTE *ptr = reinterpret_cast<BYTE*>( &clrRef );
ptr[0] = *ptr;
ptr[1] = r;
ptr[2] = g;
ptr[3] = b;
ptPixels[i] = clrRef;
}
}
else
{
if ( ptPixels[i] <= _cOldColor )
ptPixels[i] = _cNewColor;
}
}
SelectObject( hdirectDC, hpreviousObject );
if( _hBmp )
{
DeleteObject( _hBmp );
_hBmp = NULL;
}
_hBmp = hdirectBitmap;
}
DeleteDC( hdirectDC );
}
SelectObject( hbufferDC, hpreviousBufferObject );
DeleteDC( hbufferDC );
}
}
}
My shadow bitmap (.bmp) is 24 bpp as well.I have to take alpha value of that bitmap pixels and have to
add this value in the alpha channel of the new color..
But In line
COLORREF clrRef = COLORREF( ptPixels[i] );
I am getting 0 value. Is there any mistake in the code..
Pls help me so that I can take correct alpha value of every pixels of bitmap image .
modified on Monday, February 28, 2011 4:34 AM
|
|
|
|
|
Your question is very difficult to read. Please use the edit button and put your code snippets between <pre></pre> tags so it is formatted and readable.
I must get a clever new signature for 2011.
|
|
|
|
|
hello friends, i am pursuing my degree and i am in my final semester.
I need to know how every file is stored on a disk i.e. if a application want to access any file i.e. any video,audio,document file, is there a common way, how every file stored on the disk.
|
|
|
|
|
Sure, we'll be glad to help.
Tell us what you've found so far, and we'll go from there.
|
|
|
|
|
gateway23 wrote: is there a common way, how every file stored on the disk.
Yes, every file is merely a stream of bytes (or bits) and can be accessed in exactly the same way. The difficulty is knowing how to interpret each byte to make sense of the information. However, I doubt if that knowledge is of any use to you; perhaps it would be better if you explained exactly what problem you are trying to solve.
I must get a clever new signature for 2011.
|
|
|
|
|
This is a vague question and I get the impression that if I knew exactly what you're asking:
- I probably wouldn't know the answer.
- An explanation would take more space than available here.
Steve
|
|
|
|
|
Greets,
How can I tell programatically, Is gdi+ already started? Is there a function for this?
Thanks...vmars316
|
|
|
|
|
You could try calling one of the GDI+ functions and checking if it returns GdiplusNotInitialize .
|
|
|
|
|
I have a CButton derived class. I would like this class to handle the click event itself. What should I put in my message map for the button class? ON_BN_CLICKED doesn't work.
|
|
|
|
|
ON_BN_CLICKED just wraps a WM_COMMAND message. You probably want to catch WM_LBUTTONUP messages.
|
|
|
|
|
goorley wrote: I would like this class to handle the click event itself.
use ON_CONTROL_REFLECT() message map.
BEGIN_MESSAGE_MAP(CMyBtn, CButton)
ON_CONTROL_REFLECT(BN_CLICKED, OnClicked)
END_MESSAGE_MAP()
void CMyBtn::OnClicked()
{
}
TN062: Message Reflection for Windows Controls
|
|
|
|
|
Works like a charm!
|
|
|
|
|
Hi . I want to ask you something : how can I catch FindString event on an CComboBox ? I try in some ways but I failed ... I want to give my functionality when I call FindString on that control ... thank you kindly !
|
|
|
|
|
How did you try? What did you do?
|
|
|
|
|
I think you may have to derive your own class from CComboBox [^] and add your functionality the derived class.
I must get a clever new signature for 2011.
|
|
|
|
|
After all , I did it in follow way :
BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult);
and
BOOL CComboBoxExt::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
if(message == CB_FINDSTRING)TRACE("\n bingo \n");
return CComboBox::OnWndMsg(message, wParam, lParam, pResult);
}
|
|
|
|
|
i want to change the width of verticalscrollbar of list box using mfc
|
|
|
|
|
Step 1: Remove style WS_VSCROLL from listbox
Step 2: Create your own listbox object, derived from CListBox, and in the Create() function create your own CScrollBar object, whose width you can then set.
Step 3: Hook up all the scroll messages.
|
|
|
|
|
Hi,
I create one WPF window using in C# code. How to this window use in Vc++ win32 GUI?
actually i want how to integrate WPF window designs in vc++ win32/mfc environment?
How to add WPF files(like C# and xaml) in Vc++ win32/mfc project?
Pls share ur ideas or urls?
Regards,
M.Mathivanan
|
|
|
|
|
|
I have already answered this question here[^]. Try doing some research for yourself on how to expose the COM interfaces from a C# program. You could start by looking at the articles here on CodeProject.
I must get a clever new signature for 2011.
|
|
|
|
|