Call plugin for Skype for Business - user-interface

I am trying to:
Use a program written in Visual C++ as a plugin in Skype for Business
or
Make the program window follow (attach itself to) the bottom of the Skype for Business user interface, using some type of tracker.
Any advice, or help on where to start?
I found the below links which would use Windows scripting tools such as AutoIt or AutoHotkey. I am not sure if this is the right approach.
https://www.reddit.com/r/AutoHotkey/comments/3ck7ak/tie_a_gui_to_a_window_ideas/
https://www.autoitscript.com/forum/topic/120474-attaching-a-gui-to-another-window/
If it is the correct approach, then, where do I start? If it is not the correct approach, what else can I do?
This question might seem as a duplicate to this link. Yet, the question was discarded.

This AutoHotkey script allows you to attach a notepad window to an explorer window:
#Persistent
SetTimer, attach_window, 200
Return
attach_window:
IfWinNotExist ahk_class CabinetWClass ; explorer
return ; do nothing
IfWinNotExist ahk_class Notepad
return
; otherwise:
; retrieve the position and size of the explorer window:
WinGetPos, X, Y, Width, Height, ahk_class CabinetWClass
; attach the notepad window to the right side of the explorer window:
WinMove, ahk_class Notepad,, X+Width, Y
; To make the notepad window attach itself to the bottom of the explorer window use:
; WinMove, ahk_class Notepad,, X, Y+Height
Return
https://autohotkey.com/docs/commands/SetTimer.htm
https://autohotkey.com/docs/commands/WinGetPos.htm
https://autohotkey.com/docs/commands/WinMove.htm
Use the included Window Spy utility to get various information about the windows you want use.

Related

How can I run and close an exe file with a mouse key?

I have an exe file and I want to run it and close it by pressing a mouse button or a keyboard button. For eg. say it is a music.exe and I want to open it while I am gaming/doing spread sheet by pressing the key 'm' or mouse button.
I have access to a logitech macro supported mouse. Also a no macro generic microsoft mouse. I am thinking about some kind of macro , or tasker or some script that can do this easily. ( not that I dont want to directly click the exe file or close the exe file by clicking x on the window)
Any suggestion would be helpful ;)
I did it with AutoHotKey software. If anyone is interested , here is the code
XButton2:: if WinExist("WindowName") WinClose ; else Run *runas "%directory%\Music.exe" return
This code will run and close the Music app with admin previlages. ( Change "Run *runas" to "run" if you want it to run normally)

Is it possible to create a Hotkey for Context Menu items that use Context Menu Handlers?

I have a shell extension that allows me to save/restore desktop icon locations. Its commands run completely from the Desktop Context Menu. I would like to add a hotkey to these items within the context menu.
I'm not a programmer by any means, but I can follow instructions. I poked around a bunch and it looks like there are registry keys and ways to edit the Accelerator Keys, but that still requires opening the context menu.
I have AutoHotkey set up to use my hotkey to open the context menu and select the option if I'm on the desktop and that's been a fine workaround, but I'd still like to know for the future if it's possible to do without a script .
$^r::
If (IsDeskTopActive()) {
WinActivate, Program Manager ahk_class Progman
Send, {AppsKey}{d}
}
Else
SendInput {^r}
Return
IsDesktopActive() { ; Modified by errorseven - orignal by HotKeyIt
MouseGetPos,,,win
WinGetClass, class, ahk_id %win%
If class in Progman,WorkerW
Return True
Return False
}
Code is working as intended. Just looking for a better solution.

Open-save dialog automatically opens the folder which is currently opened in Windows Explorer

