VBA draw a box on another application - vba

I'm writing an implementation of the windows UI automation client in VBA and that's going pretty well. But I would like to be able to draw a simple box around the UI element of another window. I'm aware of the inspect.exe application, but was wanting to recreate some of its functionality in VBA for instances where company policy restrictions prevent me from installing any 3rd party applications. Code I've written myself can be copy and pasted from a paste bin account.
Is there something in the windows API or a reference I can import that I could use to draw a box on top of another screen at specific coordinates for a second or two? I'm trying to limit this project to just things that come with an out of the box windows installation.

Related

Placement of windows from another app inside of MS Word

My question is how to place a window belonging to our win32 application inside of MS Word, when Word has been set as the parent of that window using Windows API SetParent(HandleOfMyWindow, HandleOfWord).
The background of my question is that we have lots of code built around a system where we have installed a macro in Word that when started from a button on the ribbon sends a message to our app to tell it to create a given window and show it inside of Word. This window can then insert text etc. into Word by using Word as a OLE Automation server. This has worked fine for the most part for many years. It still is, but occasionally the window is displayed far out of the visible area of Word. For example it can be 900 pixels to the right of the right edge of Word. It can often be found by making Word very wide across multiple monitors. The problem is only there on multi monitor systems. It is often affected by how our app and Word is placed on the monitors. It might also be affected by what monitors is set as the main monitor.
Our app is made using Delphi creating standard win32 exe's. The problem might have gotten worse after we started using VCL Styles.
I have tried placing our window using Windows API SetBounds and SetWindowPos, just the top and left properties of the form, and some other things. It just never pops up where I think my code is telling it to. Most of the time it is visible and all is well, but still at another position than I set. I just can figure out any system to where it is placed.
However, when writing this I found something that might be relevant, but still no solution:
https://en.delphipraxis.net/topic/4882-a-big-and-very-strange-bug-with-high-dpi-vcl-style-and-form-constraints/
From SetParent documentation: "Unexpected behavior or errors may occur if hWndNewParent and hWndChild are running in different DPI awareness modes."

How to create a pop-out button in Vue.js?

I am starting to develop a Vue.js based application that is replacing a desktop application. What customer is asking is the option to be able to pop-out different parts of the application (to be able to put it in the another window)
The idea is like in email applications, like GMail.com, you can click on pop-out in the middle of the work and you can continue your work in the new window.
I was wondering if there is an efficient and clean way to do this?

display a popup inside external application

I'm developing an application in which, if I press a combination of keys shows me a popup inside the form of another external application, I mean something like the "windows game menu", but I have no idea how to show the popup in the external application. I leave you an image to make you understand what I mean as a popup. sorry for my english but I do not speak.
Thanks in advance
You cannot control one application form of another application without having access to its code or knowing if a queue messaging command has been set for doing it.
It is possible to program a window of your application to be shown over any other , likely this will not be working over a Directx - OpenGL full-area, i.e. when you are playing a videogame that is using the same functionality because the last one is winning.
In this case your popup will be visible barely as a flick, but considering standard form application you can make it to stand over by working with userd32.dll method
"SetWindowPos" with the flag HWND_TOPMOST.
You will need first to detect the position of the application window, or if it is a fullscreen one you can simply detect the size of the screen and consider to place it in the center, then you can set the position of your application form "pop-up".
Details about the SetWindowPos , which is among windwows base dll but can be invoked from .net here below:
https://learn.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setwindowpos
Make a window topmost using a window handle

How To Implement AutoCAD Color Chooser In External Application

Goal
I want to be able to access AutoCAD's Color chooser from an external application. This means that I will not be using AutoCAD to make the color chooser dialog popup. Instead, I will be using a VB.Net application to manage these colors.
Current Situation
As for now, I have no idea where to start. Do I need to import a specific library to make this work? Is it even possible to do this without AutoCAD running?
.NET has a basic built-in color picker control if you want to drive outside of AutoCAD:
System.Windows.Forms.ColorDialog
You'll likely need a helper class/extension methods for converting ARGB colors to AutoCAD colors. Although may find it better to just roll your own. Use IlSpy, DotPeek, or .NET Reflector to look at how the AutoDesk class gets instanciated/used.

Silverlight - Lync Application nested in a table

I'm very new in Silverlight and the Lync-SDK. So sorry for the question from a beginner.
Long time ago, i wrote al little web application, based on php for reading out contacts from a sql database.
Now the customer expand his envoirement and place Lync. Now he want the little Lync-Status-Square in the webapplication for click to call features.
I playing a little bit with the SDK of lync.
The following problem comes up. The square of Lync is nested in a td of my table. But the Lync-Silverlight-Applet need dynamical space for hover effects or single clicks. But in my table, i have no space, specially dynamic space.
So i switch off all hover and click functionality and place the follwing buttons in the StackPanel separate.
PresenceIndicator
StartInstanceMessagingButton
StartAudiCallButton
SendEmailButton
Two of them are fine.
Clicking on the IM-Button, The Lync Client opens the right Contact in IM-Mode and i can directly type a message. Perfect!
Clicking on the Mail-Icon, an Mail-Client will open, perfect.
The PresenceIndicator just display the color, not the exactly state, thats a problem, when the color is yellow. I can display the state in a TextBlock, but i prefer a label appears while hovering over the icon.
But my mainproblem is the StartAudioCallButton. This Icon is an dropDown-Icon. And i have no space for dropdowns. I would be so nice if this icon has the same behavoior like the IM-Button. The Lync Client will open in Call Modus and i can select, which callernumber i will use. Is that possible?
Thank you for Your time!
Frank
If you're having trouble with the layout of the standard Lync SilverLight controls, then the best thing to do is implement your own SilverLight controls for the function you're having difficulty with.
User Controls are really simple to create, there are plenty of tutorials on how to get started if you're not familiar with the process.
The Lync SDK has some great walkthroughs to get you up and running with signing in to Lync and placing an audio call
I don't know of any way to get Lync to open in a Call Mode as you suggested, but if you're limited with screen space, maybe you could have your custom StartAudioCallButton open a popup with the phone numbers in?