如:
hSample = LoadBitmap(hInst,MAKEINTRESOURCE(IDB_SAMPLE));
hInst参数是什么用处啊?

解决方案 »

  1.   

    Handle to the instance of the module whose executable file contains the bitmap to be loaded. 
      

  2.   

    想象一下,首先你把一幅位图以资源的形势引入了你的工程,然后你编译连接了。产生了一个exe文件,这幅位图到哪里了呢?没错,他被打包进了这个exe。然后,你双击了这个exe让操作系统运行他,操作系统加载了这个exe并返回一个指代这个exe的句柄,然后,你想显示那个位图了,于是你调用LoadBitmap,并传入这个指代你exe的句柄,同时传入编辑资源文件时定义的那个ID,于是,位图显示了。
      

  3.   

    HBITMAP LoadBitmap(
      HINSTANCE hInstance,  // handle to application instance
      LPCTSTR lpBitmapName  // name of bitmap resource
    );
    Parameters
    hInstance 
    [in] Handle to the instance of the module whose executable file contains the bitmap to be loaded. 
    lpBitmapName 
    [in] Pointer to a null-terminated string that contains the name of the bitmap resource to be loaded. Alternatively, this parameter can consist of the resource identifier in the low-order word and zero in the high-order word. The MAKEINTRESOURCE macro can be used to create this value. 
    第一个参数是包含你所需要的位图的可执行文件的一个实例的句柄
      

  4.   

    hInst指的是,你要Load的资源所在的模块实例的句柄
      

  5.   

    操作系统加载这个exe……这时位图资源是在硬盘上还是内存里?