Skip to content
⌘ NSIS Forum Archive

execwait a modal exe

5 posts

Re DeL SiLeNziO#

execwait a modal exe

Hi all,
I'm working to an install that runs with execwait an exe, (source is my C++ project that create a login mask( two fields with username e password etc etc...).

I would like that my exe program will be modal respect the nsis installer window.
I'm triyng to see this thread:
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.

I've downloaded the example but is not my scenario.

It is possible with nsis or is a problem of flag in c++ project in your idea?

thanks so much!
Afrow UK#
Pass $HWNDPARENT to your executable via the command line and pass its value (after conversion from string to unsigned int [atoi]) to CreateWindow/CreateWindowEx (hWndParent parameter). Then disable the NSIS window before showing your custom window using the EnableWindow() API.

Stu
Anders#
Section
ExecWait '"$pluginsdir\yourapp.exe" $hwndparent'
EnableWindow $hwndparent 1 ; Just in case the exe crashes
SectionEnd
yourapp.exe has to read the HWND on the command line and use it as the owner window in a call to DialogBox()

@Stu: CreateWindow without WS_CHILD would create a owned window (Like notepad find etc) and not a modal window. Adding EnableWindow on top of this should emulate a modal dialog IF you get it right (Enable/Disable NSIS at the correct time so you don't lose foreground lock)
Re DeL SiLeNziO#
I have already the return value, in this way:
ExecWait '"$INSTDIR\myprj.exe"' $0
so I will be:
ExecWait '"$INSTDIR\myprj.exe" $hwndparent' $0
??

After this, in my C++ source I do not have to do anything?

thanks!