win32
文章平均质量分 67
zdongfuyu
这个作者很懒,什么都没留下…
展开
-
手动编写最简单win32窗口
#includeHINSTANCE g_hInstance = 0;LRESULT WINAPI WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ){switch( uMsg ){case WM_DESTROY:PostQuitMessage( 0 );break;}return原创 2014-08-08 14:28:32 · 461 阅读 · 0 评论 -
C++ 创建深层次目录
// 将单字节转化成宽字节的字符串std::wstring s2ws(const std::string& s){int len;int slength = (int)s.length() + 1;len = MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, 0, 0);wchar_t* buf = new wchar_t原创 2014-11-14 16:20:35 · 673 阅读 · 0 评论 -
GetSaveFileName弹出文件选择框居中显示
OPENFILENAME ofn;ZeroMemory(&ofn, sizeof(ofn));TCHAR strfilename[521];// = suggested_name.ToWString();StrCpyW(strfilename, suggested_name.ToWString().c_str());ofn.lpstrFile = (LPWSTR)strfilena原创 2014-11-14 17:52:28 · 2043 阅读 · 0 评论 -
win32窗口按照屏幕居中
RECT rc, rc1, rctomove; int width = GetSystemMetrics(SM_CXSCREEN); int height = GetSystemMetrics(SM_CYSCREEN); rc.left = 0; rc.top = 0; rc.right = width; rc.bottom = height; GetCl原创 2014-11-27 13:47:38 · 2249 阅读 · 0 评论 -
win32 MFC中捕获鼠标信息
第一种方法:// 窗口句柄HWND lhwnd;HCURSOR lhCursor;DWORD dwThreadID = ::GetWindowThreadProcessId(hWnd, NULL);DWORD dwCurThreadID = ::GetCurrentThreadId();if (dwThreadID != dwCurThreadID){if (:原创 2017-02-17 10:51:14 · 796 阅读 · 0 评论