GUI for searching selected text or last copied text

Post your working scripts, libraries and tools for AHK v1.1 and older
MedBooster
Posts: 55
Joined: 24 Nov 2022, 12:33

GUI for searching selected text or last copied text

15 Oct 2023, 06:36

You can change this as you'd like, I removed the UpToDate and Dynamed links – as they were custom links. Feel free to change them to whatever, e.g. Wikipedia.

This script is based on the one I shared here:
viewtopic.php?f=6&t=93891&p=494126#p494126
↑ This one does not permanently store the selected text in the clipboard, as opposed to the GUI one I am posting here – because the GUI opening is deselecting the selected text. There might still be a way to make it delete the selected text from the clipboard after it is searched with a GUI like this, that I wasn't able to figure out.

Code: Select all

#NoEnv
#Warn
SendMode Input
SetWorkingDir %A_ScriptDir%

; Hotkey to activate the search engine selection GUI (Win+Ctrl+Shift+W)
^+#W::
    Send, ^c
    Sleep, 200 ; Wait for clipboard to capture the selected text
    Gui, Add, Text, , Select a Search Engine:
    Gui, Add, Button, x10 y30 w100 h30, Google
    Gui, Add, Button, x120 y30 w100 h30, DuckDuckGo
    Gui, Add, Button, x10 y70 w100 h30, Yandex
    Gui, Add, Button, x120 y70 w100 h30, Bing
    Gui, Add, Button, x10 y110 w200 h30, UpToDate
    Gui, Add, Button, x10 y150 w200 h30, DynaMed
    Gui, Add, Button, x10 y190 w200 h30, Amboss
    Gui, Add, Button, x10 y230 w200 h30, Swisscows
    Gui, Show, w230 h260, SelectSearchEngine
Return

; Buttons to select the search engine
ButtonGoogle:
    searchOrVisitFromClip("https://www.google.com/search?q=")
    Gui, Destroy
Return

ButtonDuckDuckGo:
    searchOrVisitFromClip("https://duckduckgo.com/?q=")
    Gui, Destroy
Return

ButtonYandex:
    searchOrVisitFromClip("https://www.yandex.com/search/?text=")
    Gui, Destroy
Return

ButtonBing:
    searchOrVisitFromClip("https://www.bing.com/search?q=")
    Gui, Destroy
Return

ButtonUpToDate:
    searchOrVisitFromClip("https://www-uptodate-com/contents/search?search=")
    Gui, Destroy
Return

ButtonDynaMed:
    searchOrVisitFromClip("https://www-dynamed/results?q=")
    Gui, Destroy
Return

ButtonAmboss:
    searchOrVisitFromClip("https://next.amboss.com/us/search?q=")
    Gui, Destroy
Return

ButtonSwisscows:
    searchOrVisitFromClip("https://swisscows.com/en/web?query=")
    Gui, Destroy
Return

searchOrVisitFromClip(searchUrl){
    clip := clipboardAll
    clip := ""
    ClipWait, 0.9
    if(ErrorLevel){
    } else if (clipboard ~= "^https?:\/\/") {
        run, % clipboard
    } else {
        run, % searchUrl clipboard
    }
}

MedBooster
Posts: 55
Joined: 24 Nov 2022, 12:33

Re: GUI for searching selected text or last copied text

20 Nov 2023, 06:32

This new version centers the GUI to the display in which the cursor currently is positioned.
You can also press Escape to close the window.
There is also a toggle to keep the window open.

Code: Select all

;GUI search pro 2 by MedBooster
;reference https://www.autohotkey.com/boards/viewtopic.php?f=6&t=122359&p=543307#p543307

#NoEnv
#Warn
SendMode Input
SetWorkingDir %A_ScriptDir%

;this needs to be outside the Gui code
Return
GuiEscape: 
Gui, Cancel 
return



