AutoHotkey Community

It is currently May 26th, 2012, 11:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: November 19th, 2009, 12:21 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
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%)

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2009, 1:06 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
Why did you go with this for conversion?

Code:
hwnd := hwnd


I believe the manual recommends this:

Code:
hwnd += 0


Have you tried that already?

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2009, 1:13 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
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 :D . Thanks sinkfaze.

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2009, 1:30 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
It's essentially difference between:
Code:
hwnd := "10617752"
; or
hwnd := 10617752


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Leef_me, Maestr0, Pulover, rbrtryn, XstatyK and 56 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group