vc中的一些常用方法
//一.打开cd-rom 【程序编程相关:VC/MFC Q&A 20041】
【推荐阅读:MFC DLL向导(一)】//二.关闭cd_rom 【扩展信息:分割视图的另一种窗口切换,可以切换的不只】
mcisendstring("set cdaudio door open wait",null,0,null);
mcisendstring("set cdaudio door closed wait",null,0,null);
//三.关闭计算机
osversioninfo osversioninfo; //包含操作系统版本信息的数据结构
osversioninfo.dwosversioninfosize = sizeof(osversioninfo);getversionex(&osversioninfo); //获取操作系统版本信息if(osversioninfo.dwplatformid == ver_platform_win32_windows){ //windows98,调用exitwindowsex()函数重新启动计算机 dword dwreserved; exitwindowsex(ewx_reboot,dwreserved); //可以改变第一个参数,实现注销用户. //关机.关闭电源等操作 // 退出前的一些处理程序}//四.重启计算机
typedef int (callback *shutdowndlg)(int); //显示关机对话框函数的指针
hinstance hinst = loadlibrary("shell32.dll"); //装入shell32.dllshutdowndlg shutdowndialog; //指向shell32.dll库中显示关机对话框函数的指针if(hinst != null){ //获得函数的地址并调用之 shutdowndialog = (shutdowndlg)getprocaddress(hinst,(lpstr)60); (*shutdowndialog)(0);}//五.枚举所有字体
... 下一页