|
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
|
|
|
|
|
|
You can't with CListBox . You'll need to use CListCtrl instead.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi everybody,
I am busy writing an setup program for my application. I am using some shell functions like SHGetSpecialFolderLocation to get Program files location. The problem is that this function requires a specific version of a shell dll to be present on the system. What do I do if I install the app on a older system like NT or 98 and the version of the system dll is old ? Is there a set of redistributable shell objects that will ensure the application work on all environments or is there another solution to this problem ?
Help appreciated.
Regards
Ramsus
Carpe Deum
|
|
|
|
|
Ramsus wrote:
I am using some shell functions like SHGetSpecialFolderLocation...What do I do if I install the app on a older system like NT or 98 and the version of the system dll is old ?
That function is available on Windows NT4 and later, and Windows 95 and later. Perhaps you were thinking of SHGetFolderLocation() , which did not come out until Windows 2000, and Windows Me.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello,
I have a very strange error in my multithreaded application. The situation is as follows:
[thread 1]
I have one dialog window open, this dialog spawns 2 threads (thread 2, thread 3] when it is initialized.
[thread 2]
This thread spawns two other threads (thread 4, thread 5). After spawning those threads, it retrieves data from a buffer
The two other threads are identical and retrieve data from 2 diffenrent COMM ports and put the data in the buffer.
When data is successfully retrieved, it notifies thead 3.
Before shutting down, it notifies the monitor thread (3) and shuts down thread 4 and 5. It waits until the threads are cleaned up.
[thread 3]
Its sole purpose is to monitor thread 2 and notify the dialog when data is arrived.
This thread cleans up itself after it recieved the notification that thread 2 is stopped.
[thread 3, thread 4]
These two threads retrieve data from two different COMM ports. The retrieved data is stored in a std::vector managed by thread 2.
You may think that I have too much thread for this purpose (2 would be enough for this type of work), but this is by design. The extra monitor thread is used because this is a test application. In the real application the monitor threads do some real work.
Now for the problem. Everything works like a charm, except when I try to stop thread 2. It actually manages to stop thread 3 and 4. After that, the thread is cleaned up (the thread 2 and 3 are gone in PView thread 2 not). But then, BANG the program crashes in the middle of the following function: AfxUnlockTempMaps at the following line: pThreadState->m_pSafetyPoolBuffer = malloc(pApp->m_nSafetyPoolSize);
The error message in the output window of VS2005 is:
Unhandled exception at 0x02845922 (dbghelp.dll) in TestInput.exe: 0xC0000005: Access violation reading location 0x0152070c.
The location is always the same and no pointer is even near that address...
I noticed that the problem does not occur when thread 3 and 4 stop sending data to the buffer of thread 2. Here are some code snippets:
The call where the data is added to the buffer of thread 2
m_pConsumer->AddDataToInternalBuffer(Data);
The AddDataToInternalBuffer function
void AddDataToInternalBuffer(SERIAL_DATA& SerialData)
{
INTERNAL_LOCK();
m_InternalBuf.push_front(SerialData);
}
Does anybody have a clue what might be happening?
Blog[^]
|
|
|
|