Questions tagged [setforegroundwindow]

40 questions
0
votes
0 answers

How can I bring the word application window is minisized to the front using C#?

I'm developing a addin for office word using vsto. I'm trying to bring the word window that is minisized rebringing it to the front.I try to use winapi function SwitchToThisWindow、SetForegroundWindow, SetWindowPos like this if (handlePtr !=…
asa9891
  • 3
  • 4
0
votes
1 answer

c# Giving focus back to parent form from other app

I'm trying to start and .exe from a child form of my main app, but the issue is that when I open the other .exe and it finish it's work (scan a finger print) and exit, my app gets minimized, so I try this: [DllImport("user32.dll")] [return:…
user2461687
  • 165
  • 1
  • 11
0
votes
1 answer

Activate Window and Send Input using SetForegroundWindow and SendKeys in C#

What I'm trying to do is activate another application and send a key input to it to trigger a button. However this code doesn't seem to work. It looks like it can find the application but it does not activate it, and does not send the key.…
Cistoran
  • 1,557
  • 15
  • 33
  • 54
0
votes
0 answers

First Character of SendInput blocked in application

So I have an application that works with a game. At one stage in the program, it clicks on a text field, enters some text then clicks some other stuff. Now the issue is this, sometimes the first character typed is blocked. That is, if I am typing…
Mo Beigi
  • 1,159
  • 2
  • 22
  • 44
0
votes
0 answers

Using SetForegroundWindow to focus on a window

var hwnd = GetWindowHandle(); //Custom function that returns the target window's handle var currentThreadId = GetCurrentThreadId(); uint pid; var targetThreadId = GetWindowThreadProcessId(hwnd, out pid); if…
Pratik Bhattacharya
  • 3,009
  • 1
  • 21
  • 53
0
votes
0 answers

Get flashing window in delphi (window that needs focus and windows won't set it to front)

I was searching on internet how to enable "auto-switch" or "auto-raise" window that has flashing button on taskbar in Windows 7, and all I can find is how to disable that! I need just opposit, to enable that so i looked at that answers and found…
Gem
  • 506
  • 1
  • 7
  • 19
0
votes
0 answers

What could prevent a window from being displayed in foreground?

What could prevent a dialog from being displayed modally in foreground in some circumstances? A process (KeePass.exe) owns a hidden window. A global shortcut (CTRL+A) displays a dialog in foreground. This is done using the DoModal method. And it…
divB
  • 776
  • 10
  • 23
0
votes
1 answer

SetForegroundWindow is being ignored

I'm writing a little utility to allow me to multiplex input to multiple terminal windows; Any input received by the form (in the centre) is relayed to all terminal windows it manages. This works well but a problem occurs if I another window moves…
Basic
  • 25,223
  • 23
  • 108
  • 188
-1
votes
3 answers

Powershell newcomer

I am a total new comer to powershell so please forgive me if my question sounds stupid. I found the script below from Yuri Posidelov which I tweaked to activate a process and show the window and send keystrokes to shut down the process which works…
-1
votes
2 answers

How fix window on top

I use SetForegroundWindow to set window of other application on the top. How I can fix this window on the top? It means, once some other application calls SetForegroundWindow, my window will be below my fixed window.
1 2
3