Click here to Skip to main content
15,914,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionConversion from BSTR to key in STL map Pin
itkid14-Nov-05 10:14
itkid14-Nov-05 10:14 
AnswerRe: Conversion from BSTR to key in STL map Pin
Garth J Lancaster14-Nov-05 10:24
professionalGarth J Lancaster14-Nov-05 10:24 
GeneralRe: Conversion from BSTR to key in STL map Pin
itkid14-Nov-05 11:17
itkid14-Nov-05 11:17 
GeneralRe: Conversion from BSTR to key in STL map Pin
Garth J Lancaster14-Nov-05 11:19
professionalGarth J Lancaster14-Nov-05 11:19 
GeneralRe: Conversion from BSTR to key in STL map Pin
itkid14-Nov-05 11:32
itkid14-Nov-05 11:32 
GeneralRe: Conversion from BSTR to key in STL map Pin
Garth J Lancaster14-Nov-05 11:41
professionalGarth J Lancaster14-Nov-05 11:41 
AnswerRe: Conversion from BSTR to key in STL map Pin
Christian Graus14-Nov-05 12:37
protectorChristian Graus14-Nov-05 12:37 
QuestionShow color gradient in fullscreen - Win32 Pin
Emmanuel Arun Vinod14-Nov-05 9:27
Emmanuel Arun Vinod14-Nov-05 9:27 
I am trying to show a gradient on the screen... the program shows the gradient and then erases it - I can't understand why. I have included the entire program - ran it under win 98, Visual C++ 6 - Can anyone help me?

#include <windows.h>

HINSTANCE hInst;
MSG msg;

LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
{
HWND MainWnd;
WNDCLASS wc;
int mx,my;
hInst=hInstance;

wc.style=0;
wc.lpfnWndProc=(WNDPROC) MainWndProc;
wc.cbClsExtra=0;
wc.cbWndExtra=0;
wc.hInstance=hInstance;
wc.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wc.hCursor=LoadCursor(NULL,IDC_ARROW);
wc.hbrBackground=(HBRUSH) GetStockObject(BLACK_BRUSH);
wc.lpszMenuName=0;
wc.lpszClassName="Black";
if(!RegisterClass(&wc)) return 1;
mx=GetSystemMetrics(SM_CXSCREEN);
my=GetSystemMetrics(SM_CYSCREEN);
MainWnd=CreateWindowEx(0,"Black","Black Screen",WS_POPUP,
0,0,mx,my,0,0,hInstance,0);
if(!MainWnd) return 1;
ShowWindow(MainWnd,SW_RESTORE);

while(GetMessage(&msg,0,0,0))
{
DispatchMessage(&msg);
}
return msg.wParam;
}

LRESULT CALLBACK MainWndProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
{
HDC h1;
HPEN hp1;
HPEN hpa[64];
int i,mx,my,in;
switch (umsg){
case WM_NCPAINT:
mx=GetSystemMetrics(SM_CXSCREEN);
my=GetSystemMetrics(SM_CYSCREEN);
mx--;my--;
h1=GetWindowDC(hwnd);
hp1=CreatePen( PS_SOLID, 1, RGB(0,0,0));
SelectObject(h1, hp1);
for(i=0;i<=my;i++)
{
MoveToEx(h1,0,i,NULL);
LineTo(h1,mx,i);
LineTo(h1,mx-1,i);
}
ReleaseDC( hwnd, h1);
return TRUE;

case WM_PAINT:
mx=GetSystemMetrics(SM_CXSCREEN);
my=GetSystemMetrics(SM_CYSCREEN);
mx--;my--;
h1=GetWindowDC(hwnd);
for(i=0;i<=63;i++)
hpa[i]=CreatePen( PS_SOLID, 1, RGB(0,i*4,0));
for(i=0;i<=my;i++)
{
in=i*63/(my+1);
SelectObject(h1, hpa[in]);
MoveToEx(h1,0,i,NULL);
LineTo(h1,mx,i);
LineTo(h1,mx-1,i);
}
ReleaseDC( hwnd, h1);
return TRUE;

case WM_DESTROY:
PostQuitMessage(0);
return TRUE;

default:
return (DefWindowProc(hwnd,umsg,wParam,lParam));
}
}

D. Emmanuel
AnswerRe: Show color gradient in fullscreen - Win32 Pin
Emmanuel Arun Vinod14-Nov-05 19:57
Emmanuel Arun Vinod14-Nov-05 19:57 
QuestionCreateFile question Pin
Manu_8114-Nov-05 8:38
Manu_8114-Nov-05 8:38 
AnswerRe: CreateFile question Pin
Blake Miller14-Nov-05 9:23
Blake Miller14-Nov-05 9:23 
GeneralRe: CreateFile question Pin
Manu_8114-Nov-05 11:03
Manu_8114-Nov-05 11:03 
GeneralRe: CreateFile question Pin
Blake Miller14-Nov-05 11:20
Blake Miller14-Nov-05 11:20 
QuestionHow to add scroll bar in the child windows in MDI with Visual c++ 6.0 Pin
HMM_VC14-Nov-05 6:56
HMM_VC14-Nov-05 6:56 
QuestionError while building Pin
celllllllll14-Nov-05 5:39
celllllllll14-Nov-05 5:39 
AnswerRe: Error while building Pin
Blake Miller14-Nov-05 9:25
Blake Miller14-Nov-05 9:25 
QuestionVS.Net How to include a user defined variable in a setup project Pin
gkamendje14-Nov-05 5:33
gkamendje14-Nov-05 5:33 
AnswerRe: VS.Net How to include a user defined variable in a setup project Pin
Curtis Schlak.14-Nov-05 8:50
Curtis Schlak.14-Nov-05 8:50 
GeneralRe: VS.Net How to include a user defined variable in a setup project Pin
gkamendje15-Nov-05 5:52
gkamendje15-Nov-05 5:52 
Questionwindows explorer customization? Pin
YaronNir14-Nov-05 4:53
YaronNir14-Nov-05 4:53 
AnswerRe: windows explorer customization? Pin
David Crow14-Nov-05 8:25
David Crow14-Nov-05 8:25 
GeneralRe: windows explorer customization? Pin
Owner drawn14-Nov-05 20:30
Owner drawn14-Nov-05 20:30 
GeneralRe: windows explorer customization? Pin
YaronNir14-Nov-05 21:05
YaronNir14-Nov-05 21:05 
QuestionHow to retrive selection made in pop-up FONT DIALOG to Rich-Edit control Pin
RevathiRajaGopal14-Nov-05 4:29
RevathiRajaGopal14-Nov-05 4:29 
AnswerRe: How to retrive selection made in pop-up FONT DIALOG to Rich-Edit control Pin
Nish Nishant14-Nov-05 5:32
sitebuilderNish Nishant14-Nov-05 5: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.