 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
jethrow
Joined: 24 May 2009 Posts: 722 Location: Iowa, USA
|
Posted: Wed Nov 18, 2009 11:21 pm Post subject: Window HWND returned via COM - convert to Hex |
|
|
I'm trying to convert an integer to Hex, which I've gotten to work. However, if I try to do this with a window HWND that I retrieved via COM, it will not convert. This demonstrates what I mean: | Code: | pwb := COM_CreateObject("InternetExplorer.Application") ; AHK_L & COM_L
pwb.Visible := True
hwnd := pwb.HWND
If hwnd is Integer
MsgBox, %hwnd%
; hwnd := 10617752 ; example hwnd
SetFormat, Integer, Hex
hwnd := hwnd
SetFormat, Integer, Dec
MsgBox, %hwnd% |
The first MsgBox always comes up as an integer, but the second comes up as an integer as well (dec format). However, if I uncomment the sixth line, the second MsgBox will come up as Hex. Is the variable hwnd different if it's storing a value retrieved with COM? What I'm trying to do is access a window that was accessed with COM, but using the AHK commands. (ie WinTitle := ahk_id %hwnd%) _________________ AHKL, COM_L,Webpage Controls,Donate to AHK |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 2428
|
Posted: Thu Nov 19, 2009 12:06 am Post subject: |
|
|
Why did you go with this for conversion?
I believe the manual recommends this:
Have you tried that already? _________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 722 Location: Iowa, USA
|
Posted: Thu Nov 19, 2009 12:13 am Post subject: |
|
|
| sinkfaze wrote: | | Why did you go with this for conversion? | Found it in a post on converting dec --> hex.
| sinkfaze wrote: | | Have you tried that already? |
Just did, and it works . Thanks sinkfaze. _________________ AHKL, COM_L,Webpage Controls,Donate to AHK |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2141
|
Posted: Thu Nov 19, 2009 12:30 am Post subject: |
|
|
It's essentially difference between:
| Code: | hwnd := "10617752"
; or
hwnd := 10617752 |
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|