/*============================================================================*\ FILE : UgMenuConfirmGet.c PURPOSE : Pro/TOOLKIT User Guide Example HISTORY.. DATE BUILD AUTHOR MODIFICATIONS 04-dec-97 H-02-02 dmp $$1 Created \*============================================================================*/ /*---------------------- Pro/Toolkit Includes ------------------------*/ #include #include #include /*---------------------- Function Prototypes -------------------------*/ int ProUserConfirmationInit(); ProError ProUserQuitWindowConfirm(); int ProUserConfirmationInit() { int menuId; ProError ProUserQuitWindowConfirm(); ProMenuFileRegister("main","main.mnu", &menuId); ProMenubuttonPreactionSet("main","Quit Window", (ProMenubuttonAction)ProUserQuitWindowConfirm, NULL, 0); } ProError ProUserQuitWindowConfirm(ProAppData data, int num) { wchar_t w_answer[4]; char answer[4]; wchar_t msgfil[20]; ProStringToWstring(msgfil, "msg_ugmenu.txt"); ProMessageDisplay(msgfil, "USER Do you really want to Quit Window? [Y] :"); /*------------------------------------------------------------*\ If the user just hit return, go ahead and quit. \*------------------------------------------------------------*/ if(ProMessageStringRead(4,w_answer)) return(0); /*------------------------------------------------------------*\ If the answer starts with 'n' return TRUE to prevent the Quit Window \*------------------------------------------------------------*/ ProWstringToString(answer, w_answer); return(tolower(answer[0]) == 'n'); }