How to set a window title for an instance of SQL * Plus (Windows)?

I have several databases that I connect to use SQL * Plus on Windows (and not on the command window).

I was looking for a way to change the name of the window so that I could distinguish one instance from another, from the taskbar. Yes, I know that I can change the invitation, but then I need to switch between instances and read the invitation until I get back to the correct one.

Is it possible? And if so, how?

+3
source share
3 answers
[DllImport("user32.dll", SetLastError =true, CharSet =CharSet.Auto)]
static extern IntPtr SetWindowText(IntPtr hwnd, String lpString);

Process process = new Process();
process.StartInfo.FileName = "sqlplusw";
process.Start();
process.WaitForInputIdle();
SetWindowText(process.MainWindowHandle, "PRODUCTION - BE CAREFUL!!");

I was able to put together a wrapper that does what I want. Now, to make it more general .....

+1
source

sqlplus.exe, , glogin.sql( sqlplus Oracle) sqlplus .

HOST sqlplus :

HOST title [my db name]

glogin.sql( ).

sqlplusw, "", , , .

+1

, ( ) .

WindowWatch. Google.

SQL * Plus, , .

0

Source: https://habr.com/ru/post/1711818/


All Articles