torels Posted October 8, 2008 Share Posted October 8, 2008 (edited) Hi there I have this vb6 code Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long I tried to bring it to autoit (nearly guessing all the thing) and I got this: Func PostMessage($hwnd,$wMsg,$wParam,$lParam) DllCall("user32.dll", "Long", "PostMessageA", "Long", $hwnd, "Long", $wMsg, "Long", $wParam, "Long", $lParam) EndFunc Is this right ? 'cause it is't working thanks in advance Edited October 8, 2008 by torels Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
Pain Posted October 8, 2008 Share Posted October 8, 2008 $aResult = DllCall("User32.dll", "int", "PostMessageA", "hwnd", $hWnd, "int", $iMsg, "int", $iwParam, "int", $ilParam) Return $aResult[0] Link to comment Share on other sites More sharing options...
zorphnog Posted October 8, 2008 Share Posted October 8, 2008 I don't see a definition for PostMessageA in the Win32 API, only one for PostMessage. http://msdn.microsoft.com/en-us/library/ms644944(VS.85).aspx Link to comment Share on other sites More sharing options...
torels Posted October 8, 2008 Author Share Posted October 8, 2008 why does Long become Int ??? Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
Pain Posted October 8, 2008 Share Posted October 8, 2008 (edited) You can use long if you like but I'm using int because you can use it for basically everything.int a 32 bit integer long a 32 bit integerThe problem was type "hwnd".@ zorphnog A stands for ANSI.From the helpfile:By default, AutoIt tries to use the ANSI version of a function name, i.e. MessageBoxA is attempted when MessageBox is given as the function name. To call the unicode version use MessageBoxW. Edited October 8, 2008 by Pain Link to comment Share on other sites More sharing options...
torels Posted October 8, 2008 Author Share Posted October 8, 2008 Thanks And... are there right ? Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Func FindWindow($Classname,$windowname) $dc = DllCall("User32.dll", "Long", "FindWindow", "String", $Classname, "String", $windowname) MsgBox(0,"",$dc[0]) Return $dc[0] EndFunc ? thanks in advance Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
Pain Posted October 8, 2008 Share Posted October 8, 2008 Seems right but there is no type called "string", try with "str". DllCall("user32.dll", "long", "FindWindow", "str", $Classname, "str", $windowname) 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