Windows API one-day training (8) updatewindow Function
Source: Internet
Author: User
The updatewindow function is the customer area of the update window. It is mainly implemented by sending the wm_paint message.
The function declaration is as follows:
Winuserapi
Bool
Winapi
Updatewindow (
_ In hwnd );
HwndIs the window handle to update the window client area.
An example of calling this function is as follows:
#001 bool initinstance (hinstance, int ncmdshow)
#002 {
#003 hwnd;
#004
#005 hinst = hinstance; // Save the instance handle to the global variable.
#006
#007 hwnd = createwindow (szwindowclass,
#008 sztitle,
#009 ws_overlappedwindow,
#010 cw_usedefault,
#011 0,
#012 cw_usedefault,
#013 0,
#014 null,
#015 null,
#016 hinstance,
#017 null );
#018
#019 if (! Hwnd)
#020 {
#021 return false;
#022}
#023
#024 showwindow (hwnd, ncmdshow );
#025 updatewindow (hwnd );
#026
#027 //
#028 // Cai junsheng 2007/07/14
#029 // display window test.
#030 MessageBox (null, _ T ("maximize"), _ T ("test"), mb_ OK );
#031
#032 // the display window is maximized.
#033 showwindow (hwnd, sw_showmaximized );
#034
#035
#036 MessageBox (null, _ T ("original location"), _ T ("test"), mb_ OK );
#037
#038 // the original position of the display window is displayed.
#039 showwindow (hwnd, sw_shownormal );
#040
#041
#042 return true;
#043}
Row 3 calls the updatewindow function to update the customer zone of the window.
Generally, after creating a window, you must call the updatewindow function to update the display of the window's customer area. Otherwise, it will be messy.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service