Questions tagged [setwindowpos]

19 questions
5
votes
2 answers

GLFW Mouse event lag with window drag

I am trying to drag an undecorated window in GLFW but am encountering some event lag, even though I am using glfwWaitEvents() I have a cursor position callback, and a simple loop: // register a cursor position callback glfwSetCursorPosCallback(win,…
2
votes
1 answer

SetWindowPos not setting Z order properly

I am working on a window manager. Here is some code to stack windows diagonally: void stack_windows_diagonal(HWND* windows, int width, int height){ if(windows == NULL) return; int size = 0; for(;windows[size]; size++); RECT…
Andreas Sandberg
  • 241
  • 1
  • 3
  • 10
2
votes
0 answers

Issue with monitor numbers when docking laptop to multiple monitors

I developed an application that I can assign programs to specific monitors so that when I dock my laptop, which results in all my open windows being pushed to my main monitor, I can press a global hotkey, Alt+d, and all the applications that have…
Jordanr
  • 21
  • 4
1
vote
0 answers

Windows restore position sometimes doesn't work

I wrote a simple C# program that saves the locations and sizes of open windows to a file, and then can also restore them from that file (based on command-line arguments). This always works for some programs and not for others, and I don't know…
radumanolescu
  • 4,059
  • 2
  • 31
  • 44
1
vote
1 answer

Create a WordPad instance and bring it to the top z-order, all from a non-foreground app

I am working with voice-operated software (Dragon from Nuance, or maybe Windows Speech Recognition (haven't tried that yet)). In operation, the user (me) issues a voice command to make something happen. For this question, I am trying to write code…
Kevin
  • 1,548
  • 2
  • 19
  • 34
1
vote
0 answers

SetWindowPos with different scaling monitors sets position to a wrong location

I have 2 monitors with different resolution and scaling: 2560 * 1440 scaling x1 (Primary) 1920 * 1200 scaling x1.5 (to the left from primary [2][1] aligned to top) My application is changing position of another app window. The window I try to set…
htonus
  • 629
  • 1
  • 9
  • 19
1
vote
1 answer

WinAPI CreateWindow WS_POPUP resize flickering

I'm creating a window with no borders (WS_POPUP in CreateWindow) and need to resize it when mouse is over and change back when mouse is out of the application. It works OK, but it flickers when I change the position using SetWindowPos. I need to…
Andrei
  • 367
  • 5
  • 18
1
vote
0 answers

SetWindowPos not moving or resizing window

When I call SWP to try and move a resize a specific window. It does not move or resize. SetWindowPos(hWndWindow, NULL, 0, 0, 500, 500, SWP_NOZORDER); The window handle is valid. I tried both getting the handle with FindWindow and by manually…
John
  • 5,942
  • 3
  • 42
  • 79
0
votes
1 answer

WinAPI SetWindowPos not working for simple apps like notepad and calc

I develop on Windows 10. I want to move and resize an external application. I tried to make it work first with notepad and calculator. But, whatever I do the notepad/cal do not move or resize. I tried using SetWindowPos, UpdateWindow and MoveWindow…
theateist
  • 13,879
  • 17
  • 69
  • 109
0
votes
0 answers

MS Access, Compile error: Type mismatch, SetWindowPos

Currently 5 users of this database. Database works fine for everyone, except one user who received a new laptop. User with new laptop receives error message: Compile error: Type mismatch, for variable h. Code: '==================================== '…
0
votes
1 answer

Question about set window full screen with SetWindowPos

In my app, I want to keep my window full screen. So I added resizing window function when received WM_DISPLAYCHANGE event. In the resizing window function, I use EnumDisplayMonitors to get current size of monitor, the size is correct. Then I use…
chenxu
  • 71
  • 6
0
votes
1 answer

Windows desktop coordinate system is off for certain windows

I've run into an issue when developing some software for windows, an issue related around moving windows on the screen. Basically, I've found that specific windows will consitantly not follow the coordinate system. I have a function that takes a…
Jordan J
  • 28
  • 3
0
votes
0 answers

How to move a non-Visible Application

This is a follow up question to one of the answers provided for post Quit() causes Access to become visible for a moment. The answer recommends that I move the window off screen so that the flickering window can't be seen. If I understand the…
Mandelbrotter
  • 2,216
  • 2
  • 11
  • 28
0
votes
0 answers

Clicking anywhere will maximize a window that I just hide with setwindowpos()

So, I'm using this for a game that starts as fullscreen. I first do this to make it window mode: SetWindowLongPtr(pantalla, GWL_STYLE, WS_CAPTION | WS_VISIBLE | WS_CLIPSIBLINGS | WS_SYSMENU); SetWindowLongPtr(pantalla, GWL_EXSTYLE,…
user1913644
  • 157
  • 1
  • 11
0
votes
1 answer

SetWindowPos even when the main thread is blocked?

I'm trying to make my program move itself via a call to SetWindowPos every 10 milliseconds, to follow the cursor. Problem is, when my program's main thread is blocked by a Thread.Sleep(), the window stops moving. I put the call to SetWindowPos into…
NERL
  • 292
  • 4
  • 16
1
2