C++/API

Advertisement


Question
hello i want to make a window transparent except a text on it i used this command but it didnt answer

case WM_PAINT:{
hdc = BeginPaint(hWnd, &ps);
BeginPath(hdc);
TextOut(hdc,100,100,"MYTEXT",6);
EndPath(hdc);
HRGN hrgn=PathToRegion(hdc);
SetWindowRgn(hWnd,hrgn,1); EndPaint(hWnd, &ps); break;}
please help me Thanks

Answer
behnam , Thank you for your question.

Unfortunately, I have not ever tried to make text appear on a transparent window, so I cannot say what the problem is. Your code looks like it might work. You might try drawing on an internal bitmap, then turning the bitmap into a region, instead of using paths.

I suggest that you post this question at www.experts-exchange.com, which is more advanced than allexperts.com.

David Spector

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


David Spector

Expertise

Highly knowledgeable in the C++ language, Visual C++ (MSVC), Windows API, documentation and other quality-assurance techniques, and debugging. Knowledgeable in MFC, COM, GUI design, and object-oriented design.

Experience

I have been a software engineer since 1965. I have been published. My specializations have been: biomedical programming, compiler implementation, and many kinds of Windows programming. I don't do Databases or other business-oriented stuff.

Publications
Windows?/DOS Developer's Journal, ACM SIGPLAN Notices, and Computer Science Press.

Education/Credentials
ICCP Systems Programming Certification
Master's degree equivalent in Computer Science

©2016 About.com. All rights reserved.