|
Did you read here here[^] and there a lot of other articles on the net. Just google and pick up the one that best suits your needs.
If just you had googled
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
kapardhi wrote: how to do it ?
By reading here.
"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
|
|
|
|
|
hi,
Can anybody tell me how to customize a print dialog ,so that on click of 'ok' button in print dialog we will be able to display another user defined dialog box before the print process starts.i had posted the same in general questions but dint get any response..plz help
Thanks and regards,
RM
modified on Monday, December 1, 2008 3:56 AM
|
|
|
|
|
|
hi,
These articles are used to create a print dialog as an exe...can u tell me how to use this dialog instead of the default print dialog when we press print from menu.
thanks and regards,
rm
|
|
|
|
|
Hi All,
I have one program thats taking the screen shot of desktop and
save in a file.But this program is running on remote machine.I connect this machine with RDP.Problem is When i connected to machine program is working fine and taking screen shots ,but when i disconnected from RDP or minimized it it failed.
I found that,
The Bitblt function of the following sample code is falied with
Error 6.Otherwise its working fine when i m connected to it.
Error 6 means Invalid handle.
Can anybody tell why its failed of any other method of taking screen shot of desktop.?
Thanx in advance..
//////////////////////////////////////////
BOOL CBitmapFile::SaveDesktopAsFile(LPTSTR szFile, int nFileType)
{
CString strFileName, strError = "";
CWnd* pWnd = CWnd::GetDesktopWindow();
CBitmap bitmap;
CWindowDC dc(pWnd);
CDC memDC;
CRect rect;
strFileName = (CString)szFile;
memDC.CreateCompatibleDC(&dc);
pWnd->GetWindowRect(rect);
bitmap.CreateCompatibleBitmap(&dc, rect.Width(),rect.Height() );
CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
memDC.BitBlt(0, 0, rect.Width(),rect.Height(), &dc, 0, 0, SRCCOPY);
// Create logical palette if device support a palette
CPalette pal;
if( dc.GetDeviceCaps(RASTERCAPS) & RC_PALETTE )
{
UINT nSize = sizeof(LOGPALETTE) + (sizeof(PALETTEENTRY) * 256);
LOGPALETTE *pLP = (LOGPALETTE *) new BYTE[nSize];
pLP->palVersion = 0x300;
pLP->palNumEntries =
GetSystemPaletteEntries( dc, 0, 255, pLP->palPalEntry );
// Create the palette
pal.CreatePalette( pLP );
delete[] pLP;
}
// Convert the bitmap to a DIB
HANDLE hDIB = DDBToDIB( bitmap, BI_RGB, &pal );
if( hDIB == NULL )
return FALSE;
// DrawGreyScale( &memDC, hDIB );
memDC.SelectObject(pOldBitmap);
// Write it to file
// Write it to file
if(nFileType == BMP_FILE)
WriteDIB( szFile, hDIB );
else
JpegFromDib(hDIB, 100, strFileName, &strError);
// Free the memory allocated by DDBToDIB for the DIB
GlobalFree( hDIB );
return TRUE;
}
//////////////////////////////////////////
|
|
|
|
|
Well, my guess would be that the desktop you are making screen shots of simply doesn't exist when there's noone looking at it, understand that as in, no remote desktop connection is made. I think when you connect to the RDP server it will create something like a virtual desktop for you and will close and destroy it once you are done using RDP and log out. So my guess is that you get NULL when you call GetDesktopWindow or maybe you get 0 for its width and height, or you just don't get a DC for it. Does this make any sense?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Code-o-mat wrote: So my guess is that you get NULL when you call GetDesktopWindow...
So then wouldn't the subsequent call to GetWindowRect() fail?
"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
|
|
|
|
|
I have checked it with writing a log file.
All pointers and rect are looking normal.
But the function bitblt is failed.
Why i dont know and the GetlastError gives Error 6.
which is invalid handle.
Is there any api to check HDC or CDC object is valid or not.
bcoz it looks normal handle and pointer.
Anyway thanx for reply.
|
|
|
|
|
Hi All
I have image on buttons.And i am trying to set TabStop focus on button.I have set TabStop properties TRUE of buttons.But it's working when i am useing tab.Some one help me how can use?
|
|
|
|
|
|
problem is that "tab focus not showing on button".
|
|
|
|
|
If you cant see it you must be show it yourself.
|
|
|
|
|
|
cpvc++ wrote: ut it's working when i am useing tab
Hmm. so shouldn't it work if the tabstop property is set to true
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
i set it "tabstop property true ".
|
|
|
|
|
|
but you yourself say that the tabstop property is set to true and then it is working. or do you mean to say that it is "NOT WORKING"
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Its between working and not working.
|
|
|
|
|
|
It's just that you are not seeing the grid as you put a bitmap on top of it. I recommend you to draw this your self.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
how can i get monitor resolution (currently set) using vc++ code coz i hv to give maximum size of my Parent dialog as default size.
|
|
|
|
|
Use the GetSystemMetrics function with SM_CXSCREEN for the pixel width, and SM_CYSCREEN for the pixel height of the monitor.
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|
|
|