Click here to Skip to main content
15,867,950 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Progammer Forum for Beginners? Pin
User987434-Jan-18 5:50
professionalUser987434-Jan-18 5:50 
GeneralRe: C# Progammer Forum for Beginners? Pin
BillWoodruff4-Jan-18 21:09
professionalBillWoodruff4-Jan-18 21:09 
QuestionQuestion On Using IProgress Pin
Kevin Marois2-Jan-18 12:51
professionalKevin Marois2-Jan-18 12:51 
AnswerRe: Question On Using IProgress Pin
Kenneth Haugland3-Jan-18 18:48
mvaKenneth Haugland3-Jan-18 18:48 
Questionwhat is the C# code to read TYPES.cursortype in procedure Pin
sudipta saha1-Jan-18 21:31
sudipta saha1-Jan-18 21:31 
AnswerRe: what is the C# code to read TYPES.cursortype in procedure Pin
Luc Pattyn2-Jan-18 12:45
sitebuilderLuc Pattyn2-Jan-18 12:45 
GeneralRe: what is the C# code to read TYPES.cursortype in procedure Pin
sudipta saha2-Jan-18 20:40
sudipta saha2-Jan-18 20:40 
QuestionProblem with setwindowPOS and returning from topmost to standard window position? Pin
turbosupramk31-Jan-18 20:17
turbosupramk31-Jan-18 20:17 
I'm using the code below to temporarily set a window to top most foreground. How can I return it to the standard function of being in the foreground depending on the last time it was touched by the mouse? I can't seem to figure out which uint32 to use to achieve what I'd like?

private static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
        private static readonly IntPtr HWND_NOTOPMOST = new IntPtr(-2);

        private const UInt32 SWP_NOSIZE = 0x0001;
        private const UInt32 SWP_NOMOVE = 0x0002;
        private const UInt32 SWP_NOZORDER = 0x0004;
        private const UInt32 SWP_NOREDRAW = 0x0008;
        private const UInt32 SWP_NOACTIVATE = 0x0010;
        private const UInt32 SWP_DRAWFRAME = 0x0020;
        private const UInt32 SWP_FRAMECHANGED = 0x0020;
        private const UInt32 SWP_SHOWWINDOW = 0x0040;
        private const UInt32 SWP_HIDEWINDOW = 0x0080;
        private const UInt32 SWP_NOCOPYBITS = 0x0100;
        private const UInt32 SWP_NOOWNERZORDER = 0x0200;
        private const UInt32 SWP_NOREPOSITION = 0x0200;
        private const UInt32 SWP_NOSENDCHANGING = 0x0400;
        private const UInt32 SWP_DEFERERASE = 0x2000;
        private const UInt32 SWP_ASYNCWINDOWPOS = 0x4000;

        private const UInt32 TOPMOST_FLAGS = SWP_NOMOVE | SWP_NOSIZE;
        private const UInt32 NOTOPMOST_FLAGS = SWP_SHOWWINDOW;

        [DllImport("user32.dll")]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);


SetWindowPos(this.Handle, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS);




Thanks!
AnswerRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
Richard MacCutchan1-Jan-18 23:07
mveRichard MacCutchan1-Jan-18 23:07 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
turbosupramk32-Jan-18 4:40
turbosupramk32-Jan-18 4:40 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
Richard MacCutchan2-Jan-18 5:38
mveRichard MacCutchan2-Jan-18 5:38 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
turbosupramk32-Jan-18 6:22
turbosupramk32-Jan-18 6:22 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
Richard MacCutchan2-Jan-18 6:42
mveRichard MacCutchan2-Jan-18 6:42 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
turbosupramk32-Jan-18 7:33
turbosupramk32-Jan-18 7:33 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
Luc Pattyn2-Jan-18 12:41
sitebuilderLuc Pattyn2-Jan-18 12:41 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
turbosupramk32-Jan-18 13:08
turbosupramk32-Jan-18 13:08 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
Luc Pattyn2-Jan-18 13:31
sitebuilderLuc Pattyn2-Jan-18 13:31 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
turbosupramk33-Jan-18 2:51
turbosupramk33-Jan-18 2:51 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
Richard MacCutchan3-Jan-18 23:18
mveRichard MacCutchan3-Jan-18 23:18 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
turbosupramk35-Jan-18 16:43
turbosupramk35-Jan-18 16:43 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
Richard MacCutchan5-Jan-18 22:24
mveRichard MacCutchan5-Jan-18 22:24 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
turbosupramk36-Jan-18 2:21
turbosupramk36-Jan-18 2:21 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
Richard MacCutchan6-Jan-18 5:53
mveRichard MacCutchan6-Jan-18 5:53 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
turbosupramk36-Jan-18 6:17
turbosupramk36-Jan-18 6:17 
GeneralRe: Problem with setwindowPOS and returning from topmost to standard window position? Pin
turbosupramk36-Jan-18 12:09
turbosupramk36-Jan-18 12:09 

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.