|
-
May 17th, 2007, 10:33 AM
#5
Re: Drawing labels on a window
 Originally Posted by golanshahar
DC and hWnd is two different things! DC is associated to window if you want to display text on hWnd you can do something like that:
Code:
HDC hDC =::GetDC( hWnd );
::TextOut(hDC,,,,,,);
::ReleaseDC(hWnd,hDC);
Cheers
I've implemented the code:
Code:
HDC DC =::GetDC(hwnd);
::TextOut(DC,10,10,"text",-1);
/*Set Labels*/
/*Status bar*/
Status = CreateWindowEx(0, STATUSCLASSNAME, NULL,
WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP, 0, 0, 0, 0,
hwnd, (HMENU)STATUS_BAR, GetModuleHandle(NULL), NULL);
SendMessage(Status, SB_SETTEXT, 0, (LPARAM)"Open a file for editing.");
/*Set focus*/
SetFocus(EditTitle);
/*Other*/
case WM_COMMAND: //etc...
And I get this error: jump to case label
crosses initialisation of HDC__*DC
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|