Inverse WindowID()

Just starting out? Need help? Post your questions and find answers here.
User avatar
Zizaco
User
User
Posts: 26
Joined: Tue May 16, 2006 8:20 pm
Contact:

Inverse WindowID()

Post by Zizaco »

There is to do the inverse of WindowID()?
To find the #Window from the Handle?

Please help.
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Post by milan1612 »

Interesting question! Fred? Freeeeeeed... :D
Windows 7 & PureBasic 4.4
Heathen
Enthusiast
Enthusiast
Posts: 498
Joined: Tue Sep 27, 2005 6:54 pm
Location: At my pc coding..

Post by Heathen »

I really don't think it's possible without keeping track of it yourself.. Although, I could be wrong.. ;)
Last edited by Heathen on Fri Jul 06, 2007 5:33 pm, edited 1 time in total.
I love Purebasic.
User avatar
hallodri
Enthusiast
Enthusiast
Posts: 208
Joined: Tue Nov 08, 2005 7:59 am
Location: Germany
Contact:

Post by hallodri »

For Window try this :

Code: Select all

debug GetProp_(hWnd,"PB_WindowID") -1
For Gadget :

Code: Select all

debug GetProp_(hWnd,"PB_ID")
;or 
debug GetDlgCtrlID_(hWnd)
codemaniac
Enthusiast
Enthusiast
Posts: 289
Joined: Mon Apr 02, 2007 7:22 am
Location: Finland

Post by codemaniac »

Not possible.

The hWnd (WindowID) is a WinAPI and OS exclusive handle, while the #Window in PureBasic is exclusive to PureBasic. If it would be possible to get the PureBasic #Window from a hWnd, that would mean all applications including non-PureBasic applications would have a #Window, but that is ofcourse impossible, because the hWnd's weren't created by PureBasic and so it can't get exclusive access to them.
Cute?
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Post by milan1612 »

Code: Select all

GetProp_(hWnd,"PB_WindowID") -1
works here for a normal window 8)
Windows 7 & PureBasic 4.4
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

Wtf? That's it? A simple window property? Jesus, there should really be some kind of documentation for all these internal PB tricks.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
User avatar
Zizaco
User
User
Posts: 26
Joined: Tue May 16, 2006 8:20 pm
Contact:

Post by Zizaco »

hallodri wrote:For Window try this :

Code: Select all

debug GetProp_(hWnd,"PB_WindowID") -1
For Gadget :

Code: Select all

debug GetProp_(hWnd,"PB_ID")
;or 
debug GetDlgCtrlID_(hWnd)
WOrked! Thanks! :D
Post Reply