Old 20th July 2005, 09:02   #1
helge
Junior Member
 
Join Date: Jul 2005
Posts: 2
SendMessage to click button of other application

I am quite new to NSIS and not so familiar with windows messages. I like to use NSIS as a wrappper for another installation application to automize some steps. So I like to let the NSIS installer click some buttons in the other windows. From searching the forum I got the idea to use SendMessage for that. But I have no idea which message to use. There are quite a few messages in the winMessages.nsh like WM_MBUTTONDOWN or WM_NCLBUTTONDOWN which look like they could work. Has anyone some experience with that?
helge is offline   Reply With Quote
Old 20th July 2005, 09:10   #2
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
this probably is of help
Yathosho is offline   Reply With Quote
Old 20th July 2005, 12:44   #3
helge
Junior Member
 
Join Date: Jul 2005
Posts: 2
Thanks for the link. Now I have another question: I adapted the code to my needs (see below) and started testing it a little bit but I cannot get the GetWindowModuleFileName function work properly. I might not need this function in this special case but I like to know how to work with it.

Although $0 gives me the window handle to my password (Kennwort) window $2 just gives me name and path of the runnning NSIS installer. I cannot see what I did wrong but I certainly did.

Code:

Section ""
StrCpy $3 0

wait:
IntOp $3 $3 + 1
StrCmp $3 500 error
Sleep 100
FindWindow $0 "om-popup" "Kennwort"
StrCmp $0 0 wait
strcpy $2 "test"
MessageBox MB_OK "Handle: $0"
MessageBox MB_OK "vor GetWin ... : $2"
System::Call 'user32::GetWindowModuleFileName(i r0, t .r2, i ${NSIS_MAX_STRLEN})'
MessageBox MB_OK "nach GetW...: $2"

${GetFileName} '$2' $2
MessageBox MB_OK "Datei :$2"
goto Erfolg

error:
MessageBox MB_OK "nicht gefunden"
quit

Erfolg:
SectionEnd
helge is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump