Click here to Skip to main content
15,914,071 members
Home / Discussions / C#
   

C#

 
QuestionWriting in a Xml Pin
Anka_Ame10-May-07 4:34
Anka_Ame10-May-07 4:34 
AnswerRe: Writing in a Xml Pin
led mike10-May-07 5:14
led mike10-May-07 5:14 
QuestionCan I get the data in a specific Column/Cell instead of the entire data in the Row? [modified] Pin
Khoramdin10-May-07 4:32
Khoramdin10-May-07 4:32 
AnswerRe: Can I get the data in a specific Cell instead of the entire data in the Row? Pin
led mike10-May-07 5:10
led mike10-May-07 5:10 
GeneralRe: Can I get the data in a specific Cell instead of the entire data in the Row? Pin
Khoramdin10-May-07 6:13
Khoramdin10-May-07 6:13 
GeneralRe: Can I get the data in a specific Cell instead of the entire data in the Row? Pin
led mike10-May-07 6:31
led mike10-May-07 6:31 
GeneralRe: Can I get the data in a specific Cell instead of the entire data in the Row? Pin
Khoramdin10-May-07 12:59
Khoramdin10-May-07 12:59 
QuestionSetWindowPos fails Pin
Stevo Z10-May-07 4:01
Stevo Z10-May-07 4:01 
Hi,

I need to move(change Location and Z-order) of a window (which is not focused) without activating it. Sometimes the form is on background.

For that, I use :

 <br />
[DllImport("user32.dll")]<br />
public static extern int SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags);


that works fine, but sometimes it fails. Every time I need to move that specified window (particulary change position and z-order) , i do it like :

Win32Native.SetWindowPos(this.Handle, parentHandle, newPosition.X, newPosition.Y, 0, 0,<br />
                   (int)Win32Native.SetWindowPosOptions.SWP_NOSIZE |<br />
                   (int)Win32Native.SetWindowPosOptions.SWP_NOACTIVATE);




Where:

parentHandle - Handle of window that should be (is) allways right behind this window.
newPosition - correctly calculated new desktop position.

Win32Native is my custom class with many user32.dll and other methods, enumerations, structures etc...

I've also tried to put

Win32Native.SetWindowPos(this.Handle, parentHandle, 0, 0, 0, 0,<br />
                        (int)(Win32Native.SetWindowPosOptions.SWP_FRAMECHANGED |<br />
                        Win32Native.SetWindowPosOptions.SWP_NOSIZE | <br />
                        Win32Native.SetWindowPosOptions.SWP_NOZORDER | <br />
                        Win32Native.SetWindowPosOptions.SWP_NOACTIVATE |<br />
                        Win32Native.SetWindowPosOptions.SWP_NOMOVE));


and

Application.DoEvents();

right behind, but it didn't help too. It works fine when the parent window (the window thats always right behind this window) is active, but as soon as it is not active (focused), it starts to fail changing this window position.

Do you have any idea why?
AnswerRe: SetWindowPos fails Pin
Judah Gabriel Himango10-May-07 5:07
sponsorJudah Gabriel Himango10-May-07 5:07 
GeneralRe: SetWindowPos fails Pin
Stevo Z10-May-07 5:26
Stevo Z10-May-07 5:26 
AnswerRe: SetWindowPos fails Pin
Giorgi Dalakishvili10-May-07 11:39
mentorGiorgi Dalakishvili10-May-07 11:39 
GeneralRe: SetWindowPos fails Pin
Stevo Z10-May-07 21:25
Stevo Z10-May-07 21:25 
Questionhow to compare two dates excluding the seconds. Pin
Exelioindia10-May-07 3:37
Exelioindia10-May-07 3:37 
AnswerRe: how to compare two dates excluding the seconds. Pin
Colin Angus Mackay10-May-07 3:48
Colin Angus Mackay10-May-07 3:48 
QuestionAuto-hyperlinking URLs Pin
__DanC__10-May-07 3:24
__DanC__10-May-07 3:24 
AnswerRe: Auto-hyperlinking URLs Pin
Stevo Z10-May-07 4:33
Stevo Z10-May-07 4:33 
GeneralRe: Auto-hyperlinking URLs Pin
__DanC__10-May-07 6:00
__DanC__10-May-07 6:00 
QuestionQuery Pin
vasavi.polisetty10-May-07 3:16
vasavi.polisetty10-May-07 3:16 
AnswerRe: Query Pin
Arun.Immanuel10-May-07 3:18
Arun.Immanuel10-May-07 3:18 
AnswerRe: Query Pin
__DanC__10-May-07 3:25
__DanC__10-May-07 3:25 
AnswerRe: Query Pin
Colin Angus Mackay10-May-07 3:26
Colin Angus Mackay10-May-07 3:26 
AnswerRe: Query Pin
mamirbalouch10-May-07 5:52
mamirbalouch10-May-07 5:52 
QuestiontxTextControl load for a .pdf Pin
WhiteGirl2310-May-07 2:31
WhiteGirl2310-May-07 2:31 
AnswerRe: txTextControl load for a .pdf Pin
andyharman10-May-07 4:54
professionalandyharman10-May-07 4:54 
QuestionHow to add code of form to windows service? Pin
haroon198010-May-07 1:59
haroon198010-May-07 1:59 

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.