| 查看: 7744 | 回复: 145 | |||
| 本帖产生 1 个 程序强帖 ,点击这里进行查看 | |||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | |||
[交流]
【交流】VC++, C#, VB答疑专贴 已有69人参与
|
|||
[ Last edited by 波不动 on 2010-1-8 at 19:44 ] |
» 本帖已获得的红花(最新10朵)
» 猜你喜欢
上海工程技术大学【激光智能制造】课题组招收硕士
已经有6人回复
带资进组求博导收留
已经有11人回复
自荐读博
已经有5人回复
求个博导看看
已经有16人回复
上海工程技术大学张培磊教授团队招收博士生
已经有4人回复
求助院士们,这个如何合成呀
已经有4人回复
临港实验室与上科大联培博士招生1名
已经有9人回复
写了一篇“相变储能技术在冷库中应用”的论文,论文内容以实验为主,投什么期刊合适?
已经有6人回复
最近几年招的学生写论文不引自己组发的文章
已经有11人回复
中科院杭州医学所招收博士生一名(生物分析化学、药物递送)
已经有3人回复

biowhb
银虫 (正式写手)
- 应助: 5 (幼儿园)
- 金币: 620.7
- 散金: 24
- 帖子: 396
- 在线: 103.4小时
- 虫号: 2353280
- 注册: 2013-03-17
- 性别: GG
- 专业: 微生物遗传育种学
★
小木虫: 金币+0.5, 给个红包,谢谢回帖
小木虫: 金币+0.5, 给个红包,谢谢回帖
|
初学windows编程:想把一个主窗体的客户区分割成三个部分,下面是代码,运行起来却仍是空白的没什么变化,这是为何?求大神指点 #include <windows.h> #define ID_FIRSTCHILD 100 #define ID_SECONDCHILD 101 #define ID_THIRDCHILD 102 // Global variable HINSTANCE hinst; // Function prototypes. int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int); InitApplication(HINSTANCE); InitInstance(HINSTANCE, int); LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM); BOOL CALLBACK EnumChildProc(HWND , LPARAM ) ; // Application entry point. int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG msg; if (!InitApplication(hinstance)) return FALSE; if (!InitInstance(hinstance, nCmdShow)) return FALSE; while (GetMessage(&msg, (HWND) NULL, 0, 0) != 0 && GetMessage(&msg, (HWND) NULL, 0, 0) != -1) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; UNREFERENCED_PARAMETER(lpCmdLine); } BOOL InitApplication(HINSTANCE hinstance) { WNDCLASSEX wcx; // Fill in the window class structure with parameters // that describe the main window. wcx.cbSize = sizeof(wcx); // size of structure wcx.style = CS_HREDRAW | CS_VREDRAW; // redraw if size changes wcx.lpfnWndProc = MainWndProc; // points to window procedure wcx.cbClsExtra = 0; // no extra class memory wcx.cbWndExtra = 0; // no extra window memory wcx.hInstance = hinstance; // handle to instance wcx.hIcon = LoadIcon(NULL, IDI_APPLICATION); // predefined app. icon wcx.hCursor = LoadCursor(NULL, IDC_ARROW); // predefined arrow wcx.hbrBackground = (HBRUSH)GetStockObject( WHITE_BRUSH); // white background brush wcx.lpszMenuName = "MainMenu"; // name of menu resource wcx.lpszClassName = "MainWClass"; // name of window class wcx.hIconSm = NULL; // Register the window class. return RegisterClassEx(&wcx); } BOOL InitInstance(HINSTANCE hinstance, int nCmdShow) { HWND hwnd; // Save the application-instance handle. hinst = hinstance; // Create the main window. hwnd = CreateWindow( "MainWClass", // name of window class "Sample", // title-bar string WS_OVERLAPPEDWINDOW, // top-level window CW_USEDEFAULT, // default horizontal position CW_USEDEFAULT, // default vertical position CW_USEDEFAULT, // default width CW_USEDEFAULT, // default height (HWND) NULL, // no owner window (HMENU) NULL, // use class menu hinstance, // handle to application instance (LPVOID) NULL); // no window-creation data if (!hwnd) return FALSE; // Show the window and send a WM_PAINT message to the window // procedure. ShowWindow(hwnd, nCmdShow); UpdateWindow(hwnd); return TRUE; } LONG APIENTRY MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { RECT rcClient; int i; switch(uMsg) { case WM_CREATE: // creating main window // Create three invisible child windows. for (i = 0; i < 3; i++) { CreateWindowEx( 0, "ChildWClass", (LPCTSTR) NULL, WS_CHILD | WS_BORDER, 0,0,0,0, hwnd, (HMENU) (int) (ID_FIRSTCHILD + i), hinst, NULL); } return 0; case WM_SIZE: // main window changed size // Get the dimensions of the main window's client // area, and enumerate the child windows. Pass the // dimensions to the child windows during enumeration. GetClientRect(hwnd, &rcClient); EnumChildWindows(hwnd, EnumChildProc, (LPARAM) &rcClient); return 0; // Process other messages. } return DefWindowProc(hwnd, uMsg, wParam, lParam); } BOOL CALLBACK EnumChildProc(HWND hwndChild, LPARAM lParam) { LPRECT rcParent; int i, idChild; // Retrieve the child-window identifier. Use it to set the // position of the child window. idChild = GetWindowLong(hwndChild, GWL_ID); if (idChild == ID_FIRSTCHILD) i = 0; else if (idChild == ID_SECONDCHILD) i = 1; else i = 2; // Size and position the child window. rcParent = (LPRECT) lParam; MoveWindow(hwndChild, (rcParent->right / 3) * i, 0, rcParent->right / 3, rcParent->bottom, TRUE); // Make sure the child window is visible. ShowWindow(hwndChild, SW_SHOW); return TRUE; } |

133楼2014-02-13 15:26:09
jjdg
版主 (知名作家)
- 程序强帖: 9
- 应助: 223 (大学生)
- 贵宾: 3.926
- 金币: 51003.4
- 红花: 238
- 帖子: 7227
- 在线: 474.2小时
- 虫号: 27000
- 注册: 2003-10-21
- 专业: 药物代谢与药物动力学
- 管辖: 程序语言

3楼2009-11-20 15:21:38

4楼2009-11-20 15:26:06
senlia
木虫 (小有名气)
- 应助: 2 (幼儿园)
- 贵宾: 3.521
- 金币: 2178.1
- 红花: 1
- 帖子: 223
- 在线: 6.7小时
- 虫号: 849005
- 注册: 2009-09-16
- 性别: GG
- 专业: 计算数学与科学工程计算

5楼2009-11-22 19:48:23







回复此楼
飞虎