|
I think API refers just to "interface" to a system for example Operating System. So it will only include funtions exposed by a system. In case of windows we call it Win32 API. SDK on the other hand is a collection of tools, samples codes, documentation, wrappers, etc which helps to use API.
To program a system you don't have to use SDK, you can directly use the API to get the job done but SDK's make programming easy by hiding lot of detail not important in most cases.
-Saurabh
|
|
|
|
|
API - An acronym for Application Program Interface, the set of commands that an application uses to request and carry out lower-level services performed by a computer's operating system.
SDK - A set of library, header, and Help files that you use to write applications for a specific platform.
Regards,
Paresh.
|
|
|
|
|
Hi,
I have a Progressdialog on the center of which I have placed a CStatic control to display the Progress percentage.But when the dialog is resized the CStatic Control gets disapeared and so the percentage.
Can anybody help me out of it.
Thanks and Regards,
Purusottam Mishra
Purusottam Mishra
Systems Executive
|
|
|
|
|
|
Where/how did you create the static control?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
Actually the ProgressDialog is a subclassed from CProgressCtrl and the CStatic is placed on the top of it. Now When the progressbar proceeds it displays the progress percentage on the CStatic Control. During this process if the user resizes the window bu maximizing or restoring it, the CStatic gets disapeared.
I am unable to show the code for its bulkiness.
If you can help me otherwise, I would be really be very very thankful.
I had also made one sample application but the issue is not getting reproduced over there.
Thanks and REgards,
Purusottam Mishra
Purusottam Mishra
Systems Executive
|
|
|
|
|
Raj-Ekoham DwitiyoNasti wrote: Actually the ProgressDialog is a subclassed from CProgressCtrl and the CStatic is placed on the top of it.
At design time or run time?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Well, Run Time.
I have achieved Transparency of the CStatic now.
This is what my sample application has done
HBRUSH CStaticTestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if(nCtlColor == CTLCOLOR_STATIC)
{
hbr = (HBRUSH)::GetStockObject(NULL_BRUSH);
pDC->SetBkMode(TRANSPARENT);
}
// TODO: Return a different brush if the default is not desired
return hbr;
}
And my ButtonClick handler is :
void CStaticTestDlg::OnBnClickedButton1()
{
TCHAR szBuff[200];
int i=0;
m_Progress.SetRange(0,100);
m_Progress.SetPos(0);
m_Progress.SetStep(1);
for(m_nNum=0;m_nNum<100;m_nNum++)
{
Sleep(1000);
m_Progress.StepIt();
_stprintf(szBuff, _T("%d"),m_nNum);
m_Static.SetWindowText( szBuff);
}
// TODO: Add your control notification handler code here
}
But Now the problem is that when the szBuff gets overwritten.
Can you please help me achieve removing overwriting.
If I use a WHITE_BRUSH in the OnCtlColor() then everything is fine only the CStatic remains no more transparent.
Plz Help!!
Thanks and Regards,
Purusottam Mishra
Systems Executive
|
|
|
|
|
Raj-Ekoham DwitiyoNasti wrote: Can you please help me achieve removing overwriting.
OnCtlColor() is not being used for anything. Comment it out and note the result.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
Thanks for the reply.
But, that's not the case. Please note my requirement first.
My Requirement is:
1. To make the CStatic Transparent with respect to the CProgressCtrl. The Scenerio is that CStatic is placed on the CProgressCtrl.
2. The Progress % should be displayed on the CStatic without overwriting the previous no. I.e. '1' should not get overwritten on '0' and so on.
OnCtlColor() makes the CStatic Transparent. So your statement is not valid here. The only problem is that only if I use any other brush than the HOLLOW_BRUSH/NULL_BRUSH...it works fine but Transparency is getting lost.
However I want to achieve both.
Thanks
Purusottam Mishra
Systems Executive
|
|
|
|
|
Are you wanting something like this? If so, don't use two controls; one will suffice.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks a lot. That was what I exactly wanted.
Thank You very much.
Regards,
Purusottam Mishra
Purusottam Mishra
Systems Executive
|
|
|
|
|
I am working at an Internet Explorer plug-in. (afp viewer plug-in)
I want to use the shortcut keys CTRL-R and CTRL-H to do some actions (reset view,...).
The problem is these keys are shortcuts for IE.
Is there a way to get the keyboard messages before they go to IE?
Or should I use other shorcuts?
|
|
|
|
|
Why do you want to mess up with those predefined shortcut keys? Using some key combinations of your own will be a wise idea. But that's just my opinion.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
My project manager wants to use these keys.
I suggested using other keys...
danginkgo
|
|
|
|
|
danginkgo wrote: My project manager wants to use these keys.
It is your duty to explain him that the user will be annoyed if your application overrides predefined shortcut keys. Secondly, explain him the complexities involved in doing it. It is not impossible, but it is not worth doing.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thanks. I'll try
danginkgo
|
|
|
|
|
Hi all,
1. How to show dialog such a way that it's Bottom-Right corner will at same position of Bottom-Right corner of Screen?
Also to show dialog at Top-Left corner of Screen?
2. How to hide application/dialog at the start of application?
Normally by calling this->ShowWindow(SW_HIDE); application get hidden.
But when I called this->ShowWindow(SW_HIDE); in OnInitDialog() function of dialog, application is still visible. What is the solution?
Regards,
Aniket A. Salunkhe
|
|
|
|
|
Do you want to set position of your dialog you can use of WM_SIZE with MoveWindow or SetWindowPos and also on this event you can use of ShowWIndow(SW_HIDE).
|
|
|
|
|
Hi,
Thanks for the reply.
Hamid. wrote: you can use of WM_SIZE with MoveWindow or SetWindowPos
But how to get co-ordinates for MoveWindow function call, so that Bottom-Right corners of dialog will match with Bottom-Right corner of Screen.
Also to show dialog at the Top-Left corner of Screen, I made a function call as this->MoveWindow(0,0,Width,Height); but dialog was appearing at the center of Screen.
Thanks & Regards,
Aniket A. Salunkhe
modified on Tuesday, June 17, 2008 3:12 AM
|
|
|
|
|
Use of GetClientRect() and then ScreenToClient().How do you use of and where do you use of this function?
|
|
|
|
|
Aniket Salunkhe wrote: But how to get co-ordinates for MoveWindow function call,
int nHeight = GetSystemMetrics(SM_CYSCREEN);
int nWidth = GetSystemMetrics(SM_CXSCREEN);
And in case if you want to support multiple monitors use SM_CXVIRTUALSCREEN, SM_CYVIRTUALSCREEN constants.
|
|
|
|
|
Hi,
Actually, I want to show dialog as Anti-Virus Alert shows messages alongwith task-bar.
That position of dialog will depends on the size & position of Task-Bar.
Do you know how to show a dialog box as an Anti-Virus Alert Message.
Thanks & Regards,
Aniket A. Salunkhe
|
|
|
|
|
An antivirus has a dialogbox for show messages or it can uses of a tooltip for show its messages.
|
|
|
|
|
I want the dialog box to appear as Skype Sign In/Call/Chat Popup Message, same as GTalk chat Popup Message.
Actually I can't explain it to you properly in text.
|
|
|
|