Click here to Skip to main content
15,896,502 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MultiDocument And MultView (and per document) :: MFC Pin
Roger Allen9-Apr-02 5:31
Roger Allen9-Apr-02 5:31 
GeneralRe: Like this? Pin
valikac9-Apr-02 16:01
valikac9-Apr-02 16:01 
GeneralRe: SDI or MDI Pin
valikac9-Apr-02 18:35
valikac9-Apr-02 18:35 
GeneralDocument View - Printing Pin
AJ1239-Apr-02 4:58
AJ1239-Apr-02 4:58 
GeneralRe: Document View - Printing Pin
Roger Allen9-Apr-02 5:28
Roger Allen9-Apr-02 5:28 
GeneralPure Virtual Functions Pin
PaulJ9-Apr-02 4:38
PaulJ9-Apr-02 4:38 
GeneralRe: Pure Virtual Functions Pin
Roger Allen9-Apr-02 4:42
Roger Allen9-Apr-02 4:42 
QuestionHow to make my window transparent while dragged (code inside) Pin
John O'Byrne9-Apr-02 4:30
John O'Byrne9-Apr-02 4:30 
Hi, I've got some code to make a window transparent

void CMainWindow::FadeWindow(int percentage)
{
OSVERSIONINFO osvi;
GetVersionEx(&osvi);
if (osvi.dwMajorVersion>=5)
{
lpfnSetLayeredWindowAttributes SetLayeredWindowAttributes;
HMODULE hUser32 = GetModuleHandle(_T("USER32.DLL"));
if (!hUser32)
return;
pSetLayeredWindowAttributes = (lpfnSetLayeredWindowAttributes)GetProcAddress(hUser32, "SetLayeredWindowAttributes");

SetWindowLong(m_hWnd, GWL_EXSTYLE, GetWindowLong(m_hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);

pSetLayeredWindowAttributes(*this, 0, (percentage*255)/100, LWA_ALPHA);
}
}

void CMainWindow::DisableFade()
{
OSVERSIONINFO osvi;
GetVersionEx(&osvi);
if (osvi.dwMajorVersion>=5)
{
SetWindowLong(m_hWnd, GWL_EXSTYLE, GetWindowLong(m_hWnd,GWL_EXSTYLE) & ~WS_EX_LAYERED);
}
}

My problem is that I want the window to be transparent only while dragged (when the user clicks on the window caption); I tried overriding WM_NCLBUTTONDOWN and WM_NCLBUTTONUP, but I never receive the WM_NCLBUTTONUP, so my window stays transparent,in order to get the WM_NCLBUTTONUP, I added a SetCapture(), but then I can't drag the window any more.

Does anyone have an idea?

Thanks,
John

AnswerRe: How to make my window transparent while dragged (code inside) Pin
Roger Allen9-Apr-02 4:46
Roger Allen9-Apr-02 4:46 
GeneralRe: How to make my window transparent while dragged (code inside) Pin
John O'Byrne9-Apr-02 4:55
John O'Byrne9-Apr-02 4:55 
GeneralRe: How to make my window transparent while dragged (code inside) Pin
Roger Allen9-Apr-02 5:20
Roger Allen9-Apr-02 5:20 
GeneralRe: How to make my window transparent while dragged (code inside) Pin
John O'Byrne9-Apr-02 5:37
John O'Byrne9-Apr-02 5:37 
General*LPUNKOWN Pin
Braulio Dez9-Apr-02 4:05
Braulio Dez9-Apr-02 4:05 
GeneralRe: *LPUNKOWN Pin
Tim Smith9-Apr-02 4:25
Tim Smith9-Apr-02 4:25 
GeneralRe: *LPUNKOWN Pin
Braulio Dez9-Apr-02 4:45
Braulio Dez9-Apr-02 4:45 
GeneralRe: *LPUNKOWN Pin
Niklas L9-Apr-02 4:35
Niklas L9-Apr-02 4:35 
GeneralRe: *LPUNKOWN Pin
Braulio Dez9-Apr-02 4:50
Braulio Dez9-Apr-02 4:50 
GeneralC++ question Pin
Rajveer9-Apr-02 3:46
Rajveer9-Apr-02 3:46 
GeneralRe: C++ question Pin
Paul M Watt9-Apr-02 3:56
mentorPaul M Watt9-Apr-02 3:56 
GeneralRe: C++ question Pin
Rajveer9-Apr-02 4:37
Rajveer9-Apr-02 4:37 
GeneralRe: C++ question Pin
Paul M Watt9-Apr-02 5:25
mentorPaul M Watt9-Apr-02 5:25 
GeneralRe: C++ question Pin
woods139-Apr-02 4:28
woods139-Apr-02 4:28 
GeneralRe: C++ question Pin
PJ Arends9-Apr-02 5:16
professionalPJ Arends9-Apr-02 5:16 
QuestionHow can I retrieve a system small icon? Pin
AmarB9-Apr-02 3:36
AmarB9-Apr-02 3:36 
AnswerRe: How can I retrieve a system small icon? Pin
Alexandru Savescu9-Apr-02 3:54
Alexandru Savescu9-Apr-02 3:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.