本人初学《windows程序设计》,里面关于这方面蜻蜓点水,希望高手指教!

解决方案 »

  1.   

    只知道这两个是CreateWindow()的参数,但是具体的使用就不知道了
      

  2.   

    hwndButton = CreateWindow(
                      "BUTTON",   // predefined class
                      "OK",       // button text
                      WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON|BS_ICON,//styles
                   // Size and position values are given explicitly, because
                   // the CW_USEDEFAULT constant gives zero values for buttons.                   5, // starting x position
                       5, // starting y position
                      30, // button width
                      18, // button height
                      hWnd,   // parent window
                      NULL,   // No menu
                      (HINSTANCE) GetWindowLong(hWnd,GWL_HINSTANCE),
                      NULL);      // pointer not needed // load the icon, NOTE: you should delete it after assigning it.
     hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_ICON1));
     // associate the icon with the button.
     SendMessage(hwndButton,BM_SETIMAGE,(WPARAM)IMAGE_ICON,
                (LPARAM)(HANDLE)hIcon);