Click here to Skip to main content
15,905,967 members
Home / Discussions / C#
   

C#

 
GeneralRe: writing a windows service Pin
#realJSOP17-Jan-10 7:19
professional#realJSOP17-Jan-10 7:19 
GeneralRe: writing a windows service Pin
Ravi Bhavnani17-Jan-10 9:33
professionalRavi Bhavnani17-Jan-10 9:33 
GeneralRe: writing a windows service Pin
#realJSOP17-Jan-10 23:52
professional#realJSOP17-Jan-10 23:52 
AnswerRe: writing a windows service Pin
PIEBALDconsult17-Jan-10 5:17
mvePIEBALDconsult17-Jan-10 5:17 
GeneralRe: writing a windows service Pin
#realJSOP17-Jan-10 7:20
professional#realJSOP17-Jan-10 7:20 
Questionsaving images in C# Pin
djsproject16-Jan-10 18:27
djsproject16-Jan-10 18:27 
AnswerRe: saving images in C# Pin
OriginalGriff16-Jan-10 21:35
mveOriginalGriff16-Jan-10 21:35 
QuestionSetWindowPos, MoveWindow and GetWindowRect screen handling issues Pin
Electric Eddy16-Jan-10 17:17
Electric Eddy16-Jan-10 17:17 
Hi,

Has anyone experienced issues using functions such as SetWindowPos() when moving maximized remote desktop windows over extended desktops.
When I maximize the remote desktop to one of my screens and move the remote desktop to another screen using the c# MoveWindow() function the Remote Desktop yellow title tool bar gets left behind.

What I want to do is take the remote desktop out of full screen mode and run it in a restored state on another screen.

Is there an alternative as SetWindowPos only seems to handle regular windows.

It also seems to not handle multiple screens very well as when I use the functionality to maximize a screen the edges take up 4 pixel columns from point -4 to 0 and from point 1024 - 1028, where I have to manually adjust.

Hopefully I’m just using the wrong functions to position windows.

Functions uses: GetWindowRect, SetWindowPos, MoveWindow, GetWindowPlacement.

As per the following using parameters:

SW_HIDE = 0;
SW_SHOWNORMAL = 1;
SW_SHOWMINIMIZED = 2;
SW_SHOWMAXIMIZED = 3;
SW_SHOWNOACTIVATE = 4;
SW_RESTORE = 9;
SW_SHOWDEFAULT = 10;

For Min, Max and Normal:

WINDOWPLACEMENT param = new DisplayManager.WINDOWPLACEMENT();
GetWindowPlacement(referenceHandle, ref param);
param.showCmd = SW_SHOWMINIMIZED;
SetWindowPlacement(referenceHandle, ref param);

To bring a window to top:

SetWindowPos(Handle, HWND_TOPMOST, xPos, yPos, width, height, TOPMOST_FLAGS);

To move a window to a specific location:

MoveWindow((IntPtr)positionHandle, (offset + xPos), yPos, width, height, true);

Getting the position of a window:

GetWindowRect((IntPtr)positionHandle, ref activeAreaApp);

Patrick.
AnswerRe: SetWindowPos, MoveWindow and GetWindowRect screen handling issues Pin
#realJSOP17-Jan-10 3:27
professional#realJSOP17-Jan-10 3:27 
GeneralRe: SetWindowPos, MoveWindow and GetWindowRect screen handling issues Pin
Electric Eddy17-Jan-10 6:45
Electric Eddy17-Jan-10 6:45 
Questionadding data to combo box from menu item Pin
johnnysmith116-Jan-10 15:35
johnnysmith116-Jan-10 15:35 
AnswerRe: adding data to combo box from menu item Pin
DaveyM6916-Jan-10 16:15
professionalDaveyM6916-Jan-10 16:15 
GeneralRe: adding data to combo box from menu item Pin
johnnysmith116-Jan-10 16:19
johnnysmith116-Jan-10 16:19 
QuestionRetreiving next autonumber value Pin
tonyonlinux16-Jan-10 14:31
tonyonlinux16-Jan-10 14:31 
AnswerRe: Retreiving next autonumber value Pin
Luc Pattyn16-Jan-10 14:38
sitebuilderLuc Pattyn16-Jan-10 14:38 
GeneralRe: Retreiving next autonumber value Pin
tonyonlinux16-Jan-10 14:48
tonyonlinux16-Jan-10 14:48 
GeneralRe: Retreiving next autonumber value Pin
Dave Kreskowiak16-Jan-10 15:13
mveDave Kreskowiak16-Jan-10 15:13 
GeneralRe: Retreiving next autonumber value Pin
tonyonlinux16-Jan-10 15:34
tonyonlinux16-Jan-10 15:34 
GeneralRe: Retreiving next autonumber value Pin
Luc Pattyn16-Jan-10 15:16
sitebuilderLuc Pattyn16-Jan-10 15:16 
GeneralRe: Retreiving next autonumber value Pin
tonyonlinux16-Jan-10 15:41
tonyonlinux16-Jan-10 15:41 
GeneralRe: Retreiving next autonumber value Pin
Dave Kreskowiak16-Jan-10 19:33
mveDave Kreskowiak16-Jan-10 19:33 
GeneralRe: Retreiving next autonumber value Pin
tonyonlinux17-Jan-10 8:29
tonyonlinux17-Jan-10 8:29 
GeneralRe: Retreiving next autonumber value Pin
Dave Kreskowiak17-Jan-10 8:55
mveDave Kreskowiak17-Jan-10 8:55 
GeneralRe: Retreiving next autonumber value Pin
tonyonlinux17-Jan-10 9:19
tonyonlinux17-Jan-10 9:19 
GeneralRe: Retreiving next autonumber value Pin
Dave Kreskowiak17-Jan-10 15:05
mveDave Kreskowiak17-Jan-10 15:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.