Click here to Skip to main content
15,924,039 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Protect executables and prevent end process Pin
22491710-Nov-08 15:14
22491710-Nov-08 15:14 
GeneralRe: Protect executables and prevent end process Pin
jlkdaslkfjd30-Mar-11 15:54
jlkdaslkfjd30-Mar-11 15:54 
AnswerRe: Protect executables and prevent end process Pin
Hamid_RT10-Nov-08 4:04
Hamid_RT10-Nov-08 4:04 
AnswerRe: Protect executables and prevent end process Pin
KarstenK10-Nov-08 4:14
mveKarstenK10-Nov-08 4:14 
AnswerRe: Protect executables and prevent end process Pin
22491710-Nov-08 14:10
22491710-Nov-08 14:10 
QuestionUpdate the background of dialog box.. Pin
gothic_coder10-Nov-08 0:17
gothic_coder10-Nov-08 0:17 
AnswerRe: Update the background of dialog box.. Pin
gothic_coder10-Nov-08 0:18
gothic_coder10-Nov-08 0:18 
GeneralRe: Update the background of dialog box.. Pin
enhzflep10-Nov-08 1:34
enhzflep10-Nov-08 1:34 
Sure, no sweat

First of all, the best approach I can see for this is to use a LayeredWindow approach. This necessitates win2k or higher and just 2 changes to your code.

It also means that 1 of the 2^24 colours available cannot be used, as this is used as the mask colour.

First, goto the line that sets the background for the window class
//		wndClass.hbrBackground = (HBRUSH) GetStockObject (HOLLOW_BRUSH ) ;

and change it to (where RGB(255,0,255) represents an arbitrary colour choice)
wndClass.hbrBackground = (HBRUSH) CreateSolidBrush(RGB(255,0,255));


Next, goto the line that updates the window after it's shown
//    UpdateWindow(hwnd);

and change it to:
/* Set the window to 255/255(100%) opacity and make all pixels coloured 255,0,255 transparent */
    SetLayeredWindowAttributes(hwnd, RGB(255,0,255), 255, LWA_COLORKEY|LWA_ALPHA);


Voila! You should now have a bunch of circles floating on whatever is under them.
Add this code, and you can drag it using the left mouse button.

case WM_LBUTTONDOWN:    /* allow the user to drag the window by left clicking it anywhere */
			SendMessage(hwnd, WM_NCLBUTTONDOWN, HTCAPTION,NULL);
			break;


In the above code, I have used 255,0,255 as the mask colour.
GeneralRe: Update the background of dialog box.. Pin
gothic_coder10-Nov-08 2:13
gothic_coder10-Nov-08 2:13 
GeneralRe: Update the background of dialog box.. Pin
enhzflep10-Nov-08 2:24
enhzflep10-Nov-08 2:24 
GeneralRe: Update the background of dialog box.. Pin
gothic_coder10-Nov-08 4:02
gothic_coder10-Nov-08 4:02 
GeneralRe: Update the background of dialog box.. Pin
enhzflep10-Nov-08 14:18
enhzflep10-Nov-08 14:18 
GeneralRe: Update the background of dialog box.. Pin
gothic_coder10-Nov-08 23:09
gothic_coder10-Nov-08 23:09 
QuestionXML Skinnable Dialogs or Vista or XP style dialogs Pin
Sreekanth Muralidharan9-Nov-08 23:26
Sreekanth Muralidharan9-Nov-08 23:26 
AnswerRe: XML Skinnable Dialogs or Vista or XP style dialogs Pin
Ahmed Charfeddine9-Nov-08 23:49
Ahmed Charfeddine9-Nov-08 23:49 
Questionreading astring value unto a DWORD [SOLVED] Pin
Ahmed Charfeddine9-Nov-08 23:11
Ahmed Charfeddine9-Nov-08 23:11 
AnswerRe: reading astring value unto a DWORD Pin
chandu0049-Nov-08 23:14
chandu0049-Nov-08 23:14 
GeneralRe: reading astring value unto a DWORD Pin
Ahmed Charfeddine9-Nov-08 23:44
Ahmed Charfeddine9-Nov-08 23:44 
Questionhow to store a value at the specified location in RAM. Pin
chandu0049-Nov-08 23:06
chandu0049-Nov-08 23:06 
AnswerRe: how to store a value at the specified location in RAM. Pin
CPallini9-Nov-08 23:24
mveCPallini9-Nov-08 23:24 
GeneralRe: how to store a value at the specified location in RAM. Pin
chandu0049-Nov-08 23:38
chandu0049-Nov-08 23:38 
QuestionRe: how to store a value at the specified location in RAM. Pin
CPallini9-Nov-08 23:56
mveCPallini9-Nov-08 23:56 
AnswerRe: how to store a value at the specified location in RAM. Pin
chandu00410-Nov-08 0:20
chandu00410-Nov-08 0:20 
AnswerRe: how to store a value at the specified location in RAM. Pin
Iain Clarke, Warrior Programmer9-Nov-08 23:52
Iain Clarke, Warrior Programmer9-Nov-08 23:52 
GeneralRe: how to store a value at the specified location in RAM. Pin
chandu00410-Nov-08 2:32
chandu00410-Nov-08 2:32 

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.