crzftx Posted July 5, 2009 Share Posted July 5, 2009 After a bit of searching, it looks like maybe an error in the cast from pointer to integer, since I'm on 64-bit Windows. It is more likely my error than the developers, but I cannot figure out what I did wrong. Run("notepad.exe") WinWait("[CLASS:Notepad]") ConsoleWrite(String(HWnd(WinGetHandle("[CLASS:Notepad]"))) & @CRLF) ConsoleWrite(String(HWnd(String(HWnd(WinGetHandle("[CLASS:Notepad]"))))) & @CRLF) 0x00000000000A024C 0x0000000000000000 I have an HWND stored in a Windows form, so AutoIt reads it in as a string. If I want to do anything with that string, I convert it back to a handle. It seems to convert as all zeros. Any suggestions? Link to comment Share on other sites More sharing options...
BrettF Posted July 6, 2009 Share Posted July 6, 2009 (edited) How does the example from the helpfile go? Run("notepad.exe") WinWait("[CLASS:Notepad]") Local $hWnd = WinGetHandle("[CLASS:Notepad]") Local $sHWND = String($hWnd) ; Convert to a string WinSetState(HWnd($sHWND), "", @SW_MINIMIZE) Sleep(5000); Notepad should be minimized WinClose(HWnd($sHWND)) EDIT: Tested the above code on XP x64 and its working correctly. Edited July 6, 2009 by BrettF Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
crzftx Posted July 6, 2009 Author Share Posted July 6, 2009 Thanks for the response, but the example from the helpfile did not work. Notepad opened... nothing happened. Soon the AutoIt icon dissapeared Maybe because I'm on win7 x64? Link to comment Share on other sites More sharing options...
BrettF Posted July 6, 2009 Share Posted July 6, 2009 Let me test on Win7x64 then... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
trancexx Posted July 7, 2009 Share Posted July 7, 2009 BrettF was never heard from again. There are rumors that he was consumed by unknown force when trying to experiment on Win7 64-bit version. Apparently he was doing something with... with... omg!!! what's that??? it's, it's.... aaaaahhh!!! beeeeeep........ ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
weaponx Posted July 7, 2009 Share Posted July 7, 2009 I have an HWND stored in a Windows form, so AutoIt reads it in as a string. If I want to do anything with that string, I convert it back to a handle. It seems to convert as all zeros. Any suggestions?What are you doing with the handle that it needs to be converted to a string? Link to comment Share on other sites More sharing options...
crzftx Posted July 25, 2009 Author Share Posted July 25, 2009 What are you doing with the handle that it needs to be converted to a string?storing the handles. For example in a file or on a listview Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted July 25, 2009 Share Posted July 25, 2009 I am not sure why, but it's the second HWnd() that fails when running under x64.#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Run("notepad.exe") WinWait("[CLASS:Notepad]") $Hwnd = WinGetHandle("[CLASS:Notepad]") $String = "" $Temp = HWnd($Hwnd) $String &= $Temp & @CRLF $Temp = String($Temp) $String &= $Temp & @CRLF $Temp = HWnd($Temp) $String &= $Temp & "/" & @error & "/" & @CRLF $Temp = String($Temp) $String &= $Temp & @CRLF $String &= @TAB & @TAB & @TAB ProcessClose("notepad.exe") MsgBox(0, "Running under X64: " & (@AutoItX64 = True), $String)But still, this is all really pointless, why are you not using the value directly? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface 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