Antonio,



PS -- I use the following code in my programs when I want to limit them to a
SINGLEINSTANCE:




invoke FindWindowA,NULL,"Title of Program"
or rax,rax
  jz >
  invoke BringWindowToTop,rax
  invoke ExitProcess,0

: etc




....Where "Title of Program" was set by IupSetAttribute hDlg 'TITLE'




You actually don't even need the BringWindowToTop and in IUP you can use
return IUP_CLOSE in place of ExitProcess.




Thanks,

Andrew


On 3/28/2022 at 10:11 AM, Andrew Robinson <arobinso...@cox.net> wrote:


Ola Antonio,




I have a function cbMnuExit(), that closes all open dialogs and saves the
layout using IupConfigDialogClosed(). When this function is called from a menu
item (appropriately named "Exit"), all open dialogs are closed and the layout
is saved. I also set EXIT_CB to cbMnuExit() using IupSetFunction() so that
clicking on the Win close button will also call cbMnuExit(),  and although it
will save the layout it will not close all open dialogs. If I don't used
EXIT_CB, the layout won't be saved, so I know that cbMnuExit() is being
called, so something is not happening here as expected.




In an unrelated issue, I use IupSetGlobal() to set SINGLEINSTANCE=YES but it
doesn't work.




These are simple functions so I don't see how they could go wrong so maybe
there is something else required that I'm not aware of to make these work or
isn't documented?




Thanks,

Andrew

╔═══════════════╗
║  Environment  ║
╟───────────────╢
║ IUP   v3.30   ║
║ IM    v3.12   ║
║ CD    v5.11.1 ║
║ Win10 v21H1   ║
╚═══════════════╝
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to