Jump to content
Sign in to follow this  
manit

get window handle

Recommended Posts

hi ,

I came across this interesting utility 'autoit v3 window information'

using that finder tool i can see window handle in 'window tab' & cursor position in 'mouse tab'

I also saw this script

HotKeySet("z","jPos")
While 1
    Sleep(100)
WEnd
Func jPos()
$jPos = MouseGetPos()
MsgBox(0, "Details", $jPos[0] & "," & $jPos[1])
EndFunc

which shows mouse position on pressing 'z'

I also read documentation on msgbox,winlist,wingethandle,guicreate.

I want to add active window handle info to that messagebox.

Share this post


Link to post
Share on other sites

<h3 class="row2">

<span class="author vcard"></span>thanks JohnOne.</h3>

<p>So when I add 'MsgBox(0,0,WinGetHandle(&quot;[ACTIVE]&quot;))' in jPos function then I get two message boxes one showing mouse coordinate while other gives window handle.</p>

<p>How can I get both in same messagebox ?</p>

Share this post


Link to post
Share on other sites

I see that putting

&

between variables does not add any text in message box content .

but

& ","

will insert character ,

Share this post


Link to post
Share on other sites

i read http://www.autoitscript.com/autoit3/docs/functions/WinSetState.htm

is this correct

$var=WinGetHandle("[ACTIVE]")

WinSetState ( $var , "text", @SW_HIDE )

Share this post


Link to post
Share on other sites

i have this idea of creating a script which will show handles of all windows on taskbar & we can hide any by just pressing button in messagebox. Also once we hide a window then it no longer appears on taskbar yet messagebox should show its handle so we can unhide it i.e toggle.

Share this post


Link to post
Share on other sites

if anyone is interested then here is code to hide active window & show mouse position,handle on pressing 'z'

HotKeySet("z","jPos")
While 1
    Sleep(100)
WEnd
Func jPos()
$jPos = MouseGetPos()
$var=WinGetHandle("[ACTIVE]")
WinSetState ( $var , "text", @SW_HIDE )
MsgBox(0, "Details", $jPos[0] & "," & $jPos[1] & "," & "," & $var)
EndFunc

Share this post


Link to post
Share on other sites

as mentioned earlier

I have this idea of showing a messagebox that contains rows of handles of all windows on taskbar & a toggle button associated with each handle that hides or unhides corresponding window.

There should be a refresh button which adds new handle if a window has been opened lately & remove those handles which do not exist.

i need functions to dynamically add/delete button to messagebox , associate action with those buttons

Share this post


Link to post
Share on other sites

manit,

any ideas

Many ideas, but until you at least make an attempt to do it yourself you will not get a lot of help from anyone here. ;)

To give you little encouragement, I would suggest using a ListView with the $LVS_EX_CHECKBOXES extended style rather than using buttons - you can keep the GUI the same size that way. :graduated:

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Melba23 , I saw the doc of creating listview . Also I could add check button for each row. Now I have to translate the log of cmdow in a format 'windowhandle||level|PID|window status|application|title' for each line.

My aim is to create GUI for cmdow.

This will be exciting .

Also what function can I use to create table taking line by line input from file ?

And how can I set an action to be executed if a check box is toggled ?

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...