|
Hi
How to apply a Hand cursor to a Picture box and its member variable is a CStatic control. Whenever i moved cursor on to that picture box it should display Hand cursor. My application is SDI application in which CView class is derived from CFormView.
I have tried in this way but didn't get plz help me.
m_Image.SetCursor(::LoadCursor(NULL,IDC_HAND));
//here IDC_HAND is not working i have given IDC_HELP.
Where should i use this code in View class to display that cursor.
Help me.
|
|
|
|
|
I think (I'm not sure), you have to activate the notify style of the CStatic (in the properties of the control).
Then, go in the class wizzard and add a handler for the mouse move event of your control (it must have an ID different than IDC_STATIC). This handler function is in the view class.
Then add your code for loading the cursor in this function.
|
|
|
|
|
Hi,
Assume CYourControl is the class implementing your image or whatever you are using, and TheParent is the class corresponding to the host of your control.
Write the following code within the handler responding to the WM_SETCURSOR event:
BOOL TheParent::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
CYourControl *pYC = ......
if ( pYC )
{
if ( pWnd == pYC )
{
SetCursor(LoadCursor(NULL,IDC_YOUR_CURSOR));
return TRUE;
}
}
return TheParentBaseClass::OnSetCursor(pWnd, nHitTest, message);
}
IDC_HAND Windows is defined for NT 5.0 and later.
You can create your own cursor.
Do not forget that line returning TRUE!
SkyWalker
-- modified at 3:38 Friday 21st October, 2005
|
|
|
|
|
nice mircea, and do u think, an else part is needed? i'm not sure. but luking at ut code,
if ( pWnd == pYC )
{
SetCursor(LoadCursor(NULL,IDC_YOUR_CURSOR));
return TRUE;
}
/* else // not needed?
{
SetCursor(LoadCursor(NULL,IDC_ARROW));
return TRUE;
}
*/
if this sets changes the cursor the first time, then if we move on to the next control will this cursor stay in the same IDC_YOUR_CURSOR? dont it need to change to IDC_IDC_ARROW?
plz teach me
He is like a one-legged man in a bum kicking competition. -Novjot Sidhu
--[v]--
|
|
|
|
|
Hi,
I send you by e-mail the same coding example I sent to snprani.
Ok?
SkyWalker
|
|
|
|
|
thank u so much.
He is like a one-legged man in a bum kicking competition. -Novjot Sidhu
--[v]--
|
|
|
|
|
You are welcome
SkyWalker
|
|
|
|
|
How do i change the back colour of an edit box
, it is simple but can remeber .
Thank u
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
off the top of my head I think yuo need to handle ON_CTL_COLOR in the parent window but I may be wrong
|
|
|
|
|
I want to be away from the ON_CTL_COLOR message handling
code , i need some simple way /?
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Sometimes we want to go to the moon but we do not want to use a space shuttle.
The problem is that we have to consider using the space shuttle
SkyWalker
-- modified at 3:43 Friday 21st October, 2005
|
|
|
|
|
Recent New's from china
ABC Online - 2 hours ago
A Chinese man has paid $A133,000 for a 90-minute voyage that will make him China's first tourist in space, the China Daily said.
thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
:-> then u should only go for VB
He is like a one-legged man in a bum kicking competition. -Novjot Sidhu
--[v]--
|
|
|
|
|
well i guess this will do
<br />
CWnd *pWnd=GetDlgItem(IDC_EDIT1);<br />
pwnd->GetDC ()->SetBkColor (RGB(255,0,0))
Best is to use the WM_CTCOLOR of the dialog box since the third parameter you can check wether its for an editbox and do the necessary setting three with the help of the CDC,
Regards
FarPointer
|
|
|
|
|
Subclass the edit control...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Dear Sir can u post a sample code ?
He is like a one-legged man in a bum kicking competition. -Novjot Sidhu
--[v]--
|
|
|
|
|
VivekuniQ wrote: Dear Sir can u post a sample code
Thanks for Pointing me to my Mistake.... I forget to add that you can handle Wm_CTLCOLOR message in the Derived class Itself so no need to handle that in the main Class. If He (i.e. Vikas) don't want to go for WM_CTLCOLOR solution.. AFAIK that not possible.. if possible point me to link too
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote: AFAIK
your 'Far' is too Far For me. it'll take so much time for me to reach u. so anything not known by u is obviouly not known by me sir. , i know U'll find it soon. so plz send the link to me too.
He is like a one-legged man in a bum kicking competition. -Novjot Sidhu
--[v]--
|
|
|
|
|
Hi,
Can anybody tell why wifstream doesnt take TCHAR string asit parameter though its meant for it???
wifstream infile(wszfile); //where wszfile = L"C:\\myfile.txt"
it gives me error
"can not convert parametre 1 from 'std::wstring' to 'const cahr *' "
any solution to avoid this error ???
thanks n regards
Supriya Tonape
|
|
|
|
|
wifstream takes WCHARs as stream inputs. The filename you pass to create the stream has to be passed as a simple string, not wstring.
You can convert your 'wszfile' to a simple string with WideCharToMultibyte() first.
|
|
|
|
|
TCHAR is not a multi-byte character type. it is ONLY IF UNICODE macro is defined !!!
it's defined quite that way :
#if defined(UNICODE)
#define TCHAR wchar_t
#else
#define TCHAR char
#endif
you see now that if UNICODE is not defined, your TCHAR is a simple char .
on the other hand, wifstream always waits for a wchar_t ...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
it seems u have defined it
TCHAR *wszfile;
wszfile=L"C:\\myfile.txt";
rather than define it as
wchar_t *wszfile;
reason has been very well explained by TOXCCT
-- modified at 3:53 Friday 21st October, 2005
|
|
|
|
|
Even if I do,
wchar_t *wszfile = L"c:\\a.txt";
wifstream infile(wszfile);
it gives me same error I had tried it...
any suggestion?
Thanks a lot
Supriya Tonape
|
|
|
|
|
My current project is about a IP phone with a voicemail,I want to play the host's welcome voice and transmate it to the remote terminal,How can I record the playing voice with CwaveIn or other classes?THanks!
-- modified at 0:43 Friday 21st October, 2005
|
|
|
|
|
No one can help me? Or my english is too poor? sigh:
|
|
|
|