|
Go to resource tab,and then click ICon.already there is MFC icon change what ever you want.u can made icon as u like.
|
|
|
|
|
What u answered is how to add an icon in VC++ program.
But what i want is an icon on desktop, clicking on which will execute a file.
For eg When click on notepad icon, notepad.exe will be executed.
In the same way i want my program to get executed when i click on the icon.
Anyhow thanks for ur reply.
|
|
|
|
|
What you want to do is to create a shortcut.
To do this, you need to know how to use COM, and a Windows shell interface IShellLink.
There is almost certainly an article on CP that shows how to do this, if you search on that keyword.
Steve S
Developer for hire
|
|
|
|
|
Do you need to shortcut?
if yes see Here[^]
whitesky
|
|
|
|
|
Hi all,
I have an owner draw list control. i use the DrawItem method to draw the item and sub items.
i seperate the states so whenever item will be disabled i will to draw like this:
if (ODS_DISABLED & lpDrawItemStruct->itemState)
{
// draw somthing
}
problem is i don't know how to bring an item to the state of ODS_DISABLED???
any suggestions?
thanks
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Did u tried making the listctrl disabled
nave
|
|
|
|
|
I think he is trying to disable one of the item among the whole.
- NS -
|
|
|
|
|
yes that is what i want to do...
i read in google news groups that one suggested to put an Item Data that will notify if the item is disabled, and in the OnItemChanging return true to prevent the selection of the item if the item data flag is raised....
isn't there an easier way?
thanks
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
YaronNir wrote: isn't there an easier way?
I don't have another suggestion yet...
Or you can use any of the states like LVIS_CUT, etc. to do the same...
If you get a better method, please let me know too.
- NS -
|
|
|
|
|
NS17 wrote: Or you can use any of the states like LVIS_CUT, etc. to do the same...
what do u mean?
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Oh! It is only a suggestion as I didn't try it yet.
I meant that if you are not using the states, for example LVIS_CUT state, it can be used as a disable item state.
So u can set the state of the item ( that you want to be disabled ) to the CUT state and in DrawItem you can check the state of each item and if it is in CUT state, you can draw it as disabled.
- NS -
|
|
|
|
|
ok now i follow
but this is good only for the drawing, because i will still need to implement onitemchaning and prevent the selecting for that state....so it is just like puting an item data...
thanks
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
YaronNir wrote: is just like puting an item data...
Yes...
But I don't have any other ideas...
- NS -
|
|
|
|
|
hi hi.... r u here?
SaRath
"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"
|
|
|
|
|
SaRath C wrote: hi hi.... r u here?
yeh, what u need?
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Hi,
I am facing problems in sending mouse clicks via SendInput API.
Mouse clicks are being sent but at the X,Y co-ordinates.
I am mapping my monitor to the (0,0,65535,65535) virtual monitor as needed by the SendInput. But the mouse clicks are always reported at the "current cursor location" (I am testing it with the notepad) irrespective of the X,Y co-ordinates specified.
Here is the code.
void SendMouseInput(unsigned int iX,unsigned int iY)
{
MOUSEINPUT mousei={0};
INPUT Input={0};
BlockInput(true);
::ZeroMemory(&Input,sizeof(INPUT));
::ZeroMemory(&mousei,sizeof(MOUSEINPUT));
mousei.dx=VirtualXFromAbsoluteX(iX);
mousei.dy=VirtualYFromAbsoluteY(iY);
mousei.dwFlags=MOUSEEVENTF_ABSOLUTE|MOUSEEVENTF_LEFTDOWN;
Input.type = INPUT_MOUSE;
Input.mi = mousei;
if(::SendInput(1,&Input,sizeof(Input))==0)
ShowError("SendMouseInput");
mousei.dwFlags=MOUSEEVENTF_ABSOLUTE|MOUSEEVENTF_LEFTUP;
Input.type = INPUT_MOUSE;
Input.mi = mousei;
if(::SendInput(1,&Input,sizeof(Input))==0)
ShowError("SendMouseInput");
BlockInput(false);
Sleep(1000);
}
static int VirtualXFromAbsoluteX ( int iX )
{
double Width = GetSystemMetrics ( SM_CXSCREEN ) ;
double Val = ( ((double)iX/Width) * (double)(65535) ) ;
double Ceil = ceil ( Val ) ;
double Floor = floor ( Val ) ;
if ( Ceil > Floor )
{
iX = (int)Ceil ;
}
else
{
iX = (int)Floor ;
}
return ( iX ) ;
}
static int VirtualYFromAbsoluteY ( int iY )
{
double Height = GetSystemMetrics ( SM_CYSCREEN ) ;
double Val = ( ((double)iY/Height) * (double)(65535) ) ;
double Ceil = ceil ( Val ) ;
double Floor = floor ( Val ) ;
if ( Ceil > Floor )
{
iY = (int)Ceil ;
}
else
{
iY = (int)Floor ;
}
return ( iY ) ;
}
void ShowError(LPTSTR lpszFunction)
{
TCHAR szBuf[80];
LPVOID lpMsgBuf;
DWORD dw = GetLastError();
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
dw,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0, NULL );
wsprintf(szBuf,
"%s failed with error %d: %s",
lpszFunction, dw, lpMsgBuf);
::MessageBox(NULL, szBuf, "Error", MB_OK);
LocalFree(lpMsgBuf);
}
Am I doing something wrong?
PS: I am able to send key board events using SendInput.
Thanks a load in advance.
Subra
|
|
|
|
|
Hi Subra,
Try debugging the code by putting a break point over the event.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
I tried all possible debugging.
The data is going to SendInput correctly.
But the click is happening at the point where my mouse pointer is currently pointing. I also set windows hooks to monitor the mouse events before any application gets its hands on it. There also I see that the x,y co-ordinates are coming wrongly.
|
|
|
|
|
Function();
{...
m_nftp.MoveFile("/"+NameSelected,"C:\\"+NameSelected,
FALSE,TRUE);
m_nftp.LogOffServer();
//SetFileName(Filetitle,path+filetitle)
theApp.m_pWinamp->SetFileName(NameSelected,
"C:\\"+NameSelected);
theApp.m_pWinamp->Wload(); //Load WinAmp's playlist
My problem is that Winamp cant load the life altought (after manually i can add it )(file not corrupted)
Is a way to delay so Winamp can load its Playlist ?
|
|
|
|
|
Can u give me few more details of the problem ??
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Can you be more specific
whitesky
|
|
|
|
|
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
pCon=pContext;
m_wndSplitter.CreateStatic(this,2,1);
m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CView1),CSize(100,100),pContext);
m_wndSplitter1.CreateStatic(&m_wndSplitter,1,2,WS_CHILD|WS_VISIBLE,m_wndSplitter.IdFromRowCol(1,0));
m_wndSplitter1.CreateView(0,0,RUNTIME_CLASS(CMyTreeCtrl),CSize(100,100),pContext);
m_wndSplitter1.CreateView(0,1,RUNTIME_CLASS(CView3),CSize(400,400),pContext);
return TRUE;
}
/////////////////////////////////////////////////////
void CMainFrame::SwitchView(CString str)
{
int id=m_wndSplitter1.IdFromRowCol(0,1);
m_wndSplitter1.DeleteView(0,1);
m_wndSplitter2.CreateStatic(&m_wndSplitter1,2,1,WS_CHILD|WS_VISIBLE,id);
m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS(CView2),CSize(100,100),pCon);
m_wndSplitter2.CreateView(1,0,RUNTIME_CLASS(CView2),CSize(400,400),pCon);
}
iam not getting any error wnen the same code in SwitchView(CString str)
fn is written in on OnCreateClient(.....) but it getting error it is written in SwitchView.where switch view is a fn called when a tree item is clicked
*********Heere i want to get a spiltter when an event is arised send me a gud solution.***********
...............sahaja
|
|
|
|
|
In case of the code in OnCreateClient(...) it is working because the splitter window is created there for the first time.
But if you want to change the view in the splitter window at runtime then you have to follow different procedure. Its not just simple delete one view and create another.;P
Regards
Anil
-- modified at 6:39 Tuesday 30th May, 2006
|
|
|
|
|
plz give me a brief idea of the procedure to be followed.
Thanks
..........sahaja
|
|
|
|
|
|