|
Hi!
How could i replace for example the first byte (call it b0) of a UInt32 variable?
thx
|
|
|
|
|
zuschauer1980 wrote:
How could i replace for example the first byte (call it b0) of a UInt32 variable?
newVal = (oldVal & 0xffffff00) | (newByteVal & 0xff);
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
By "first" do you mean least significant or most significant? Check out the bit-related operators such as AND (&), OR (|), NOT (~), and XOR (^).
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
Hi,
I am developing a marker application. Basically allows free-hand drawing with the mouse. When i draw a line, i want the window below also to visible. I am not able to create a transparent Pen for this? i tried BS_HOLLOW, but it doesn't draw at all.
hdc = CreateDC(TEXT("DISPLAY"),NULL,NULL,NULL);
lb.lbColor = rgbCurrent;
lb.lbHatch = NULL;
lb.lbStyle = BS_SOLID;
//hNewPen = CreatePen(PS_SOLID,10,rgbCurrent);
//SetROP2(hdc,R2_MERGEPEN);
hNewPen = ExtCreatePen(PS_GEOMETRIC,10,&lb,0,NULL);
//SelectObject(hdc,CreateBrushIndirect(&lb));
//SetDCBrushColor(hdc,rgbCurrent);
SelectObject(hdc,hNewPen);
MoveToEx(hdc, PrevX, PrevY, NULL);
LineTo(hdc, CurrX, CurrY);
DeleteDC(hdc);
........
Can anyone help?
Hercules
|
|
|
|
|
Hi, I don't remember it very well, but you may search SelectStockObject (NULL_PEN); //NULL_BRUSH
C U later
|
|
|
|
|
Thanks for replying...
But this code is all in Platform SDK, how do i create a NULL_PEN there. I create a BS_HOLLOW(same as BS_NULL) but it doesn't draw the line at all.
Your help will be appreciated!
Hercules
|
|
|
|
|
Can anyone tell me how to show line numbers in the editor in visual studio 6. I've looked and cant find out how.
Regards
Paul
|
|
|
|
|
I didn't think you could do this before VS2003.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Isn't it displayed in the status bar?
Don't try it, just do it!
|
|
|
|
|
I need to download a web page but I prefer not to use CHttpView because I do not need to display anything.
The problem is that in order to get to the page I want I need to login using a form. Using CHttpView I traced the form and found that the information passed is like :
URL: https://url.com/page.asp
PostData: ui=user&pass=pass&other=other
Headers: Content-Type: application/x-www-form-urlencoded
But still, browsing directly to https://url.com/page.asp?ui=user&pass=pass&other=other didn't work.
Is there a way to do this ?
I also would like to keep the session/connection to download other web pages from the same site (using the same cookie or whatever)
|
|
|
|
|
|
I can change the background colors of child controls of a dialog by responding to the WM_CTLCOLORxxx messages
Example:
case WM_CTLCOLORBTN:
hBrushButton = CreateSolidBrush(RGB(255,102,15));
return (int)hBrushButton;
Now I'm looking for a way to change the textcolor as well. This for buttons, labels, listboxes, ...
Thanks in advance,
Ward
http://users.belgacom.net/wardvantichelen
|
|
|
|
|
Check these api's
[SetTextColor],[SetBkColor]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
That helped me.
Thanks!
My code is now the following:
case WM_CTLCOLORSTATIC:
hBrushButton = CreateSolidBrush(RGB(255,102,15));
SetTextColor((HDC) wParam, RGB(255,255,255));
SetBkColor((HDC) wParam, RGB(255,102,15));
return (int)hBrushButton;
This results is a nice orange label with white text.
Greetz,
Ward
See more from me at http://users.belgacom.net/wardvantichelen
|
|
|
|
|
Ward wrote:
This results is a nice orange label with white text.
Are you trying to make a copy of code project ?
|
|
|
|
|
Hihihi!
I've never thought that I was using the same colors.
Nice reply though!
Ward
http://users.belgacom.net/wardvantichelen
|
|
|
|
|
Ward wrote:
Thanks!
Mention Not!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hi!
I use Soap 3.0. But I don't install SoapToolkit SDK. I want do a program install (SoapInstall.msi) for use Soap.
Pls Help me!
Thanks!
|
|
|
|
|
Hi comunity,
i need litle help to use this function to draw a arrow on listcontrolheader, where should i implemented this funcion OnPaint() ??? I coment out this lines in :
// change the item to owner drawn.
/*HD_ITEM hditem;
hditem.mask = HDI_FORMAT;
VERIFY( GetItem( iSortColumn, &hditem ) );
hditem.fmt |= HDF_OWNERDRAW;
VERIFY( SetItem( iSortColumn, &hditem ) );*/
and i change the SortHeaderCtrl.h with the function OnPaint(),
//{{AFX_MSG(CSortHeaderCtrl)
// NOTE - the ClassWizard will add and remove member functions here.
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
and i change the SortHeaderCtrl.cpp with the function OnPaint(),
where should i call this OnPaint(), witch place in my SortHeaderCtrl.cpp to show an arrow on a Listheader?? I hope you can understand me
With best regards
Mirsad
|
|
|
|
|
Depending on how finicky you are, you can do it using NM_CUSTOMDRAW.
Here's something what I did:
<br />
void CSortHeaderCtrl::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult)<br />
{<br />
LPNMCUSTOMDRAW pNMCustomDraw = reinterpret_cast<LPNMCUSTOMDRAW>(pNMHDR);<br />
<br />
*pResult = CDRF_DODEFAULT;<br />
<br />
if (pNMCustomDraw->dwDrawStage == CDDS_PREPAINT)<br />
*pResult = CDRF_NOTIFYITEMDRAW;<br />
else if (pNMCustomDraw->dwDrawStage == CDDS_ITEMPREPAINT)<br />
*pResult |= CDRF_NOTIFYPOSTPAINT;<br />
else if (pNMCustomDraw->dwDrawStage == CDDS_ITEMPOSTPAINT)<br />
{<br />
CDC* pDC = CDC::FromHandle(pNMCustomDraw->hdc);<br />
ASSERT_VALID(pDC);<br />
if (!pDC)<br />
return;<br />
<br />
<br />
int nColumn = static_cast<int>(pNMCustomDraw->dwItemSpec);<br />
<br />
if (nColumn == m_nSortColumn)<br />
}<br />
}<br />
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Hi Jack,
thank you for help, hmm, i'm scare that is litle to hi for my level(beginner) but i try it!
regards
mirsad
|
|
|
|
|
hi,
where can i find this : OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult)
mirsad
|
|
|
|
|
I am looking for a simple way to add a title row/bar to the CListBox similar to Windows Task manager. Must be resizable and scrool horizontally.
Thanks for your help. Vaclav
Vaclav
|
|
|
|
|