效果:
源码:
#include <uf.h> #include <uf_ui.h> extern DllExport void ufusr(char *param, int *returnCode, int rlen) { UF_initialize(); char* release; UF_get_release(&release); uc1601(release, 1); UF_free(release); UF_terminate(); } extern int ufusr_ask_unload(void) { return (UF_UNLOAD_IMMEDIATELY); }
还有另一种方法:
效果:
源码:
#include <uf.h> #include <uf_ui.h> #include <string> using std::string; extern DllExport void ufusr(char *param, int *returnCode, int rlen) { UF_initialize(); UF_system_info_t Ssysinfo; UF_ask_system_info(&Ssysinfo); string strUGVersion = Ssysinfo.program_name; UF_free_system_info(&Ssysinfo); char release[132]; sprintf(release, "%s", strUGVersion.c_str()); uc1601(release, 1); UF_terminate(); } extern int ufusr_ask_unload(void) { return (UF_UNLOAD_IMMEDIATELY); }