我使用 C++ builder 5 并在我的程序中获得了一些链接。如果没有默认选项,我希望这些链接在默认系统浏览器或 firefox 中打开。
我用了:
ShellExecute(NULL, "open", "http://maps.google.nl/maps?f=q&hl=nl&q=", NULL, NULL, SW_SHOWNORMAL);
但是对于某些链接,它不适用于已经存在的代码。
// this is not working
case 4: if(Qry_shipment->RecordCount == 0){return;}
webaddress = "http://maps.google.nl/maps?f=q&hl=nl&q=";
//we need the info from clicked shipment-not from overflow
if(Qry_shipment->FieldByName("tstohn")->AsString == pAuthorization[7])
{
webaddress = webaddress
+ Qry_shipment->FieldByName("tslpla")->AsString + ","
+ Qry_shipment->FieldByName("tslzcd")->AsString + ","
+ Qry_shipment->FieldByName("lalaad")->AsString;
}
else
{
webaddress = webaddress
+ Qry_shipment->FieldByName("tsupla")->AsString + ","
+ Qry_shipment->FieldByName("tsuzcd")->AsString + ","
+ Qry_shipment->FieldByName("lalos")->AsString;
}
break;
是否有一段代码,所以我可以为它自己的程序定义默认浏览器,这样我就不必编辑所有链接。