 |
 | buttons basculo | 12:28 29 Apr '09 |
|
 |
how to place buttons ? when i place a new button on dilog it does not appears
|
|
|
|
 |
 | Question on the way you exit application andyluu | 9:30 19 Jan '09 |
|
 |
this is a very nice way to implement transparency! Thanks for the code.
I just have a question about the way you auto close the application. You used PostQuitMessage(0). AFAIK, PostQuitMessage will post WM_Quit and terminate application.However, I read somewhere that using PostQuitMessage only may leave memory leak.
Someone recommend using PostMessage(WM_Close) on main window. It will call DestroyWindow(). The DestroyWindow will destroy all windows and then call PostQuitMessage.
Do you think PostQuitMessage(0) is the better way to auto close a window? TIA.
|
|
|
|
 |
|
 |
hi,
i was unaware of that issue. It needs to be tested i suppose to prove the leak. but the way you suggest is fine I suppose.
nicw
|
|
|
|
 |
 | it's great. Mohamad Kaifi | 1:19 8 May '08 |
|
 |
its wonderful sir...i m new to development.and i m very much interested in MFC.can u give me any links or articles...i'll be thankful to u sir....
|
|
|
|
 |
|
 |
There are many good books on MFC the eaisest to follow would be the "Osborne" "The Complete Reference" series they have some books on Visual C++ which have some good MFC examples. I use the MSDN library articles quite a lot, just looking at each MFC class and them implementing the ones I want or need.
nicw MSN nicwilson@hotmail.com
|
|
|
|
 |
 | Good, It's what I'm looking for ... min_2_max | 23:11 15 Aug '07 |
|
 |
Thanks.
I'm looking for a splash implementation that is similar to that of Photoshop. The main function I need is to change the text on the splash is changeable at runtime.
After a while, I realized that a correct way to this is an implementation based on a dialog. It's what I need.
One question here:
I'm using it in a Doc/View program instead of a dialog program, so I don't want the program to exit, as the demo program, on the timer message, but just close the transparent dialog, I change the code in CTransparentDialogDlg::OnTimer(UINT nIDEvent) from
KillTimer(1); PostQuitMessage(0); CDialog::OnTimer(nIDEvent);
to KillTimer(1); OnClose(); CDialog::OnTimer(nIDEvent);
but the splash just don't close as anticipated. Why?
Thanks again.
max
|
|
|
|
 |
|
 |
Ok, I solved this by replacing
OnClose();
with
PostMessage(WM_CLOSE);
Max
|
|
|
|
 |
|
 |
As a step further, how can I keep showing the splash and, meanwhile, do the data initializing and updating a progress bar on the splash dialog?
Thanks for any hints from anybody.
Max
|
|
|
|
 |
 | Getting an Error simhadri | 23:29 13 Mar '06 |
|
 |
Hi, while I am running the application I am getting a message box "Error loading Bitmap".
what shd I do to solve this..???
|
|
|
|
 |
 | Re: Getting an Error Code Incomplete... | 18:41 11 Apr '06 |
|
 |
The app looks in the same directory (folder) that the .exe file is started in. The author put the image.bmp file in the Release dir, so if you set run the project in release mode, it will find it. If you want to run in debug mode, copy image.bmp into the Debug dir.
|
|
|
|
 |
 | hi,greate, but can it is used with ws_child window? wwx | 18:03 13 Sep '05 |
|
 |
I tried to use it with ws_child, but it didn't work, is it possible? can u give me a simple sample code? thanks,
give a hand,have a heart
|
|
|
|
 |
 | capture hiden window jags_vc | 20:36 16 Feb '05 |
|
 |
I have a problem like this.i have hooked WM_CREATE message and whenewer application window is created i just takes it HWND and passes user Defined message to another application that application handles userdefined message(This application is also my application).In that message handlers i have kept delay of 100 ms and capture the image and then hide it. That is work but when i hide window in WM_CREATE hook procedure then pass Userdefined message to my application then it can`t be captured insted it capures only active window`s GUI of Size of my hiden application window.
I think that to capture any window it is requred to be visible. but is it possible that by copying memory content of Windows Gui we can also capture the image of window ?
|
|
|
|
 |
 | problem with the position of the window Marco Randazzo | 4:31 14 Sep '04 |
|
 |
I tried to move my transparent window modifying iX e iY values in the demo, but the window is always centered, why?
//iX = (GetSystemMetrics(SM_CXSCREEN)) / 2 - (m_Bitmap.bmWidth / 2); //iY = (GetSystemMetrics(SM_CYSCREEN)) / 2 - (m_Bitmap.bmHeight / 2); iX=800; iY=400; SetWindowPos(&wndTopMost,iX, iY, m_Bitmap.bmWidth, m_Bitmap.bmHeight, NULL);
PS: i was able to move the window using: SetWindowPos(&wndTopMost,iX,iY,m_Bitmap.bmWidth,m_Bitmap.bmHeight, SWP_SHOWWINDOW) ; but, in this way, i lose my bitmap, and i have only a gray mask of the window
|
|
|
|
 |
 | Try this... el_rata | 9:57 15 Jan '04 |
