在WIC中调用CreateBitmapFromHIcon时指定HICON索引

根据文档ExtractIconEx,返回指向HICON数组的指针。传递给CreateBitmapFromHICON时,如何指定要使用此数组中的哪个项目。

// GeoLocator Class
class GeoLocator {   
    getLocation(){
        const address = (function () {
        navigator.geolocation.getcurrentPosition(function (position) {
     getUserAddressBy(position.coords.latitude,position.coords.longitude)
        },function (error) {
            console.log("The Locator was denied : (")
        })     

  function getUserAddressBy(lat,long) {
    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function () {
        if (this.readyState == 4 && this.status == 200) {
            var address = JSON.parse(this.responseText)

            return address.results[0];
        }
    };
    xhttp.open("GET","https://maps.googleapis.com/maps/api/geocode/json? 
latlng="+lat+","+long+"&key=**KEY CREDENTIAL**",true);
    xhttp.send();
    }

  })();

  return address;
  };
};  


// THIS IS MY APP.JS

//Instantiate Current Location
const currentLocation = new GeoLocator();

address = currentLocation.getLocation();

console.log(address);
wflwfl 回答:在WIC中调用CreateBitmapFromHIcon时指定HICON索引

您需要在第二次调用nIcons之前为HICON ExtractIconEx值分配足够的空间,因此hiconLargehiconSmall应该是HICON目标的指针(HICON *)。当前,您只有足够的空间来容纳一个。然后,您可以像通常使用数组一样访问值。

本文链接:https://www.f2er.com/3169525.html

大家都在问