trancexx Posted October 12, 2008 Share Posted October 12, 2008 It's about "msvfw32.dll" and function "MCIWndCreate"This is what I got:expandcollapse popup#NoTrayIcon #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Dim $file = FileOpenDialog("Choose fle", @DesktopDir, "(*.wma;*.mid;*.wav;*.mp3;*.rmi;*.aif;*.au;*.snd)", 1) If @error Then Exit $file = 0 Dim $Button_1, $Button_2, $msg Dim $gui = GUICreate("Test", 270, 100) $Button_1 = GUICtrlCreateButton("Play", 15, 30, 100) $Button_2 = GUICtrlCreateButton("Stop", 145, 30, 100) GUISetState() Dim $inst = DllCall("Kernel32.dll", "hwnd", "GetModuleHandle", "ptr", 0) Dim $p = DllCall("msvfw32.dll", "hwnd", "MCIWndCreate", "hwnd", $gui, "hwnd", $inst[0], "int", $WS_CHILD, "str", $file) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 Play() Case $msg = $Button_2 Stop() EndSelect WEnd Func Play() EndFunc Func Stop() EndFuncIt's crashing and I don't know why. Actually, it's because I'm doing something wrong but don't know what (there are tears in my eyes... and pain too ). "$file" is set to 0 to see that it's actually calling before crash (comment that line out)msvfw32.dll is great. Can be used to play enormous types of files (videos included). This is something about it (exported functions are at the bottom):CODE+++++++++++++++++++ IMPORTED FUNCTIONS +++++++++++++++++++Number of Imported Modules = 8 (decimal) Import Module 001: ntdll.dll Import Module 002: USER32.dll Import Module 003: KERNEL32.dll Import Module 004: GDI32.dll Import Module 005: WINMM.dll Import Module 006: ADVAPI32.dll Import Module 007: SHELL32.dll Import Module 008: COMCTL32.dll+++++++++++++++++++ IMPORT MODULE DETAILS +++++++++++++++++ Import Module 001: ntdll.dll Addr:7C90D960 hint(0104) Name: NtQueryVirtualMemoryAddr:7C92ABA5 hint(0352) Name: RtlUnwindAddr:7C929F03 hint(0520) Name: wcstolAddr:7C9701F9 hint(0521) Name: wcstombsAddr:7C9020F5 hint(04F3) Name: memmove Import Module 002: USER32.dll Addr:7E4297FF hint(01A6) Name: IsIconicAddr:7E428FFD hint(00C8) Name: EndPaintAddr:7E42D312 hint(0096) Name: DestroyIconAddr:7E430A47 hint(008C) Name: DefMDIChildProcWAddr:7E429B60 hint(0040) Name: ClientToScreenAddr:7E46531E hint(02A4) Name: TrackPopupMenuAddr:7E41929B hint(01FE) Name: PeekMessageWAddr:7E429719 hint(020B) Name: PtInRectAddr:7E429C8A hint(01B0) Name: IsZoomedAddr:7E42974E hint(010B) Name: GetCursorPosAddr:7E418EAB hint(015B) Name: GetSysColorBrushAddr:7E42D1D2 hint(010E) Name: GetDesktopWindowAddr:7E429ED9 hint(0121) Name: GetKeyStateAddr:7E42B19C hint(0099) Name: DestroyWindowAddr:7E429655 hint(016A) Name: GetWindowAddr:7E429D12 hint(00FD) Name: GetClassNameWAddr:7E42E8BC hint(01BC) Name: LoadIconWAddr:7E42D39D hint(0097) Name: DestroyMenuAddr:7E4232BA hint(0009) Name: AppendMenuWAddr:7E41F601 hint(005E) Name: CreatePopupMenuAddr:7E431ABD hint(0039) Name: CheckMenuItemAddr:7E42D0A3 hint(0061) Name: CreateWindowExWAddr:7E41AF34 hint(021B) Name: RegisterClipboardFormatWAddr:7E430277 hint(01F3) Name: OpenClipboardAddr:7E430D96 hint(00C1) Name: EmptyClipboardAddr:7E430F9E hint(024A) Name: SetClipboardDataAddr:7E430265 hint(0042) Name: CloseClipboardAddr:7E43D06C hint(00B6) Name: DrawIconAddr:7E424305 hint(0114) Name: GetDlgItemTextWAddr:7E4298D5 hint(018A) Name: InflateRectAddr:7E418E78 hint(015A) Name: GetSysColorAddr:7E42A01E hint(001C) Name: CallWindowProcWAddr:7E41A8AD hint(02D8) Name: wsprintfAAddr:7E41A610 hint(02DA) Name: wvsprintfAAddr:7E427822 hint(0243) Name: SetActiveWindowAddr:7E42960E hint(0287) Name: SetWindowTextWAddr:7E42910F hint(0145) Name: GetParentAddr:7E429F72 hint(01AE) Name: IsWindowUnicodeAddr:7E428FA6 hint(026C) Name: SetRectAddr:7E4298FE hint(01A8) Name: IsRectEmptyAddr:7E418CCB hint(0200) Name: PostMessageWAddr:7E41A9D1 hint(02DB) Name: wvsprintfWAddr:7E428FE9 hint(000D) Name: BeginPaintAddr:7E4294B3 hint(014B) Name: GetPropWAddr:7E418C42 hint(01B2) Name: KillTimerAddr:7E4273CC hint(0237) Name: SendDlgItemMessageWAddr:7E418C2E hint(027A) Name: SetTimerAddr:7E42C076 hint(022D) Name: RemovePropWAddr:7E429C2F hint(00E2) Name: FillRectAddr:7E429CBA hint(026D) Name: SetRectEmptyAddr:7E42D7E2 hint(00BF) Name: DrawTextWAddr:7E429011 hint(01F2) Name: OffsetRectAddr:7E42B1B0 hint(002C) Name: CharNextWAddr:7E42D607 hint(002F) Name: CharPrevWAddr:7E42B24C hint(0029) Name: CharLowerWAddr:7E419216 hint(0036) Name: CharUpperBuffWAddr:7E42C0B9 hint(026B) Name: SetPropWAddr:7E419F06 hint(029A) Name: SystemParametersInfoWAddr:7E42FA3E hint(02D4) Name: WindowFromDCAddr:7E42C2E8 hint(00EB) Name: GetActiveWindowAddr:7E418F9C hint(015D) Name: GetSystemMetricsAddr:7E4247AB hint(009F) Name: DialogBoxParamWAddr:7E428FD5 hint(0193) Name: InvalidateRectAddr:7E45BC09 hint(0252) Name: SetDlgItemIntAddr:7E42F750 hint(026F) Name: SetScrollPosAddr:7E429849 hint(00C4) Name: EnableWindowAddr:7E424DFA hint(01A3) Name: IsDlgButtonCheckedAddr:7E424A4E hint(00C6) Name: EndDialogAddr:7E42AF56 hint(0292) Name: ShowWindowAddr:7E42F99B hint(0270) Name: SetScrollRangeAddr:7E42C2BB hint(0281) Name: SetWindowLongWAddr:7E42F56B hint(0286) Name: SetWindowTextAAddr:7E41AE3F hint(0035) Name: CharUpperBuffAAddr:7E42B29E hint(01E9) Name: MoveWindowAddr:7E424DCA hint(0038) Name: CheckDlgButtonAddr:7E428D20 hint(008F) Name: DefWindowProcWAddr:7E42AEAB hint(02BB) Name: UpdateWindowAddr:7E419D69 hint(01BA) Name: LoadCursorWAddr:7E429930 hint(024D) Name: SetCursorAddr:7E45BC8B hint(0112) Name: GetDlgItemIntAddr:7E42908E hint(00FF) Name: GetClientRectAddr:7E42F704 hint(0156) Name: GetScrollPosAddr:7E42736C hint(0254) Name: SetDlgItemTextWAddr:7E42436E hint(0111) Name: GetDlgItemAddr:7E4290B4 hint(0174) Name: GetWindowRectAddr:7E41A39A hint(0219) Name: RegisterClassWAddr:7E42E81E hint(00F9) Name: GetClassInfoWAddr:7E466534 hint(01E3) Name: MessageBoxWAddr:7E419E36 hint(01C9) Name: LoadStringWAddr:7E41A9B6 hint(02D9) Name: wsprintfWAddr:7E428845 hint(0027) Name: CharLowerBuffAAddr:7E42929A hint(0240) Name: SendMessageWAddr:7E429823 hint(0117) Name: GetForegroundWindowAddr:7E4297A0 hint(0231) Name: ScreenToClientAddr:7E4314BA hint(012C) Name: GetMenuAddr:7E4188A6 hint(016F) Name: GetWindowLongWAddr:7E431140 hint(0001) Name: AdjustWindowRectAddr:7E4299F3 hint(0283) Name: SetWindowPosAddr:7E4186C7 hint(010C) Name: GetDCAddr:7E41869D hint(022A) Name: ReleaseDCAddr:7E428717 hint(0026) Name: CharLowerA Import Module 003: KERNEL32.dll Addr:7C80B8E2 hint(0162) Name: GetFullPathNameWAddr:7C8213E0 hint(01AA) Name: GetProfileStringWAddr:7C80AEDB hint(0247) Name: LoadLibraryWAddr:7C80F9ED hint(0195) Name: GetPrivateProfileStringWAddr:7C809F09 hint(022A) Name: IsBadWritePtrAddr:7C801D7B hint(0244) Name: LoadLibraryAAddr:7C80AC6E hint(00F0) Name: FreeLibraryAddr:7C80E4CD hint(0179) Name: GetModuleHandleWAddr:7C8099BF hint(024E) Name: LocalFreeAddr:7C809A1D hint(024A) Name: LocalAllocAddr:7C80B731 hint(0176) Name: GetModuleHandleAAddr:7C809856 hint(0266) Name: MulDivAddr:7C812449 hint(01FB) Name: GlobalReAllocAddr:7C80BA7F hint(03B5) Name: lstrcpynWAddr:7C80BD5F hint(0224) Name: IsBadCodePtrAddr:7C80B465 hint(0175) Name: GetModuleFileNameWAddr:7C901000 hint(0096) Name: EnterCriticalSectionAddr:7C80FDBD hint(01ED) Name: GlobalAllocAddr:7C80FFA9 hint(01F8) Name: GlobalLockAddr:7C9010E0 hint(0243) Name: LeaveCriticalSectionAddr:7C80BE46 hint(03B7) Name: lstrlenAAddr:7C831DD3 hint(01BA) Name: GetSystemDirectoryWAddr:7C802336 hint(0066) Name: CreateProcessWAddr:7C802530 hint(037E) Name: WaitForSingleObjectAddr:7C809BD7 hint(0031) Name: CloseHandleAddr:7C80AA26 hint(03AF) Name: lstrcmpiWAddr:7C81EE34 hint(0395) Name: WritePrivateProfileStringWAddr:7C80AE30 hint(0198) Name: GetProcAddressAddr:7C809F81 hint(0218) Name: InitializeCriticalSectionAddr:7C80AC51 hint(019C) Name: GetProcessHeapAddr:7C9100A4 hint(0205) Name: HeapAllocAddr:7C811326 hint(0089) Name: DisableThreadLibraryCallsAddr:7C835505 hint(0001) Name: AddAtomAAddr:7C834D59 hint(03A8) Name: lstrcatAAddr:7C80BE91 hint(03B1) Name: lstrcpyAAddr:7C830CEE hint(00CA) Name: FindAtomAAddr:7C8326D9 hint(0002) Name: AddAtomWAddr:7C810FC2 hint(03A9) Name: lstrcatWAddr:7C80BAF4 hint(03B2) Name: lstrcpyWAddr:7C82F817 hint(00CB) Name: FindAtomWAddr:7C809A99 hint(03B8) Name: lstrlenWAddr:7C809C88 hint(0267) Name: MultiByteToWideCharAddr:7C8099A5 hint(00F6) Name: GetACPAddr:7C80A164 hint(0382) Name: WideCharToMultiByteAddr:7C8326AD hint(007E) Name: DeleteAtomAddr:7C80A4B7 hint(0294) Name: QueryPerformanceCounterAddr:7C80932E hint(01D4) Name: GetTickCountAddr:7C8097B8 hint(013E) Name: GetCurrentThreadIdAddr:7C8099B0 hint(013C) Name: GetCurrentProcessIdAddr:7C8017E9 hint(01C0) Name: GetSystemTimeAsFileTimeAddr:7C801E1A hint(034A) Name: TerminateProcessAddr:7C80DE85 hint(013B) Name: GetCurrentProcessAddr:7C863E6A hint(035B) Name: UnhandledExceptionFilterAddr:7C8449FD hint(0336) Name: SetUnhandledExceptionFilterAddr:7C80FCBF hint(01F4) Name: GlobalFreeAddr:7C80FF12 hint(01FF) Name: GlobalUnlockAddr:7C834CD1 hint(01F7) Name: GlobalHandleAddr:7C91135A hint(007F) Name: DeleteCriticalSection Import Module 004: GDI32.dll Addr:77F18BDF hint(0208) Name: SaveDCAddr:77F18B19 hint(0201) Name: RestoreDCAddr:77F15D77 hint(023D) Name: SetTextColorAddr:77F283FB hint(0044) Name: CreateMetaFileWAddr:77F18E05 hint(0244) Name: SetWindowOrgExAddr:77F23A05 hint(0243) Name: SetWindowExtExAddr:77F28167 hint(001E) Name: CloseMetaFileAddr:77F23DAC hint(008E) Name: DeleteMetaFileAddr:77F1AFF9 hint(003E) Name: CreateFontWAddr:77F16B0D hint(01B9) Name: GetTextExtentPointWAddr:77F190DD hint(00D7) Name: ExcludeClipRectAddr:77F1ACB8 hint(0046) Name: CreatePatternBrushAddr:77F1AD13 hint(0033) Name: CreateDIBitmapAddr:77F1938F hint(003D) Name: CreateFontIndirectWAddr:77F161A5 hint(0050) Name: CreateSolidBrushAddr:77F19F95 hint(016B) Name: GetDIBitsAddr:77F1AB87 hint(0220) Name: SetDIBitsAddr:77F1AAC3 hint(0194) Name: GetNearestColorAddr:77F1AAE4 hint(014B) Name: GetBitmapBitsAddr:77F1869B hint(01DE) Name: PatBltAddr:77F1B73C hint(019D) Name: GetPixelAddr:77F15E29 hint(0216) Name: SetBkColorAddr:77F18086 hint(00DE) Name: ExtTextOutWAddr:77F2777C hint(00D4) Name: EscapeAddr:77F16AA1 hint(0161) Name: GetClipBoxAddr:77F1D7F2 hint(0214) Name: SetBitmapBitsAddr:77F1B6C0 hint(024A) Name: StretchBltAddr:77F19BFB hint(0221) Name: SetDIBitsToDeviceAddr:77F1B09E hint(024B) Name: StretchDIBitsAddr:77F15985 hint(011B) Name: GdiFlushAddr:77F18597 hint(0239) Name: SetStretchBltModeAddr:77F1EA4B hint(01F4) Name: RealizePaletteAddr:77F161C1 hint(01A6) Name: GetStockObjectAddr:77F18632 hint(0210) Name: SelectPaletteAddr:77F15FE0 hint(002D) Name: CreateCompatibleDCAddr:77F1700A hint(002C) Name: CreateCompatibleBitmapAddr:77F19E09 hint(0032) Name: CreateDIBSectionAddr:77F1BA8E hint(01AA) Name: GetSystemPaletteEntriesAddr:77F1D827 hint(0253) Name: UnrealizeObjectAddr:77F44816 hint(0200) Name: ResizePaletteAddr:77F3CF18 hint(0231) Name: SetPaletteEntriesAddr:77F3CECE hint(0009) Name: AnimatePaletteAddr:77F2C703 hint(021F) Name: SetDIBColorTableAddr:77F44806 hint(0195) Name: GetNearestPaletteIndexAddr:77F183B3 hint(0198) Name: GetObjectWAddr:77F1B60A hint(019B) Name: GetPaletteEntriesAddr:77F1B5DA hint(0045) Name: CreatePaletteAddr:77F16BFA hint(008F) Name: DeleteObjectAddr:77F15B70 hint(020F) Name: SelectObjectAddr:77F16E5F hint(008C) Name: DeleteDCAddr:77F1D4B7 hint(01CC) Name: LPtoDPAddr:77F1D9DF hint(0168) Name: GetDCOrgExAddr:77F16A56 hint(01C8) Name: IntersectClipRectAddr:77F15A69 hint(016C) Name: GetDeviceCaps Import Module 005: WINMM.dll Addr:76B536C8 hint(003A) Name: mciGetErrorStringAAddr:76B54911 hint(0040) Name: mciSendStringAAddr:76B54265 hint(0041) Name: mciSendStringWAddr:76B53B67 hint(003F) Name: mciSendCommandWAddr:76B42DDE hint(0004) Name: GetDriverModuleHandleAddr:76B43890 hint(0000) Name: CloseDriverAddr:76B42E37 hint(0008) Name: OpenDriverAddr:76B5375B hint(003B) Name: mciGetErrorStringW Import Module 006: ADVAPI32.dll Addr:77DD6A9F hint(01E5) Name: RegOpenKeyExWAddr:77DDEFB8 hint(01E3) Name: RegOpenKeyAAddr:77DFBA25 hint(01D0) Name: RegCreateKeyWAddr:77DD7EDD hint(01DC) Name: RegEnumValueWAddr:77DD775C hint(01CF) Name: RegCreateKeyExWAddr:77DD7CB9 hint(001D) Name: AllocateAndInitializeSidAddr:77DD7FBA hint(0038) Name: CheckTokenMembershipAddr:77DD7CA8 hint(00E1) Name: FreeSidAddr:77DFBCC3 hint(01CD) Name: RegCreateKeyAAddr:77DDD757 hint(01FC) Name: RegSetValueExWAddr:77DDEDE1 hint(01D4) Name: RegDeleteValueWAddr:77DD6FEF hint(01EF) Name: RegQueryValueExWAddr:77DD7AAB hint(01EE) Name: RegQueryValueExAAddr:77DD6C17 hint(01CA) Name: RegCloseKeyAddr:77DD7936 hint(01E6) Name: RegOpenKeyW Import Module 007: SHELL32.dll Addr:7CA77C18 hint(001F) Name: DragFinishAddr:7CA2B1A9 hint(001E) Name: DragAcceptFilesAddr:7CA118CE hint(0023) Name: DragQueryFileW Import Module 008: COMCTL32.dll Addr:7744B609 hint(0011) Name: COMCTL32:NoName0000Addr:77444AFE hint(000A) Name: CreateToolbarEx+++++++++++++++++++ EXPORTED FUNCTIONS +++++++++++++++++++Number of Exported Functions = 47 (decimal)Addr:75A74641 Ord: 2 (0002h) Name: VideoForWindowsVersionAddr:75A72503 Ord: 3 (0003h) Name: DrawDibBeginAddr:75A7949B Ord: 4 (0004h) Name: DrawDibChangePaletteAddr:75A79C61 Ord: 5 (0005h) Name: DrawDibCloseAddr:75A719AA Ord: 6 (0006h) Name: DrawDibDrawAddr:75A79467 Ord: 7 (0007h) Name: DrawDibEndAddr:75A79759 Ord: 8 (0008h) Name: DrawDibGetBufferAddr:75A735EE Ord: 9 (0009h) Name: DrawDibGetPaletteAddr:75A7425A Ord: 10 (000Ah) Name: DrawDibOpenAddr:75A74312 Ord: 11 (000Bh) Name: DrawDibProfileDisplayAddr:75A7245A Ord: 12 (000Ch) Name: DrawDibRealizeAddr:75A7234C Ord: 13 (000Dh) Name: DrawDibSetPaletteAddr:75A7356F Ord: 14 (000Eh) Name: DrawDibStartAddr:75A735AF Ord: 15 (000Fh) Name: DrawDibStopAddr:75A79491 Ord: 16 (0010h) Name: DrawDibTimeAddr:75A7CCD4 Ord: 17 (0011h) Name: GetOpenFileNamePreviewAddr:75A7CCD4 Ord: 18 (0012h) Name: GetOpenFileNamePreviewAAddr:75A7CCA0 Ord: 19 (0013h) Name: GetOpenFileNamePreviewWAddr:75A7CCEE Ord: 20 (0014h) Name: GetSaveFileNamePreviewAAddr:75A7CCBA Ord: 21 (0015h) Name: GetSaveFileNamePreviewWAddr:75A73AF6 Ord: 22 (0016h) Name: ICCloseAddr:75A74D4D Ord: 23 (0017h) Name: ICCompressAddr:75A77BF0 Ord: 24 (0018h) Name: ICCompressorChooseAddr:75A75C1B Ord: 25 (0019h) Name: ICCompressorFreeAddr:75A74DB7 Ord: 26 (001Ah) Name: ICDecompressAddr:75A7196A Ord: 27 (001Bh) Name: ICDrawAddr:75A722D0 Ord: 28 (001Ch) Name: ICDrawBeginAddr:75A75955 Ord: 29 (001Dh) Name: ICGetDisplayFormatAddr:75A75624 Ord: 30 (001Eh) Name: ICGetInfoAddr:75A760A1 Ord: 31 (001Fh) Name: ICImageCompressAddr:75A76314 Ord: 32 (0020h) Name: ICImageDecompressAddr:75A73632 Ord: 33 (0021h) Name: ICInfoAddr:75A7572B Ord: 34 (0022h) Name: ICInstallAddr:75A73BFB Ord: 35 (0023h) Name: ICLocateAddr:75A78C02 Ord: 36 (0024h) Name: ICMThunk32Addr:75A73938 Ord: 37 (0025h) Name: ICOpenAddr:75A74036 Ord: 38 (0026h) Name: ICOpenFunctionAddr:75A75897 Ord: 39 (0027h) Name: ICRemoveAddr:75A7190D Ord: 40 (0028h) Name: ICSendMessageAddr:75A75FBF Ord: 41 (0029h) Name: ICSeqCompressFrameAddr:75A75F2A Ord: 42 (002Ah) Name: ICSeqCompressFrameEndAddr:75A75CD8 Ord: 43 (002Bh) Name: ICSeqCompressFrameStartAddr:75A81F10 Ord: 44 (002Ch) Name: MCIWndCreateAddr:75A81F10 Ord: 45 (002Dh) Name: MCIWndCreateAAddr:75A81E5E Ord: 46 (002Eh) Name: MCIWndCreateWAddr:75A81DD2 Ord: 47 (002Fh) Name: MCIWndRegisterClassAddr:75A7AA5F Ord: 48 (0030h) Name: StretchDIB ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
monoceres Posted October 12, 2008 Share Posted October 12, 2008 I don't think I have ever been so frustrated, I just can't see the error, I've tried everything, and the most irritating thing is that it works perfectly when I compile the exact same thing in C++. The only interesting result I managed to achieve was if you create it as a parent window instead, the window shows up, but the script crashes anyway. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
trancexx Posted October 13, 2008 Author Share Posted October 13, 2008 a little progress: expandcollapse popup#NoTrayIcon #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <SendMessage.au3> #cs Dim $file = FileOpenDialog("Choose fle", @DesktopDir, "(*.wma;*.mid;*.wav;*.mp3;*.rmi;*.aif;*.au;*.snd)", 1) If @error Then Exit #ce $file = 0 Dim $Button_1, $Button_2, $msg Dim $gui = GUICreate("Test", 270, 100) $Button_1 = GUICtrlCreateButton("Play", 15, 30, 100) $Button_2 = GUICtrlCreateButton("Stop", 145, 30, 100) ;BitOR($WS_CHILD, $WS_POPUP) GUISetState() Dim $inst = DllCall("Kernel32.dll", "hwnd", "GetModuleHandle", "ptr", 0) ;Dim $p = DllCall("msvfw32.dll", "hwnd:cdecl", "MCIWndCreate", "hwnd*", $gui, "hwnd", $inst[0], "int", $WS_CHILD, "str", $file ) Dim $p = DllCall("msvfw32.dll", "hwnd:cdecl", 0x002C, "hwnd", $gui, "hwnd", $inst[0], "dword", 0x40000000, "str", $file ) ConsoleWrite("@error --> " & @error & @CRLF) ConsoleWrite("$p[0] --> " & $p[0] & @CRLF) ConsoleWrite("$p[1] --> " & $p[1] & @CRLF) ConsoleWrite("$p[2] --> " & $p[2] & @CRLF) ConsoleWrite("$p[3] --> " & $p[3] & @CRLF) ConsoleWrite("$p[4] --> " & $p[4] & @CRLF) ConsoleWrite("3...2....1... crashhhhh!!!!!" & @CRLF) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 Play() Case $msg = $Button_2 Stop() EndSelect WEnd Func Play() ; SendMessage() EndFunc Func Stop() ; SendMessage() EndFunc I feel totally incompetent, thank you. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 13, 2008 Moderators Share Posted October 13, 2008 Guess I'm a bit lost on exactly what's failing here... are the play etc not working?expandcollapse popup#NoTrayIcon #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <SendMessage.au3> ;#cs Dim $file = FileOpenDialog("Choose fle", @DesktopDir, "(*.wma;*.mid;*.wav;*.mp3;*.rmi;*.aif;*.au;*.snd)", 1) If @error Then Exit ;#ce ;$file = 0 Dim $Button_1, $Button_2, $msg Dim $gui = GUICreate("Test", 270, 100) $Button_1 = GUICtrlCreateButton("Play", 15, 30, 100) $Button_2 = GUICtrlCreateButton("Stop", 145, 30, 100) ;BitOR($WS_CHILD, $WS_POPUP) GUISetState() Dim $inst = DllCall("Kernel32.dll", "hwnd", "GetModuleHandle", "ptr", 0) Dim $t_file = DllStructCreate("char text[" & StringLen($file) + 1 & "]") Dim $p_file = DllStructGetPtr($t_file) DllStructSetData($t_file, "text", $file) Dim $p = DllCall("msvfw32.dll", "hwnd:cdecl", "MCIWndCreate", "hwnd*", $gui, "hwnd", $inst[0], "int", $WS_CHILD, "ptr", $p_file ) ;Dim $p = DllCall("msvfw32.dll", "hwnd:cdecl", 0x002C, "hwnd", $gui, "hwnd", $inst[0], "dword", 0x40000000, "str", $file ) ConsoleWrite("@error --> " & @error & @CRLF) ConsoleWrite("$p[0] --> " & $p[0] & @CRLF) ConsoleWrite("$p[1] --> " & $p[1] & @CRLF) ConsoleWrite("$p[2] --> " & $p[2] & @CRLF) ConsoleWrite("$p[3] --> " & $p[3] & @CRLF) ConsoleWrite("$p[4] --> " & $p[4] & @CRLF) ConsoleWrite("3...2....1... crashhhhh!!!!!" & @CRLF) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 Play() Case $msg = $Button_2 Stop() EndSelect WEnd Func Play() ; SendMessage() EndFunc Func Stop() ; SendMessage() EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
trancexx Posted October 13, 2008 Author Share Posted October 13, 2008 Guess I'm a bit lost on exactly what's failing here... are the play etc not workingScript crashes before Play() - not defined in that script.DllCall() is done, no error, returns just fine and then it crashes for some reason. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
trancexx Posted October 13, 2008 Author Share Posted October 13, 2008 (edited) Jesus... I didn't even see that SmOke_N posted a script (that's what tears do) Will test it. edit: MSDN Library says (about the last parameter): "Null-terminated string indicating the name of an MCI device or data file to open." Something else needs to be changed. Edited October 13, 2008 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 13, 2008 Moderators Share Posted October 13, 2008 Jesus...I didn't even see that SmOke_N posted a script (that's what tears do)Will test it.edit:MSDN Library says (about the last parameter): "Null-terminated string indicating the name of an MCI device or data file to open."Something else needs to be changed.It also says that's a ptr LPCTSTR ... Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
trancexx Posted October 13, 2008 Author Share Posted October 13, 2008 (edited) It also says that's a ptr LPCTSTR ...But you are making a pointer to a buffer that receives the converted string and they say string. Edited October 13, 2008 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 13, 2008 Moderators Share Posted October 13, 2008 (edited) But you are making a pointer to a buffer that receives the converted string.A buffer?... yes I took space in memory to set the pointer (that parameter is not ByRef)... I guess I could have easily enough done "str*", $file) ... but it's a habit to create the structs/ptrs as they are requested. LPCTSTR is a long pointer (a constant char pointer)... Anyway, enough of the BS stuff, is it still crashing with either option (the struct/ptr or the "str*"?) Edit: NM, I see it doesn't return the hwnd. Edit2: Even more interesting... I can't even register the clas:CODEGlobal Const $MCIWNDOPENF_NEW = 0x000001 ;open a new file Global Const $MCIWNDF_NOAUTOSIZEWINDOW = 0x000001 ;when movie size changes Global Const $MCIWNDF_NOPLAYBAR = 0x000002 ;no toolbar Const Global Const $MCIWNDF_NOAUTOSIZEMOVIE = 0x000004 ;when window size changes Global Const $MCIWNDF_NOMENU = 0x000008 ;no popup menu from RBUTTONDOWN Global Const $MCIWNDF_SHOWNAME = 0x000010 ;show name in caption Global Const $MCIWNDF_SHOWPOS = 0x000020 ;show position in caption Global Const $MCIWNDF_SHOWMODE = 0x000040 ;show mode in caption Global Const $MCIWNDF_SHOWALL = 0x000070 ;show all Global Const $MCIWNDF_NOTIFYMODE = 0x000100 ;tell parent of mode change Global Const $MCIWNDF_NOTIFYPOS = 0x000200 ;tell parent of pos change Global Const $MCIWNDF_NOTIFYSIZE = 0x000400 ;tell parent of size change Global Const $MCIWNDF_NOTIFYERROR = 0x001000 ;tell parent of an error Global Const $MCIWNDF_NOTIFYALL = 0x001F00 ;tell all Global Const $MCIWNDF_NOTIFYANSI = 0x000080 Global Const $MCIWNDF_NOTIFYMEDIA = 0x000880 ;tell parent of media change Global Const $MCIWNDF_NOTIFYMEDIAW = 0x000800 ;tell parent of media change Global Const $MCIWNDF_RECORD = 0x002000 ;Give a record button Global Const $MCIWNDF_NOERRORDLG = 0x004000 ;Show Error Dlgs for MCI cmds? Global Const $MCIWNDF_NOOPEN = 0x008000 ;Don;t allow user to open things Global $h_instance = _MCIWndRegisterClass() Global $h_gui = GUICreate("Test", 270, 100) Global $h_button_play = GUICtrlCreateButton("Play", 15, 30, 100) Global $h_button_stop = GUICtrlCreateButton("Stop", 145, 30, 100) If Not $h_instance Then MsgBox(16, "Error", "Registering class failed.") Exit EndIf Global $h_mci = _MCICreate($h_gui, $h_instance, BitOR(0x00800000, 0x40000000, 0x10000000, $MCIWNDF_NOPLAYBAR)) GUISetState() While GUIGetMsg() <> -3 WEnd Func _MCIWndRegisterClass() Local $h_instance = DllCall("Kernel32.dll", "hwnd", "GetModuleHandle", "ptr", 0) Local $a_ret = DllCall("msvfw32.dll", "int:cdecl", "MCIWndRegisterClass", "hwnd", $h_instance[0]) If $a_ret[0] = 0 Then Return $h_instance[0] Return SetError(1, 0, 0) EndFunc Func _MCICreate($h_wnd, $h_instance, $i_style, $s_file = "") Local $h_mci = DllCall("msvfw32.dll", "hwnd:cdecl", "MCIWndCreate", "hwnd", $h_wnd, "hwnd", $h_instance, "dword", $i_style, "str*", $s_file) If @error Then Return SetError(1, 0, 0) Return $h_mci[0] EndFunc Edited October 13, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
trancexx Posted October 13, 2008 Author Share Posted October 13, 2008 (edited) DllOpen("msvfw32.dll") edit: expandcollapse popup#NoTrayIcon #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <SendMessage.au3> Dim $file = FileOpenDialog("Choose fle", @DesktopDir, "(*.wma;*.mid;*.wav;*.mp3;*.rmi;*.aif;*.au;*.snd)", 1) If @error Then Exit Dim $Button_1, $Button_2, $msg Dim $gui = GUICreate("Test", 270, 100) $Button_1 = GUICtrlCreateButton("Play", 15, 30, 100) $Button_2 = GUICtrlCreateButton("Stop", 145, 30, 100) GUISetState() Dim $inst = DllCall("Kernel32.dll", "hwnd", "GetModuleHandle", "ptr", 0) DllOpen("msvfw32.dll") Dim $p = DllCall("msvfw32.dll", "hwnd:cdecl", "MCIWndCreate", "hwnd", $gui, "hwnd", $inst[0], "int", $WS_CHILD, "str", $file ) ConsoleWrite("@error --> " & @error & @CRLF) ConsoleWrite("$p[0] --> " & $p[0] & @CRLF) ConsoleWrite("$p[1] --> " & $p[1] & @CRLF) ConsoleWrite("$p[2] --> " & $p[2] & @CRLF) ConsoleWrite("$p[3] --> " & $p[3] & @CRLF) ConsoleWrite("$p[4] --> " & $p[4] & @CRLF) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 Play() Case $msg = $Button_2 Stop() EndSelect WEnd Func Play() _SendMessage($p[0], 2054);0x0806 EndFunc Func Stop() _SendMessage($p[0], 2056) ;0x0808 EndFunc I feel kind of stupid now and everything... Edited October 13, 2008 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 13, 2008 Moderators Share Posted October 13, 2008 I swear dllopen was the first thing I tried!!! lol... Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
ptrex Posted October 14, 2008 Share Posted October 14, 2008 @trancexx This is realy great !! Regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now