; Hotkey to activate the search engine selection GUI (Win+Ctrl+Shift+W)
^+#W::
!#W::
    Send, ^c
	Gui_Title := "Web search tool" ;you can rename this 
    Gui, Destroy
    Sleep, 200 ; Wait for clipboard to capture the selected text
    Gui, Add, Text, , Select a Search Engine:
    Gui, Add, Button, x10 y30 w150 h30, Google
    Gui, Add, Button, x170 y30 w150 h30, DuckDuckGo
    Gui, Add, Button, x10 y70 w150 h30, Yandex
    Gui, Add, Button, x170 y70 w150 h30, Bing
    Gui, Add, Button, x10 y110 w150 h30, Yahoo
    Gui, Add, Button, x170 y110 w150 h30, Swisscows

    Gui, Add, Text, x10 y150, Select database:
    Gui, Add, Button, x10 y170 w150 h30, UpToDate
    Gui, Add, Button, x170 y170 w150 h30, DynaMed
    Gui, Add, Button, x10 y210 w150 h30, Amboss
    Gui, Add, Button, x170 y210 w150 h30, ClinicalKey
    Gui, Add, Button, x10 y250 w150 h30, PubMed
    Gui, Add, Button, x170 y250 w150 h30, ScienceDirect

    ; Add buttons for YouTube and MerckManuals
    Gui, Add, Button, x10 y290 w150 h30, YouTube
    Gui, Add, Button, x170 y290 w150 h30, MerckManuals

    Gui, Add, Button, x10 y330 w300 h30, ChangeDefaultBrowser

    Gui, Add, Text, x10 y370, Search text: ; title
    Gui, Add, Edit, x10 y390 w300 h30 vUserInput ; textbox
	GuiControl, Focus, UserInput
	

	
	Gui, Add, Checkbox, x10 y430 vCloseGUIpostsearchChecked Checked, Close GUI after search if checked
	

	
	Gui,+AlwaysOnTop


;---------GET CENTER OF CURRENT MONITOR---------
	;get current monitor index
	CurrentMonitorIndex:=GetCurrentMonitorIndex()
	;get Hwnd of current GUI
	DetectHiddenWindows On
	Gui, +LastFound
	Gui, Show, Hide
	GUI_Hwnd := WinExist()
	;Calculate size of GUI
	GetClientSize(GUI_Hwnd,GUI_Width,GUI_Height)
	DetectHiddenWindows Off
	;Calculate where the GUI should be positioned
	GUI_X:=CoordXCenterScreen(GUI_Width,CurrentMonitorIndex)
	GUI_Y:=CoordYCenterScreen(GUI_Height,CurrentMonitorIndex)
;------- / GET CENTER OF CURRENT MONITOR--------- 
	;SHOW GUI AT CENTER OF CURRENT SCREEN
	Gui, Show, % "x" GUI_X " y" GUI_Y, %Gui_Title% ;title of window
	




	Return




; Buttons to select the search engine

