This keeps freezing, what am I doing wrong?
Code:COLORREF cr; CHOOSECOLOR cc; cr = RGB(0,0,0); memset(&cc, 0, sizeof(cc)); cc.hwndOwner = hwnd; cc.lStructSize = sizeof(cc); cc.Flags = CC_ANYCOLOR|CC_FULLOPEN; cc.rgbResult = cr; ChooseColor(&cc);
This keeps freezing, what am I doing wrong?
Code:COLORREF cr; CHOOSECOLOR cc; cr = RGB(0,0,0); memset(&cc, 0, sizeof(cc)); cc.hwndOwner = hwnd; cc.lStructSize = sizeof(cc); cc.Flags = CC_ANYCOLOR|CC_FULLOPEN; cc.rgbResult = cr; ChooseColor(&cc);
You need to provide a valid pointer for the lpCustColors of the CHOOSECOLOR struct:
Code:COLORREF cr; COLORREF custom[16]; CHOOSECOLOR cc; memset(&cc, 0, sizeof(cc)); cc.lpCustColors=custom; cr = RGB(0,0,0); cc.hwndOwner = hwnd; cc.lStructSize = sizeof(cc); cc.Flags = CC_ANYCOLOR|CC_FULLOPEN; cc.rgbResult = cr; ChooseColor(&cc);
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.