Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
I was wondering if it is possible to move other programs around on the screen for example, i click a button in my program and it will move skype the top right of the screen and lets say its at pos(x- 100, Y - 50)?
 
If this is possible to do please give me information on how to do it or something, because Im really sick of my game always moving to the centre of my screen.
Posted 12-Jan-13 19:03pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

It is possible some information on how to do this, am explain in the basis of VC++ but I believe you can achieve the same in C#.
 
Capture the Window Handle of your application by window Id or by searching DesktopWindows
Using the Handle call the SetWindowPos to move your window
 
some examples
using-setwindowpos-in-c-sharp-to-move-windows-around[^]
  Permalink  
Comments
TechXSoftware at 13-Jan-13 4:20am
   
i have the code it works great, I was just wondering if i can do this with just 1 process?
jibesh at 13-Jan-13 4:23am
   
Thats nice. but what do you mean by just 1 process?
TechXSoftware at 13-Jan-13 4:28am
   
Well right now the code is made so that it will move all programs running to that position, i just want it to happen to 1 program, and that is the leagueoflenges.exe
Andreas Gieriet at 13-Jan-13 9:47am
   
Please!
If you follow that link above and if you then follow-up by checking google for c# process class mainwindowhandle, you will find how to use it.
If you don't know how to search for a process in C#, ask google C# find process by name.
Andi

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 254
1 Nirav Prabtani 223
2 Sergey Alexandrovich Kryukov 209
3 _Amy 165
4 Richard MacCutchan 135
0 OriginalGriff 7,799
1 Sergey Alexandrovich Kryukov 6,966
2 Maciej Los 3,994
3 Peter Leow 3,708
4 CHill60 2,742


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 13 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100