Thank you, Dave - and best wishes for you and yours.
Type: Posts; User: Ken Fitlike
Thank you, Dave - and best wishes for you and yours.
You bumped an old thread which isn't allowed. Please take the time to read the forum guidelines which explain this and other points that will help you to get better advice for your programming...
Yes, specifically GDI resources. You must DeleteObject any GDI object when you are done with it(caveat: shared system resources don't require deletion). In the case of the patterned brush,...
The device context is NULL when you call Ellipse and the brush must be selected into the device context prior to calling Ellipse - ie you have the order wrong. You're also using GetDC unnecessarily....
Ellipse:
For example:
HBRUSH hbr=CreateSolidBrush(RGB(255,0,0)); /*red brush*/
HBRUSH hOld=(HBRUSH)SelectObject(hdc,hbr);
Ellipse(hdc,10,10,200,200);
SelectObject(hdc,hOld);...
Welcome to the boards.
Please read the forum guidelines which can be found here:
http://cboard.cprogramming.com/announcement.php?f=7&a=51
In particular, please note that we generally don't...
Answers/discussion here:
http://cboard.cprogramming.com/showthread.php?t=106044
I sent this to you as a private message but once more...
Here's a link to the forum guidelines for your reference, since you seem to have been unable to locate them, possibly due to the fact...
WM_INITMENU and WM_INITMENUPOPUP may be of interest.
GetDlgItem.
Sorry, I didn't explain what I meant very well and rather hoped previous examples on this subject would illuminate my intent further.
The way your approach operates the window class is properly...
Actually, the fault's mine: I didn't see the RegisterButtonClass in your WM_CREATE handler.
BaseCtrl::stWndProc creates a new instance of BaseCtrl if GetWindowLongPtr returns 0 which calls...
Your main.cpp file contains only code for creating a standard window and some child windows with what is essentially an unregistered class(unregistered since that code is never called). The system...
The device context for a child window is usually that of its parent; this is definitely the case for a static control.
Is there some reason why you can't use SetWindowText/WM_SETTEXT?
Strange, given that the readme.txt that installs with the command line tools requires you to create an ilink32.cfg file. Have you seen this faq, by the way? Also, the documentation provided with the...
Petzold uses a microsoft compiler and the examples are old. Borland's bcc5.5.1 is also old; consider getting something more recent if that's an option for you.
That aside, with the #inclusion of...
Borland compilers shouldn't need <windows.h> #included in the resource script(*.dlg file).
I'm not sure if an mfc wrapper exists for EnumChildWindows but that api function and the corresponding EnumChildProc should provide what you need.
Remove the semi-colon from the end of all the conditionals, eg here:
if (d1 == 1); /*<-- bad semi-colon!*/
You may wish to consider shifting the repetitive code to a function and to replace all...
Seems to be an issue with vc2008 as earlier versions and other compilers don't produce the same problem. If the executable has a manifest for 'kiddie control styles' then the tooltip works as...
If the operation is completing successfully then you are loading a valid bitmap. I'd be tempted to look to variable declaration/naming - with some fonts hndl and hnd1 are indistinguishable to the...
More patience and less haste required(read the docs with a little more care):
Change/OR the last parameter of LoadImage and you should be good to go.
Windows specific so moved to Window programming.
Your dialog should get a WM_PAINT/OnPaint message when it needs to be drawn - perhaps initiating your timed image there may be of some use.
If...
Your window procedure needs to return the result of the DefWindowProc call, not break (and therefore return zero).
Also, it would be wise to replace those literal numbers in your WM_COMMAND...
Windows specific so moved to Windows Board.
>>I have tried several methods of getting the HWND<<
What exactly have you tried? Without specifying you'll just get suggestions that you've no doubt...
Quoted for truth.
Use the constants specified for MessageBox on msdn, ie instead of
if (lol == 2) prefer
if (lol == IDCANCEL)But be sure to read the 'return value' comments on that msdn page to...