|
 |
Not transparent, but i like it...
void CMyDialogClass::OnPaint() { CPaintDC dc(this); // device context for painting
PaintDesktop(dc); // Desktop wallpaper background }
|
|
|
|
 |
 | Wonderful ! LeeZi | 15:35 1 Sep '03 |
|
|
 |
 | Great!! But is it possible?? AWebDude | 15:24 12 Mar '03 |
|
 |
I'm learning VC++ so, I might sound lil stupid but is it possible to have a bmp file with single color and then make it transparent so the dialog box not at all appears on the screen and you see the desktop through dialog?
|
|
|
|
 |
 | Image.bmp is not provided with the zip Shanhaz | 0:51 12 Mar '03 |
|
 |
Can you add the image.bmp to the zip?
|
|
|
|
 |
|
 |
It is provided look again. After unzipping you will find it in the "Release" directory.
Nic
|
|
|
|
 |
 | Nice! manos_crete | 6:55 28 Dec '02 |
|
 |
It's a nice way to easily generate resource files for transparent dialog applications! Here is some code to perform serialization:
void Serialize(CArchive& ar, CRgn* pRgn) { if( ar.IsStoring() ) { // store window region int nCount = pRgn->GetRegionData(NULL, 1); if( nCount>0 ) { LPBYTE pbuffer = new BYTE[nCount]; memset(pbuffer, 0, nCount); int nRet = pRgn->GetRegionData((LPRGNDATA)pbuffer, nCount); ar << nCount; ar.Write(pbuffer, nCount); delete[] pbuffer; } } else { // load and create window region int nCount = 0; ar >> nCount; LPBYTE pbuffer = new BYTE[nCount]; memset(pbuffer, 0, nCount); ar.Read(pbuffer, nCount); if( pRgn->m_hObject ) pRgn->DeleteObject(); pRgn->CreateFromData(NULL, nCount, (LPRGNDATA)pbuffer); delete[] pbuffer; } }
--- Manolis from Crete ---
|
|
|
|
 |
|
 |
can you please post the complete code? How can i serialize this RGN to a file?
|
|
|
|
 |
|
 |
Add the following functions in the header file of the dialog:
void SaveData(CRgn* pRgn); BOOL LoadData(CRgn* pRgn); void Serialize(CArchive& ar, CRgn* pRgn);
The implementation is:
void CTransparentDialogDlg::Serialize(CArchive& ar, CRgn* pRgn) { if( ar.IsStoring() ) {
int nCount = pRgn->GetRegionData(NULL, 1); if( nCount>0 ) { LPBYTE pbuffer = new BYTE[nCount]; memset(pbuffer, 0, nCount); int nRet = pRgn->GetRegionData((LPRGNDATA)pbuffer, nCount); switch( nRet ) { case COMPLEXREGION: TRACE("New region has overlapping borders.\n"); break;
case ERROR: TRACE("No new region created.\n"); break;
case NULLREGION: TRACE("New region is empty.\n"); break;
case SIMPLEREGION: TRACE("New region has no overlapping borders.\n"); break; } ar << nCount; ar.Write(pbuffer, nCount); delete[] pbuffer; } } else
{ int nCount = 0; ar >> nCount; LPBYTE pbuffer = new BYTE[nCount]; memset(pbuffer, 0, nCount); ar.Read(pbuffer, nCount); if( pRgn->m_hObject ) pRgn->DeleteObject(); pRgn->CreateFromData(NULL, nCount, (LPRGNDATA)pbuffer); delete[] pbuffer; } }
void CTransparentDialogDlg::SaveData(CRgn* pRgn) { CFile ff; CFileException e; if( ff.Open("MyRgn.set", CFile::modeCreate | CFile::modeWrite | CFile::shareExclusive, &e) ) { CArchive ar(&ff, CArchive::store, 4096, NULL); try
{ Serialize( ar, pRgn ); } catch(CFileException* e) { e->ReportError(); e->Delete(); }
ar.Close(); ff.Close(); } }
BOOL CTransparentDialogDlg::LoadData(CRgn* pRgn) { CFile ff; CFileException e; if( ff.Open("MyRgn.set", CFile::modeRead, &e) ) { CArchive ar(&ff, CArchive::load, 4096, NULL);
try
{ Serialize( ar, pRgn ); } catch(CFileException* e) { e->ReportError(); e->Delete(); }
ar.Close(); ff.Close();
return TRUE; }
return FALSE; }
Call LoadData inside the OnInitDialog and SaveData before you close the dialog.
good luck.
Manolis from Crete
|
|
|
|
 |
 | Thanks, but... zarzor | 18:31 4 Dec '02 |
|
 |
can you do it without MFC (say, Win32 API). Anyways well done.
RJS
|
|
|
|
 |