I want to realize a program which works in this way:
I have a folder opened in Windows Explorer. I'm working in a program and I want to save my work. I open the Open/save dialog and I'd like to have a shortcut to automatically jump to the folder which is currently opened in Windows Explorer.
I think AutoHotKey should do the trick but I don't know how to go on.
Perhaps the best solution is:
set a shortcut to save the currently active folder in Windows Explorer
set another shortcut which make the currently opened open-save dialog jump to the saved directory.
Is it possible to realize that in AHK? How to do it?
Example (using a new notepad document):
#IfWinActive ahk_class Notepad
F1::
explorer_path := "" ; empty variable
IfWinNotExist ahk_class CabinetWClass ; explorer
return ; do nothing
; otherwise:
; https://autohotkey.com/boards/viewtopic.php?p=28751#p28751
; get the path of the first explorer window:
for window in ComObjCreate("Shell.Application").Windows
{
try explorer_path := window.Document.Folder.Self.Path
break
}
; MsgBox, %explorer_path%
Send, ^s ; save the new document
; wait for the Save As window and activate it
WinWait, Save As ahk_class #32770
WinActivate, Save As ahk_class #32770
WinWaitActive, Save As ahk_class #32770
; open the folder "explorer_path" in Save As
SendInput, %explorer_path%
Sleep, 300
Send, {Enter}
return
#IfWinActive

How do I click a control button with ID using AutoHotkey?

How do I click a control button with ID using AutoHotkey?
I tried Click and ControlClick, but no luck!
ControlClick Button40
Click Button40
You need to give it some information about the window that the control is on. For example, to close the About screen in Notepad on Windows you could use
ControlClick, Button1, About Notepad ahk_class #32770
The format of the command from the docs is
ControlClick [, Control-or-Pos, WinTitle, WinText, WhichButton, ClickCount, Options, ExcludeTitle, ExcludeText]

How to map a global key to refresh?

Winamp has a neat feature. Global keys. That way I can change the playing song even if Winamp GUI doesn't have focus.
I am looking for a similar solution to Firefox or Chrome.
I use Eclipse to code PHP.
It auto SSH's and saves to another machine (testing)
I could use something like XRefresh with a mapped virtual drive but I cant install Samba on the testing machine.
Right now I have to:
CTRL+S (save and auto-update)
ALT+TAB (switch to Firefox GUI)
F5 (refresh current Firefox page)
ALT+TAB (back to Eclipse)
I am looking for something like:
CTRL+S (save and auto-update)
CTRL+X (refresh Firefox - while keeping focus on Eclipse)
I've looked over Firefox Plug-ins but found nothing to my needs. Chrome neither. XRefresh would be a perfect solution but, as said, cant SSH/Samba into the testing machine.
Autohotkey
Let me add my result for the awesome.ahc file:
^s::
SetTitleMatchMode, 2
IfWinExist, Mozilla Firefox
{
WinActivate, Mozilla Firefox
ControlSend, ahk_parent, {F5}, Mozilla Firefox
}
Return
This will switch to firefox and refresh the currently active tab.
As demoncodemonkey greatly suggested you can use Autohotkey. This is my script sample.
^x:: ; listen for a CTRL+x
Send ^s ; sends a CTRL+s save command to Eclipse
Sleep 500 ; sleeps a bit to allow SSH to transfer file
Send !{tab}^r ; alt-tab followed by a browser refresh
Sleep 100 ; firefox, needs just a bit to allow ALT-TAB
Send !{tab} ; tabs back to eclipse
This is even better than I had in mind as I can do it all with only a single command. Very impressive. Thanks again demoncodemonkey.
Using Frankie's answer, I developed something a bit more advanced. My editor is Aptana, but you can easily change it into anything else:
$^s:: ; only capture actual keystrokes
SetTitleMatchMode, 2 ; match anywhere in the title
IfWinActive, Aptana Studio 3 ; find aptana
{
Send ^s ; send save command
IfWinExist, Mozilla Firefox ; find firefox
{
WinActivate ; use the window found above
Sleep 500 ; sleeps to allow SSH to transfer file
Send ^r ; send browser refresh
WinActivate, Aptana Studio 3 ; get back to Aptana
}
}
else
{
Send ^s ; send save command
}
return

Resources