以下一段代码为什么没有反应

shankaipingo 2006-10-31 01:11:29
BOOL CPetWindowDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

//得到最顶层的那个窗体的句柄

HWND hwndTop=::GetTopWindow(NULL);
RECT r;


HDC cc=::GetDC(hwndTop);
::GetClientRect(hwndTop,&r);

//在窗体上写字
TextOut(cc, r.left, r.top, "Defenestration can be hazardous", 23);



// TODO: Add extra initialization here

return TRUE; // return TRUE unless you set the focus to a control
}

没有写出字来
...全文
176 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
star119119 2006-10-31
  • 打赏
  • 举报
回复
::GetTopWindow(NULL);

If the function succeeds, the return value is a handle to the child window at the top of the Z order. If the specified window has no child windows, the return value is NULL.

a handle of child window,not main window.
飞哥 2006-10-31
  • 打赏
  • 举报
回复
句柄不对·

70,023

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