|
|
#1 |
|
Member
Join Date: Sep 2002
Posts: 62
|
Need "SendMessage"-Command Help
Hello World:)
Closing winamp with NSIS is no problem: Function CloseWinamp Push $0 loop: FindWindow $0 "Winamp v1.x" IntCmp $0 0 done SendMessage $0 "000E" 0 0 SendMessage $0 "0002" 0 0 SendMessage $0 "0082" 0 0 ;or thisone SendMessage $0 "16" 0 0 Sleep 100 Goto loop done: Pop $0 FunctionEnd But I would like to build a little effect with MS-Editor Editor should start and Letters should be inserted automatically. I tried thisone without succes, Notepad starts and nothing else. Function CloseWinamp Exec $WINDIR\Notepad.exe Push $0 loop: FindWindow $0 "" "Unbenannt - Editor" IntCmp $0 0 done SendMessage $0 "0100" 48 230001 ;P WM_KEYDOWN nVirtKey:'H' cRepeat:1 ScanCode:23 fExtended:0 fAltDown:0 fRepeat:0 fUp:0 [wParam:00000048 lParam:00230001] 00000514 SendMessage $0 "0102" 68 230001 ;P WM_CHAR chCharCode:'h' (104) cRepeat:1 ScanCode:23 fExtended:0 fAltDown:0 fRepeat:0 fUp:0 [wParam:00000068 lParam:00230001] 00000514 SendMessage $0 "0101" 48 C0230001 ;P WM_KEYUP nVirtKey:'H' cRepeat:1 ScanCode:23 fExtended:0 fAltDown:0 fRepeat:1 fUp:1 [wParam:00000048 lParam:C0230001] ; SendMessage $0 "000E" 0 0 ; SendMessage $0 "0002" 0 0 ; SendMessage $0 "0082" 0 0 ; SendMessage $0 "16" 0 0 Sleep 100 Goto loop done: Pop $0 FunctionEnd How Can I realize this special effect? |
|
|
|
|
|
#2 | |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,338
|
You got two problems in your code:
1) You send the messages to the notepad window it self and not to its text edit sub-window. 2) All of your hex numbers are written as normal numbers. You can also use WinMessages.nsh to make the code more readable, using ${WM_CLOSE} instead of 16 (0x10) for example. PHP Code:
Quote:
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
|
#3 |
|
Member
Join Date: Sep 2002
Posts: 62
|
Problems to run "Compile with bz2"
I put yours Into this:
PHP Code:
I get following errormessage: 2 warnings: unknown variable "{WM_CHAR}" detected, ignoring unknown variable "{WM_CLOSE}" detected, ignoring After running the exe only editor starts, withoutany typed char and without closing editor. Could you test it please? What do you mean with unknown file:"WinMessages.nsh"? |
|
|
|
|
|
#4 |
|
Member
Join Date: Sep 2002
Posts: 62
|
I know what you mean with Winmessages.nsh
Hi
I put the content of winmessages into my nsi script file and it works great. Why does not the NSIS-compiler use Winmessages automatically? Why are "Winmessages.nsh" and all other nsh files not mentioned in any documentation? |
|
|
|
|
|
#5 |
|
Member
Join Date: Sep 2002
Posts: 62
|
Hey World try this
;"SendMessage $2 ${WM_CHAR} 0x006E 0x310001
" should close the editor "click no-button", but it does not work, why???? PHP Code:
|
|
|
|
|
|
#6 | ||
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,338
|
Quote:
Quote:
I have edited some of your posts because they were huge, please post only the relevant parts of your scripts or output instead of all of it at once. If you want to include a big script attach it. NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
||
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|