|
vallamkonda.durgaprasad wrote: Now I am want to give a functionality to a button, which sets the current image in the picture control as My Desktop Background.
Use SystemParametersInfo() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You can use of IActiveDesktop .
|
|
|
|
|
hello to all,
right now i am deleting a file or folder and moving it to RecycleBin throuch VC++ (MFC) coding but i want to delete it permanently without moving it to RecycleBin. I am using SHFILEOPSTRUCT structure for deleting a file and moving it to RecycleBin, plz can anybody help me?
Anay Kulkarni
|
|
|
|
|
use DeleteFile() to delete file
and RemoveDirectory() to delete the folders
Regards,
Pankaj Sachdeva
"There is no future lies in any job"
"but"
"future lies in the person who holds the job"
|
|
|
|
|
Apparently, you are providing full path names to the pFrom field. If you don't provide full path names, the file(s) won't go to the recycle bin.
If you need to provide full path names, you can try this - I haven't tested it:
Insure that the flags field of SHFILEOPSTRUCT does not contain the FOF_ALLOWUNDO bit.
SHFILEOPSTRUCT foStruct;
foStruct.fFlags &= (~FOF_ALLOWUNDO);
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Changing the SHFILEOPSTRUCT is the easiest since you are already using SHFileOperation() . There's also DeleteFile() and remove() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
How are you starting oleview.exe?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: How are you starting oleview.exe?
By typing oleview in visual studio command prompt.
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
|
|
|
|
|
Mushq wrote: By typing oleview in visual studio command prompt.
FindWindow() may work.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You can use the following code.
This may not be the optimized code, but it works.
void CTestTreeDlg::OnBnClickedOk()
{
CWnd *pWnd = this->FindWindow (NULL, "OLE/COM Object Viewer");
CString Title = "&Use Surrogate Process";
CWnd *pChildWnd = SearchWindows (pWnd, Title);
if (pChildWnd != NULL)
{
((CButton *)pChildWnd)->SetCheck (1);
}
}
CWnd* CTestTreeDlg::SearchWindows (CWnd* pWnd, CString Title)
{
CWnd *pReturnWindow = NULL;
while (pWnd != NULL)
{
CString WindowText;
pWnd->GetWindowText (WindowText);
if (WindowText == Title)
return pWnd;
CWnd* pChildWindow = pWnd->GetWindow (GW_CHILD);
if (pChildWindow != NULL)
{
CWnd *pWindow = SearchWindows (pChildWindow, Title);
if (pWindow != NULL)
{
pReturnWindow = pWindow;
}
}
CWnd *pNextWnd = pWnd->GetNextWindow (GW_HWNDNEXT);
while (pNextWnd == pWnd)
{
pNextWnd = pWnd->GetNextWindow (GW_HWNDNEXT);
}
pWnd = pNextWnd;
}
return pReturnWindow;
}
Hope this is what u want.
Enjoy
|
|
|
|
|
I need sugge./ advice for video processing for bleow requirement
Person or object will be selected in the first frame of video sequence
manually by mouse. Now the selected object/persion should be segmented in
rest of the frames by the algorithm/porgram.
any souce code/algorithm/ links / suggestion are greatly appericated
Thanks in advance
->electron
|
|
|
|
|
How to create two dimentional array dynamically?
|
|
|
|
|
creating two dimensional dynamic array of chars
char **array;
array = new char*[50];
for (int i =0; i < 50; i++)
array[i] = new char[10];
// the new size is [10][50]
|
|
|
|
|
Actually, the new size would be [50][10] with your allocation.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
My mistake
|
|
|
|
|
std::vector< std::vector< char > > MyDynamic2DArray;
Waldermort
|
|
|
|
|
No need for an array of arrays...
int (*My500x500Array)[500] = new int[500][500];
for (int ii = 0; ii < 500; ++ii)
{
for (int jj = 0; jj < 500; ++jj)
{
My500x500Array[ii][jj] = jj;
}
}
delete[] My500x500Array;
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Check the thread subject, In what way is this array dynamic ?
|
|
|
|
|
carrivick wrote: In what way is this array dynamic ?
The fact that the new and delete operators are present.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It's created on the heap?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello, i have a toolbar with small icon buttons in. When i delete a button by sending a TB_DELETEBUTTON to it, it dosn't resize automatically. And since the buttons have a fixed size, there is an empty spot in the toobar, where i want it to automatically resize to fit the number of buttons.
How do i do this? Iv tried sending TB_AUTOSIZE to the toolbar, but nothing happens. Must i manually use TB_GETMETRICS and TB_SETMETRICS to calculate the new size of the toolbar?
Thanks
|
|
|
|
|
I am doing printing on two types of printer e.g EPSON StYLUS C82 & HP Deskjet 5700.When printing using HP,i have displayed two Text one after other with some coordinates passed to it.Text are displayed one after other with some GAP.But when i print using EPSON ,Text are displayed one after other with Larger GAP.How this problem could be soved.Example code of this is:
pDC->ExtTextOut(XCoOrdinate,YCoOrdinate+LINEGAP_Y,ETO_OPAQUE ,NULL, "Date",NULL);
XCoOrdinate+=ParamHeadingRectWidthPrint;
pDC->ExtTextOut(XCoOrdinate,YCoOrdinate,ETO_OPAQUE ,NULL, "Time",NULL);
Thanks & regards,
priyank
|
|
|
|
|
You will need to use NON DEVICE DEPENDANT UNITS. I had some problems like that printing with the same mark but different models.
I coded it in that way:
void CMyView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
CMyDoc* pDoc = GetDocument ();
ASSERT_VALID (pDoc);
pDC->SetMapMode (MM_LOMETRIC);
double dLeftOffset=200-(pDC->GetDeviceCaps(PHYSICALOFFSETX)*254.0)/pDC->GetDeviceCaps(LOGPIXELSX);
double dTopOffset=200-(pDC->GetDeviceCaps (PHYSICALOFFSETY)*254.0)/pDC->GetDeviceCaps (LOGPIXELSY);
double dRightMargin=1950-(pDC->GetDeviceCaps (PHYSICALOFFSETX)*254.0)/pDC->GetDeviceCaps(LOGPIXELSX);
double dBottomMargin=2770-(pDC->GetDeviceCaps (PHYSICALOFFSETY)*254.0)/pDC->GetDeviceCaps(LOGPIXELSY);
pInfo->m_rectDraw.left += (int) dLeftOffset;
pInfo->m_rectDraw.top += (int) dTopOffset;
pInfo->m_rectDraw.right = (int) dRightMargin;
pInfo->m_rectDraw.bottom = (int) dBottomMargin;
then to print images... I used the ::StretchDIBits (...) function, and to print text the pDC->TextOut (...) function. But using coordinates like
pInfo->m_rectDraw.left + XXX;
pInfo->m_rectDraw.top - XXX;
and so on.
Hope it helps
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Thank u for u help.I am facing with another problem in same thing.While printing font changes for different printer.I have created font using:
int nHorz = pDC->GetDeviceCaps(LOGPIXELSX);
CFont fnTimes;
int FontPrinterWeldData = (EUROPEANWELDDATAFONT*nHorz)/PIXPERINCH;//..where //PIXPERINCH=150,
//EUROPEANWELDDATAFONT=18
fnTimes.CreateFont(FontPrinterWeldData , 0, 0, 0, FW_NORMAL ,FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, FF_DONTCARE, _T("Courier New"));
I can't understand why font change for printer.
Thanks & regards,
priyank
|
|
|
|