|
May be i'm doing something wrong in CreateWindowEx.. Can you please post your code..
Thanks.
|
|
|
|
|
Hello,
I am working on an mfc application. In it I am using a static control and a checkbox.
I am using a Picture control on top of it i have placed the checkbox and static control.
The problem is that the background of checkbox and static control is not tranparent as a result of which the picture colour and background colours of the controls are not matching..
please help me.
Thanks & regards.
Dhiraj Kumar Saini
|
|
|
|
|
You might want this.
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
HDC hdc = (HDC) wParam;
HWND hwndStatic = (HWND) lParam;
HBRUSH hbrBkcolor = (HBRUSH)GetStockObject(NULL_BRUSH);
if (hwndStatic == GetDlgItem(hWnd, IDC_STATIC_CONTROL))
{
SetBkMode(hdc, TRANSPARENT);
return (LRESULT) hbrBkcolor;
}
break;
}
Same stuff do with your Check Box also..
Hope this help.
|
|
|
|
|
I am using MFC and not win32 .
Please help me with MFC code as i dont know win32.
Thanks
|
|
|
|
|
|
Its not working. Please tell me whats the problem.
|
|
|
|
|
Please tell him what is not working. Unless one of you two has psychic powers, you need to help him to help you.
Iain.
|
|
|
|
|
I also think so...
|
|
|
|
|
Greets.
You could try handling the WM_CTLCOLOR (or WM_CTLCOLORBTN and/or WM_CTLCOLORSTATIC) messages in the parent window and return a NULL brush. Am not sure that would work, haven't tried it but it's worth a shot.
AtomAnt
- If God wanted man to code, man would have been born without the need to sleep.
|
|
|
|
|
Hi all,
please tell me how can i get Hard Drive Modal details,like Modal Number or Serial Number.
please help me for this.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
See here
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
You can use Win32_DiskDrive[^] WMI class. Check Model property.
Sohail
modified on Thursday, November 13, 2008 4:44 AM
modified 21-Apr-21 21:01pm.
|
|
|
|
|
How to get disk's capacitance of remote computer with ip?
|
|
|
|
|
You can use Win32_DiskDrive[^] WMI class.
Sohail
modified on Thursday, November 13, 2008 4:47 AM
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Are you sure capacitance is the word you're looking for? If so, why would you need to know such low-level (i.e., electronics) information?
Perhaps you're looking for GetDiskFreeSpaceEx() instead?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
in my programme,OnDragOver/OnDropEx cannot be executed(can compile), but i dont know why...
the code is:
(thanks!)
--------
A.h
--------
class A: public CStatic
{
... ...
protected:
afx_msg void OnPaint();
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg BOOL OnDrop(WPARAM pDropInfoClass, LPARAM lParm);
afx_msg DROPEFFECT OnDropEx(WPARAM pDropInfoClass, LPARAM lParm);
afx_msg DROPEFFECT OnDragOver(WPARAM pDropInfoClass, LPARAM lParm);
DECLARE_MESSAGE_MAP()
protected:
COleDropTargetEx m_dropEx;
static WORD s_wNvrChnClipboardFormat;
... ...
}
----
A.cpp
----
WORD A::s_wNvrChnClipboardFormat = 0X0;
BEGIN_MESSAGE_MAP(A, CStatic)
ON_WM_PAINT()
ON_WM_ERASEBKGND()
ON_WM_SIZE()
ON_WM_WINDOWPOSCHANGED()
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONDBLCLK()
ON_WM_MOUSEMOVE()
ON_WM_LBUTTONUP()
ON_WM_CREATE()
ON_MESSAGE(DROPM_DRAGOVER,OnDragOver)
ON_MESSAGE(DROPM_DROPEX,OnDropEx)
ON_MESSAGE(DROPM_DROP,OnDrop)
END_MESSAGE_MAP()
int A::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CStatic::OnCreate(lpCreateStruct) == -1)
return -1;
s_wNvrChnClipboardFormat = RegisterClipboardFormat(NAME_NC_NVRCHN_CLPFMT);
BOOL bRet = m_dropEx.Register (this);
ASSERT(bRet);
return 0;
}
DROPEFFECT A::OnDragOver(WPARAM pDropInfoClass,LPARAM lParm)
{
COleDropInfo* pInfo = (COleDropInfo* )pDropInfoClass;
ASSERT(pInfo->IsKindOf(RUNTIME_CLASS(COleDropInfo)));
if( pInfo->m_pDataObject->IsDataAvailable(s_wNvrChnClipboardFormat) )
return DROPEFFECT_COPY;
else
return DROPEFFECT_NONE;
}
DROPEFFECT A::OnDropEx(WPARAM pDropInfoClass, LPARAM lParm)
{
return (DROPEFFECT)-1;
}
modified on Thursday, November 13, 2008 1:54 AM
|
|
|
|
|
ok,i get it!
because i Register in OnCreate...
|
|
|
|
|
i want to create shortcut for my application. while doing set up for appication, that shortcut should get created.
thanks in advance
|
|
|
|
|
|
Hi All
How can i get folder size in vc++?Please help me
|
|
|
|
|
|
Click Here[^]
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
AFAIK, you get the folder size by finding the size of each file within the folder. It may be dependent on the File system in use
You can use WIN32_FIND_DATA to get the file size and then sum all the individual sizes to get the folder size
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
What do you mean by folder size?
Do you mean the disk space taken by the folder itself?
Very small - just a list of files and some extra stuff.
Do you mean the total of the size of the files in the folder?
Then you start having problems with file size. NTFS for example has alternate data streams (see: http://www.heysoft.de/nt/ntfs-ads.htm[^])
Does it include the size of all the directories beneath it?
Do you follow reparse points?
Your question is simple, but there are lots of sub questions you need to ask, which don't have easy answers. And those answers will vary with application.
There's a reason you can't find a "GetDirectorySize" function...
Iain.
|
|
|
|