ButtonYahoo:
	Gui, Submit, NoHide ; necessary for checkboxes
    searchOrVisitFromClip("https://search.yahoo.com/search;_ylt=AwrNag_OGT5ljbgnQQdDDWVH;_ylc=X1MDMTE5NzgwNDg2NwRfcgMyBGZyAwRmcjIDcDpzLHY6c2ZwLG06c2ItdG9wBGdwcmlkA1V4T2ZWazdKUTJTZVkwZmYzZ0dYQUEEbl9yc2x0AzAEbl9zdWdnAzEwBG9yaWdpbgNzZWFyY2gueWFob28uY29tBHBvcwMwBHBxc3RyAwRwcXN0cmwDMARxc3RybAM0BHF1ZXJ5A3Rlc3QEdF9zdG1wAzE2OTg1Njg2NTY-?p=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonGoogle:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://www.google.com/search?q=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonDuckDuckGo:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://duckduckgo.com/?q=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonYandex:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://www.yandex.com/search/?text=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonBing:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://www.bing.com/search?q=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonUpToDate:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://www-uptodate-com/contents/search?search=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonDynaMed:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://www-dynamed-com/results?q=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonAmboss:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://next.amboss.com/us/search?q=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonSwisscows:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://swisscows.com/en/web?query=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonClinicalKey:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://www-clinicalkey-com/#!/search/")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonScienceDirect:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://www-sciencedirect-com/search?pub=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonPubMed:
	Gui, Submit, NoHide
	searchOrVisitFromClip("https://pubmed.ncbi.nlm.nih.gov/?term=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return


ButtonYouTube:
	Gui, Submit, NoHide
	searchOrVisitFromClip("https://www.youtube.com/results?search_query=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonMerckManuals:
	Gui, Submit, NoHide
	searchOrVisitFromClip("https://www.merckmanuals.com/professional/SearchResults?query=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return



searchOrVisitFromClip(searchUrl) { ;for clipboard → button , or input (textbox) → button
    GuiControlGet, UserInput, , UserInput ; Get the value from the UserInput GUI control

	;check if textbox contains text
	if (UserInput != "") {
	Clipboard := UserInput
    run, % searchUrl clipboard
	}
	
	;check if textbox is empty 
	 if (UserInput = "") {
	
    if (clipboard ~= "^https?://") {
        run, % clipboard
    } else {
        run, % searchUrl clipboard
    }
	}
	Return
}


;reference https://stackoverflow.com/questions/32354861/how-to-find-the-default-browser-via-the-registry-on-windows-10

; Set the default browser using the Windows AssocQueryString method
SetDefaultBrowser(browserName) {
    RegRead, browserPath, HKLM, SOFTWARE\Classes\http\shell\open\command
    RegWrite, REG_SZ, HKCU, Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice, ProgId, %browserName%
   
    WinClose Settings
}


ButtonChangeDefaultBrowser:
    SetDefaultBrowser("Brave")
    TrayTip, Notification, Default browser pop-up will appear at search, 10
Return



;standard search script other 
;Some improvements with the help of andreas@ESA:~$ sudo -i
#+w::searchOrVisitFromClipSimple("https://www.google.com/search?q=")
#w::searchOrVisitFromClipSimple("https://duckduckgo.com/?q=")

searchOrVisitFromClipSimple(searchUrl){
    clip := clipboardAll
    clip := ""
    send, ^c
    ClipWait, 0.5
    if(ErrorLevel){
    } else if (clipboard ~= "^https?:\/\/") {   ; if clipboard content is an http or https protocol url
        run, % clipboard
    } else { ;search using the provided url
        run, % searchUrl clipboard
    }
    clipboard := clip ;put the last copied thing back in the clipboard
}




;reference https://www.autohotkey.com/boards/viewtopic.php?t=31716
GetCurrentMonitorIndex(){
	CoordMode, Mouse, Screen
	MouseGetPos, mx, my
	SysGet, monitorsCount, 80

	Loop %monitorsCount%{
		SysGet, monitor, Monitor, %A_Index%
		if (monitorLeft <= mx && mx <= monitorRight && monitorTop <= my && my <= monitorBottom){
			Return A_Index
			}
		}
		Return 1
}

CoordXCenterScreen(WidthOfGUI,ScreenNumber)
{
SysGet, Mon1, Monitor, %ScreenNumber%
	return (( Mon1Right-Mon1Left - WidthOfGUI ) / 2) + Mon1Left
}

CoordYCenterScreen(HeightofGUI,ScreenNumber){
	SysGet, Mon1, Monitor, %ScreenNumber%
	return ((Mon1Bottom-Mon1Top - 30 - HeightofGUI ) / 2) + Mon1Top
}

GetClientSize(hwnd, ByRef w, ByRef h)
{
    VarSetCapacity(rc, 16)
    DllCall("GetClientRect", "uint", hwnd, "uint", &rc)
    w := NumGet(rc, 8, "int")
    h := NumGet(rc, 12, "int")
}
MedBooster
Posts: 55
Joined: 24 Nov 2022, 12:33

Re: GUI for searching selected text or last copied text

15 Mar 2024, 03:28

viewtopic.php?f=6&t=122691&p=563219#p563219

sadly regedit does not prompt the "how do you want to open" window anymore ...
RegRead, browserPath, HKLM, SOFTWARE\Classes\http\shell\open\command
RegWrite, REG_SZ, HKCU, Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice, ProgId, %browserName%
RegWrite, REG_SZ, HKCU, Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice, ProgId, %browserName%



Code: Select all

;GUI search pro 2 by MedBooster
;reference https://www.autohotkey.com/boards/viewtopic.php?f=6&t=122359&p=543307#p543307

#NoEnv
#Warn
SendMode Input
SetWorkingDir %A_ScriptDir%

;this needs to be outside the Gui code
Return
GuiEscape: 
Gui, Cancel 
return



; Hotkey to activate the search engine selection GUI (Win+Ctrl+Shift+W)

!#W::
    Send, ^c
	Gui_Title := "Web search tool" ;you can rename this 
    Gui, Destroy
    Sleep, 200 ; Wait for clipboard to capture the selected text
    Gui, Add, Text, , Select a Search Engine:
    Gui, Add, Button, x10 y30 w150 h30, Google
    Gui, Add, Button, x170 y30 w150 h30, DuckDuckGo
    Gui, Add, Button, x10 y70 w150 h30, Yandex
    Gui, Add, Button, x170 y70 w150 h30, Bing
    Gui, Add, Button, x10 y110 w150 h30, Yahoo
    Gui, Add, Button, x170 y110 w150 h30, Swisscows

    Gui, Add, Text, x10 y150, Select database:
    Gui, Add, Button, x10 y170 w150 h30, UpToDate
    Gui, Add, Button, x170 y170 w150 h30, DynaMed
    Gui, Add, Button, x10 y210 w150 h30, Amboss
    Gui, Add, Button, x170 y210 w150 h30, ClinicalKey
    Gui, Add, Button, x10 y250 w150 h30, PubMed
    Gui, Add, Button, x170 y250 w150 h30, MSDManuals

    ; Add buttons for YouTube and MerckManuals
    Gui, Add, Button, x10 y290 w150 h30, YouTube
    Gui, Add, Button, x170 y290 w150 h30, DailyMed

    Gui, Add, Button, x10 y330 w310 h30, ChangeDefaultBrowser

    Gui, Add, Text, x10 y370, Search text: ; title
	
	
	    Gui, Add, Text, x10 y370, Search text: ; title
	Gui, Add, Text, , UserInput ;referring to the line below
	Gui, Font, S16 c0078D7, UserInput 
    Gui, Add, Edit, x10 y390 w310 h30 vUserInput ;textbox
	GuiControl, Focus, UserInput ;focus = input field active right away


	Gui, Add, Text, CloseGUIpostsearchChecked ;referring to the line below
	Gui, Font, S9 cBlack, CloseGUIpostsearchChecked
	Gui, Add, Checkbox, x10 y430 vCloseGUIpostsearchChecked Checked, Close GUI after search if checked

	Gui,+AlwaysOnTop


Gui, Add, Button, x240 y430 w80 h18 gClearInput, Clear
GuiControl, +g, UserInput ; Assign the default handler for the GUI




;Gui, Font, S9, Lucida Console

	




;---------GET CENTER OF CURRENT MONITOR---------
	;get current monitor index
	CurrentMonitorIndex:=GetCurrentMonitorIndex()
	;get Hwnd of current GUI
	DetectHiddenWindows On
	Gui, +LastFound
	Gui, Show, Hide
	GUI_Hwnd := WinExist()
	;Calculate size of GUI
	GetClientSize(GUI_Hwnd,GUI_Width,GUI_Height)
	DetectHiddenWindows Off
	;Calculate where the GUI should be positioned
	GUI_X:=CoordXCenterScreen(GUI_Width,CurrentMonitorIndex)
	GUI_Y:=CoordYCenterScreen(GUI_Height,CurrentMonitorIndex)
;------- / GET CENTER OF CURRENT MONITOR--------- 
	;SHOW GUI AT CENTER OF CURRENT SCREEN
	Gui, Show, % "x" GUI_X " y" GUI_Y, %Gui_Title% ;title of window
	




	Return

;place this outside of the GUI code
ClearInput:
    GuiControl,, UserInput, ; Clear the UserInput field
	GuiControl, Focus, UserInput ; Set focus on the UserInput field after clearing
Return


; Buttons to select the search engine

ButtonYahoo:
	Gui, Submit, NoHide ; necessary for checkboxes
    searchOrVisitFromClip("https://search.yahoo.com/search;_ylt=AwrNag_OGT5ljbgnQQdDDWVH;_ylc=X1MDMTE5NzgwNDg2NwRfcgMyBGZyAwRmcjIDcDpzLHY6c2ZwLG06c2ItdG9wBGdwcmlkA1V4T2ZWazdKUTJTZVkwZmYzZ0dYQUEEbl9yc2x0AzAEbl9zdWdnAzEwBG9yaWdpbgNzZWFyY2gueWFob28uY29tBHBvcwMwBHBxc3RyAwRwcXN0cmwDMARxc3RybAM0BHF1ZXJ5A3Rlc3QEdF9zdG1wAzE2OTg1Njg2NTY-?p=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonGoogle:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://www.google.com/search?q=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonDuckDuckGo:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://duckduckgo.com/?q=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonYandex:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://www.yandex.com/search/?text=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonBing:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://www.bing.com/search?q=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonUpToDate:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://www-uptodate-com/contents/search?search=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonDynaMed:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://www-dynamed-com/results?q=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonAmboss:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://next.amboss.com/us/search?q=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonSwisscows:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://swisscows.com/en/web?query=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonClinicalKey:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://www-clinicalkey-com/#!/search/")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonMSDManuals:
	Gui, Submit, NoHide
    searchOrVisitFromClip("https://www.msdmanuals.com/professional/SearchResults?query=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonPubMed:
	Gui, Submit, NoHide
	searchOrVisitFromClip("https://pubmed.ncbi.nlm.nih.gov/?term=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return


ButtonYouTube:
	Gui, Submit, NoHide
	searchOrVisitFromClip("https://www.youtube.com/results?search_query=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return

ButtonDailyMed:
	Gui, Submit, NoHide
	searchOrVisitFromClip("https://dailymed.nlm.nih.gov/dailymed/search.cfm?labeltype=all&query=")
    if (CloseGUIpostsearchChecked = 1) {
	Gui,Destroy
	}
Return



searchOrVisitFromClip(searchUrl) { ;for clipboard → button , or input (textbox) → button
    GuiControlGet, UserInput, , UserInput ; Get the value from the UserInput GUI control

	;check if textbox contains text
	if (UserInput != "") {
	Clipboard := UserInput
    run, % searchUrl clipboard
	}
	
	;check if textbox is empty 
	 if (UserInput = "") {
	
    if (clipboard ~= "^https?://") {
        run, % clipboard
    } else {
        run, % searchUrl clipboard
    }
	}
	Return
}






;reference https://stackoverflow.com/questions/32354861/how-to-find-the-default-browser-via-the-registry-on-windows-10
;reference https://www.autohotkey.com/boards/viewtopic.php?t=5015




ButtonChangeDefaultBrowser:

	Run ms-settings:defaultapps
Sleep 1500
Send {Tab 5}{Enter} ;Highlight Default Browser + Select
Sleep 1000
Send {Tab 2} ;Highlight Chrome + Select


    TrayTip, Notification, Choose default browser in settings, 10
Return





;standard search script other 
;Some improvements with the help of andreas@ESA:~$ sudo -i
#+w::searchOrVisitFromClipSimple("https://www.google.com/search?q=")
#w::searchOrVisitFromClipSimple("https://duckduckgo.com/?q=")

searchOrVisitFromClipSimple(searchUrl){
    clip := clipboardAll
    clip := ""
    send, ^c
    ClipWait, 0.5
    if(ErrorLevel){
    } else if (clipboard ~= "^https?:\/\/") {   ; if clipboard content is an http or https protocol url
        run, % clipboard
    } else { ;search using the provided url
        run, % searchUrl clipboard
    }
    clipboard := clip ;put the last copied thing back in the clipboard
}




;reference https://www.autohotkey.com/boards/viewtopic.php?t=31716
GetCurrentMonitorIndex(){
	CoordMode, Mouse, Screen
	MouseGetPos, mx, my
	SysGet, monitorsCount, 80

	Loop %monitorsCount%{
		SysGet, monitor, Monitor, %A_Index%
		if (monitorLeft <= mx && mx <= monitorRight && monitorTop <= my && my <= monitorBottom){
			Return A_Index
			}
		}
		Return 1
}

CoordXCenterScreen(WidthOfGUI,ScreenNumber)
{
SysGet, Mon1, Monitor, %ScreenNumber%
	return (( Mon1Right-Mon1Left - WidthOfGUI ) / 2) + Mon1Left
}

CoordYCenterScreen(HeightofGUI,ScreenNumber){
	SysGet, Mon1, Monitor, %ScreenNumber%
	return ((Mon1Bottom-Mon1Top - 30 - HeightofGUI ) / 2) + Mon1Top
}

GetClientSize(hwnd, ByRef w, ByRef h)
{
    VarSetCapacity(rc, 16)
    DllCall("GetClientRect", "uint", hwnd, "uint", &rc)
    w := NumGet(rc, 8, "int")
    h := NumGet(rc, 12, "int")
}

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 88 guests